From 666f36fb2afb889b63985479e5ff5bb29d7d5f4f Mon Sep 17 00:00:00 2001 From: yomybaby <621215+yomybaby@users.noreply.github.com> Date: Wed, 4 Sep 2024 04:48:49 +0000 Subject: [PATCH] chore: remove unused backend-ai-agent-list (#2683) **Checklist:** (if applicable) - [ ] Mention to the original issue - [ ] Documentation - [ ] Minium required manager version - [ ] Specific setting for review (eg., KB link, endpoint or how to setup) - [ ] Minimum requirements to check during review - [ ] Test case(s) to demonstrate the difference of before/after --- manifest/backend.ai-white-text.svg | 24 ++ react/src/App.tsx | 24 +- .../src/components/AllocatedResourcesCard.tsx | 123 ++++++++ react/src/components/BAIMenu.tsx | 28 +- .../src/components/BAINotificationButton.tsx | 6 +- react/src/components/BAISider.tsx | 9 +- react/src/components/BAIStartBasicCard.tsx | 127 ++++++++ react/src/components/BAIStartSimpleCard.tsx | 111 +++++++ react/src/components/DefaultProviders.tsx | 1 + .../src/components/MainLayout/MainLayout.tsx | 78 +++-- .../src/components/MainLayout/WebUIHeader.tsx | 126 +++++--- .../src/components/MainLayout/WebUISider.tsx | 183 +++++++---- react/src/components/NeoSessionList.tsx | 283 ++++++++++++++++++ react/src/components/ResourceUnit.tsx | 70 +++++ react/src/components/UserDropdownMenu.tsx | 22 +- react/src/components/WEBUIHelpButton.tsx | 10 +- .../components/WEBUINotificationDrawer.tsx | 2 +- .../src/components/WebUIThemeToggleButton.tsx | 12 +- react/src/components/icons/BatchSession.svg | 5 + .../src/components/icons/BatchSessionIcon.tsx | 12 + react/src/components/icons/Endpoints.svg | 6 + react/src/components/icons/EndpointsIcon.tsx | 12 + react/src/components/icons/ExampleStart.svg | 6 + react/src/components/icons/ExampleStart.tsx | 12 + react/src/components/icons/Examples.svg | 6 + react/src/components/icons/ExamplesIcon.tsx | 12 + .../components/icons/InteractiveSession.svg | 4 + .../components/icons/InteractiveSession.tsx | 14 + react/src/components/icons/ModelService.svg | 3 + .../src/components/icons/ModelServiceIcon.tsx | 12 + react/src/components/icons/Models.svg | 5 + react/src/components/icons/ModelsIcon.tsx | 12 + react/src/components/icons/Pipelines.svg | 5 + react/src/components/icons/PipelinesIcon.tsx | 12 + react/src/components/icons/Sessions.svg | 10 + react/src/components/icons/SessionsIcon.tsx | 12 + react/src/components/icons/Trails.svg | 10 + react/src/components/icons/TrailsIcon.tsx | 12 + react/src/components/icons/URLStart.svg | 7 + react/src/components/icons/URLStartIcon.tsx | 12 + react/src/components/icons/UserOutlined.svg | 11 + .../src/components/icons/UserOutlinedIcon.tsx | 12 + react/src/icons/session.svg | 3 + react/src/pages/NeoSessionPage.tsx | 89 ++++++ react/src/pages/StartPage.tsx | 139 +++++++++ resources/icons/URLStart.svg | 7 + resources/icons/session.svg | 3 + resources/theme.json | 161 ++++++---- src/backend-ai-app.ts | 4 +- src/components/backend-ai-error-view.ts | 6 +- .../backend-ai-permission-denied-view.ts | 4 +- src/components/backend-ai-storage-list.ts | 2 +- .../backend-ai-storage-proxy-list.ts | 2 +- src/components/backend-ai-summary-view.ts | 2 +- src/components/backend-ai-webui.ts | 9 +- 55 files changed, 1641 insertions(+), 253 deletions(-) create mode 100644 manifest/backend.ai-white-text.svg create mode 100644 react/src/components/AllocatedResourcesCard.tsx create mode 100644 react/src/components/BAIStartBasicCard.tsx create mode 100644 react/src/components/BAIStartSimpleCard.tsx create mode 100644 react/src/components/NeoSessionList.tsx create mode 100644 react/src/components/ResourceUnit.tsx create mode 100644 react/src/components/icons/BatchSession.svg create mode 100644 react/src/components/icons/BatchSessionIcon.tsx create mode 100644 react/src/components/icons/Endpoints.svg create mode 100644 react/src/components/icons/EndpointsIcon.tsx create mode 100644 react/src/components/icons/ExampleStart.svg create mode 100644 react/src/components/icons/ExampleStart.tsx create mode 100644 react/src/components/icons/Examples.svg create mode 100644 react/src/components/icons/ExamplesIcon.tsx create mode 100644 react/src/components/icons/InteractiveSession.svg create mode 100644 react/src/components/icons/InteractiveSession.tsx create mode 100644 react/src/components/icons/ModelService.svg create mode 100644 react/src/components/icons/ModelServiceIcon.tsx create mode 100644 react/src/components/icons/Models.svg create mode 100644 react/src/components/icons/ModelsIcon.tsx create mode 100644 react/src/components/icons/Pipelines.svg create mode 100644 react/src/components/icons/PipelinesIcon.tsx create mode 100644 react/src/components/icons/Sessions.svg create mode 100644 react/src/components/icons/SessionsIcon.tsx create mode 100644 react/src/components/icons/Trails.svg create mode 100644 react/src/components/icons/TrailsIcon.tsx create mode 100644 react/src/components/icons/URLStart.svg create mode 100644 react/src/components/icons/URLStartIcon.tsx create mode 100644 react/src/components/icons/UserOutlined.svg create mode 100644 react/src/components/icons/UserOutlinedIcon.tsx create mode 100644 react/src/icons/session.svg create mode 100644 react/src/pages/NeoSessionPage.tsx create mode 100644 react/src/pages/StartPage.tsx create mode 100644 resources/icons/URLStart.svg create mode 100644 resources/icons/session.svg 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 2eb8e37f05..427c28fa2f 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'), ); @@ -60,9 +62,9 @@ const InteractiveLoginPage = React.lazy( ); const ImportAndRunPage = React.lazy(() => import('./pages/ImportAndRunPage')); -const RedirectToSummary = () => { +const RedirectToStart = () => { useSuspendedBackendaiClient(); - const pathName = '/summary'; + const pathName = '/start'; document.dispatchEvent( new CustomEvent('move-to-from-react', { detail: { @@ -71,7 +73,7 @@ const RedirectToSummary = () => { }, }), ); - return ; + return ; }; const router = createBrowserRouter([ @@ -108,20 +110,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 ( @@ -134,10 +136,11 @@ const router = createBrowserRouter([ closable /> {/* */} + ); }, - handle: { labelKey: 'webui.menu.Summary' }, + handle: { labelKey: 'start' }, }, { path: '/job', @@ -307,7 +310,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..196b0bc6a4 --- /dev/null +++ b/react/src/components/AllocatedResourcesCard.tsx @@ -0,0 +1,123 @@ +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 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 + + + + + +