diff --git a/manifest/backend.ai-white-text.svg b/manifest/backend.ai-white-text.svg new file mode 100644 index 0000000000..431c69c6d6 --- /dev/null +++ b/manifest/backend.ai-white-text.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/react/src/App.tsx b/react/src/App.tsx index 3e2da8daf0..75ef657d21 100644 --- a/react/src/App.tsx +++ b/react/src/App.tsx @@ -29,13 +29,15 @@ const EndpointDetailPage = React.lazy( () => import('./pages/EndpointDetailPage'), ); // const SummaryPage = React.lazy(() => import('./pages/SummaryPage')); +const StartPage = React.lazy(() => import('./pages/StartPage')); const EnvironmentPage = React.lazy(() => import('./pages/EnvironmentPage')); const MyEnvironmentPage = React.lazy(() => import('./pages/MyEnvironmentPage')); const StorageHostSettingPage = React.lazy( () => import('./pages/StorageHostSettingPage'), ); const UserSettingsPage = React.lazy(() => import('./pages/UserSettingsPage')); -const SessionListPage = React.lazy(() => import('./pages/SessionListPage')); +// const SessionListPage = React.lazy(() => import('./pages/SessionListPage')); +const NeoSessionPage = React.lazy(() => import('./pages/NeoSessionPage')); const SessionLauncherPage = React.lazy( () => import('./pages/SessionLauncherPage'), ); @@ -61,9 +63,9 @@ const ComputeSessionList = React.lazy( () => import('./components/ComputeSessionList'), ); -const RedirectToSummary = () => { +const RedirectToStart = () => { useSuspendedBackendaiClient(); - const pathName = '/summary'; + const pathName = '/start'; document.dispatchEvent( new CustomEvent('move-to-from-react', { detail: { @@ -72,7 +74,7 @@ const RedirectToSummary = () => { }, }), ); - return ; + return ; }; const router = createBrowserRouter([ @@ -109,20 +111,20 @@ const router = createBrowserRouter([ children: [ { path: '/', - element: , + element: , }, { //for electron dev mode path: '/build/electron-app/app/index.html', - element: , + element: , }, { //for electron prod mode path: '/app/index.html', - element: , + element: , }, { - path: '/summary', + path: '/start', Component: () => { const { token } = theme.useToken(); return ( @@ -135,10 +137,11 @@ const router = createBrowserRouter([ closable /> {/* */} + ); }, - handle: { labelKey: 'webui.menu.Summary' }, + handle: { labelKey: 'start' }, }, { path: '/job', @@ -308,7 +311,8 @@ const router = createBrowserRouter([ { path: '/session', handle: { labelKey: 'webui.menu.Sessions' }, - Component: SessionListPage, + Component: NeoSessionPage, + // Component: SessionListPage, }, { path: '/session/start', diff --git a/react/src/components/AllocatedResourcesCard.tsx b/react/src/components/AllocatedResourcesCard.tsx new file mode 100644 index 0000000000..b03eda4946 --- /dev/null +++ b/react/src/components/AllocatedResourcesCard.tsx @@ -0,0 +1,127 @@ +import { useCurrentProjectValue } from '../hooks/useCurrentProject'; +import Flex from './Flex'; +import ResourceGroupSelect from './ResourceGroupSelect'; +import ResourceUnit, { ResourceUnitProps } from './ResourceUnit'; +import { SyncOutlined } from '@ant-design/icons'; +import { + Button, + Card, + CardProps, + ConfigProvider, + Divider, + Switch, + theme, + Typography, +} from 'antd'; +import _ from 'lodash'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +interface AllocatedResourcesCardProps extends CardProps {} + +const AllocatedResourcesCard: React.FC = ({ + ...cardProps +}) => { + const { token } = theme.useToken(); + const { t } = useTranslation(); + const currentProject = useCurrentProjectValue(); + + const resourceUnitMockData: Array = [ + { + name: 'CPU', + displayUnit: 'Core', + value: 12, + percentage: (4 / 12) * 100, + }, + { + name: 'RAM', + displayUnit: 'GiB', + value: 256, + percentage: (8 / 12) * 100, + }, + { + name: 'FGPU', + displayUnit: 'GiB', + value: 3.5, + percentage: (4 / 12) * 100, + }, + { + name: 'ATOM', + displayUnit: 'Unit', + value: 2, + percentage: (2 / 12) * 100, + }, + ]; + return ( + + + + + + Allocated Resources + + + + + +