Skip to content

Commit e29692f

Browse files
yomybabyironAiken2
authored andcommitted
chore: remove unused backend-ai-agent-list (#2683)
<!-- Please precisely, concisely, and concretely describe what this PR changes, the rationale behind codes, and how it affects the users and other developers. --> **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
1 parent 228ea96 commit e29692f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1641
-253
lines changed

manifest/backend.ai-white-text.svg

+24
Loading

react/src/App.tsx

+14-10
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ const EndpointDetailPage = React.lazy(
2929
() => import('./pages/EndpointDetailPage'),
3030
);
3131
// const SummaryPage = React.lazy(() => import('./pages/SummaryPage'));
32+
const StartPage = React.lazy(() => import('./pages/StartPage'));
3233
const EnvironmentPage = React.lazy(() => import('./pages/EnvironmentPage'));
3334
const MyEnvironmentPage = React.lazy(() => import('./pages/MyEnvironmentPage'));
3435
const StorageHostSettingPage = React.lazy(
3536
() => import('./pages/StorageHostSettingPage'),
3637
);
3738
const UserSettingsPage = React.lazy(() => import('./pages/UserSettingsPage'));
38-
const SessionListPage = React.lazy(() => import('./pages/SessionListPage'));
39+
// const SessionListPage = React.lazy(() => import('./pages/SessionListPage'));
40+
const NeoSessionPage = React.lazy(() => import('./pages/NeoSessionPage'));
3941
const SessionLauncherPage = React.lazy(
4042
() => import('./pages/SessionLauncherPage'),
4143
);
@@ -57,9 +59,9 @@ const InteractiveLoginPage = React.lazy(
5759
);
5860
const ImportAndRunPage = React.lazy(() => import('./pages/ImportAndRunPage'));
5961

60-
const RedirectToSummary = () => {
62+
const RedirectToStart = () => {
6163
useSuspendedBackendaiClient();
62-
const pathName = '/summary';
64+
const pathName = '/start';
6365
document.dispatchEvent(
6466
new CustomEvent('move-to-from-react', {
6567
detail: {
@@ -68,7 +70,7 @@ const RedirectToSummary = () => {
6870
},
6971
}),
7072
);
71-
return <Navigate to="/summary" replace />;
73+
return <Navigate to="/start" replace />;
7274
};
7375

7476
const router = createBrowserRouter([
@@ -105,20 +107,20 @@ const router = createBrowserRouter([
105107
children: [
106108
{
107109
path: '/',
108-
element: <RedirectToSummary />,
110+
element: <RedirectToStart />,
109111
},
110112
{
111113
//for electron dev mode
112114
path: '/build/electron-app/app/index.html',
113-
element: <RedirectToSummary />,
115+
element: <RedirectToStart />,
114116
},
115117
{
116118
//for electron prod mode
117119
path: '/app/index.html',
118-
element: <RedirectToSummary />,
120+
element: <RedirectToStart />,
119121
},
120122
{
121-
path: '/summary',
123+
path: '/start',
122124
Component: () => {
123125
const { token } = theme.useToken();
124126
return (
@@ -131,10 +133,11 @@ const router = createBrowserRouter([
131133
closable
132134
/>
133135
{/* <SummaryPage /> */}
136+
<StartPage />
134137
</>
135138
);
136139
},
137-
handle: { labelKey: 'webui.menu.Summary' },
140+
handle: { labelKey: 'start' },
138141
},
139142
{
140143
path: '/job',
@@ -299,7 +302,8 @@ const router = createBrowserRouter([
299302
{
300303
path: '/session',
301304
handle: { labelKey: 'webui.menu.Sessions' },
302-
Component: SessionListPage,
305+
Component: NeoSessionPage,
306+
// Component: SessionListPage,
303307
},
304308
{
305309
path: '/session/start',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import Flex from './Flex';
2+
import ResourceGroupSelect from './ResourceGroupSelect';
3+
import ResourceUnit, { ResourceUnitProps } from './ResourceUnit';
4+
import { SyncOutlined } from '@ant-design/icons';
5+
import {
6+
Button,
7+
Card,
8+
CardProps,
9+
ConfigProvider,
10+
Divider,
11+
Switch,
12+
theme,
13+
Typography,
14+
} from 'antd';
15+
import _ from 'lodash';
16+
import React from 'react';
17+
import { useTranslation } from 'react-i18next';
18+
19+
interface AllocatedResourcesCardProps extends CardProps {}
20+
21+
const AllocatedResourcesCard: React.FC<AllocatedResourcesCardProps> = ({
22+
...cardProps
23+
}) => {
24+
const { token } = theme.useToken();
25+
const { t } = useTranslation();
26+
27+
const resourceUnitMockData: Array<ResourceUnitProps> = [
28+
{
29+
name: 'CPU',
30+
displayUnit: 'Core',
31+
value: 12,
32+
percentage: (4 / 12) * 100,
33+
},
34+
{
35+
name: 'RAM',
36+
displayUnit: 'GiB',
37+
value: 256,
38+
percentage: (8 / 12) * 100,
39+
},
40+
{
41+
name: 'FGPU',
42+
displayUnit: 'GiB',
43+
value: 3.5,
44+
percentage: (4 / 12) * 100,
45+
},
46+
{
47+
name: 'ATOM',
48+
displayUnit: 'Unit',
49+
value: 2,
50+
percentage: (2 / 12) * 100,
51+
},
52+
];
53+
return (
54+
<ConfigProvider
55+
theme={{
56+
components: {
57+
Button: {
58+
onlyIconSizeLG: 20,
59+
},
60+
},
61+
}}
62+
>
63+
<Card
64+
{...cardProps}
65+
style={{
66+
width: '100%',
67+
height: 240,
68+
// width: 936,
69+
// height: 192,
70+
}}
71+
>
72+
<Flex justify="between" style={{ marginBottom: 26 }}>
73+
<Flex gap={10}>
74+
<Typography.Title
75+
level={4}
76+
style={{
77+
margin: 0,
78+
}}
79+
>
80+
Allocated Resources
81+
</Typography.Title>
82+
<Switch defaultChecked />
83+
</Flex>
84+
<Flex>
85+
<ResourceGroupSelect
86+
placeholder={t('session.ResourceGroup')}
87+
variant="borderless"
88+
style={{ minWidth: 151, fontSize: token.fontSizeLG, padding: 0 }}
89+
dropdownStyle={{ color: '#999999' }}
90+
/>
91+
<Button
92+
type="link"
93+
size="large"
94+
icon={<SyncOutlined />}
95+
style={{ padding: 0, color: '#5DD2AD' }}
96+
/>
97+
</Flex>
98+
</Flex>
99+
<Flex justify="between" style={{ maxWidth: 630 }}>
100+
{_.map(
101+
resourceUnitMockData,
102+
(resourceUnit: ResourceUnitProps, index) => (
103+
<>
104+
<ResourceUnit
105+
key={index}
106+
name={resourceUnit.name}
107+
displayUnit={resourceUnit.displayUnit}
108+
value={resourceUnit.value}
109+
percentage={resourceUnit.percentage}
110+
/>
111+
{index < resourceUnitMockData.length - 1 && (
112+
<Divider type="vertical" style={{ height: 70 }} />
113+
)}
114+
</>
115+
),
116+
)}
117+
</Flex>
118+
</Card>
119+
</ConfigProvider>
120+
);
121+
};
122+
123+
export default AllocatedResourcesCard;

react/src/components/BAIMenu.tsx

+20-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
import { ConfigProvider, Menu, MenuProps, theme } from 'antd';
22
import React from 'react';
33

4-
// interface BAIMenuProps extends MenuProps {
5-
6-
// }
7-
8-
const BAIMenu: React.FC<MenuProps> = ({ ...props }) => {
4+
interface BAIMenuProps extends MenuProps {
5+
isAdminMenu?: boolean;
6+
}
7+
const BAIMenu: React.FC<BAIMenuProps> = ({ ...props }) => {
98
const { token } = theme.useToken();
109
return (
1110
<>
1211
<style>
1312
{`
1413
.bai-menu li.ant-menu-item.ant-menu-item-selected {
1514
overflow: visible;
16-
font-weight: 600;
1715
}
1816
1917
.bai-menu li.ant-menu-item.ant-menu-item-selected::before {
@@ -22,7 +20,6 @@ const BAIMenu: React.FC<MenuProps> = ({ ...props }) => {
2220
bottom: 0;
2321
position: absolute;
2422
right: auto;
25-
border-right: 3px solid ${token.colorPrimary};
2623
transform: scaleY(1);
2724
opacity: 1;
2825
content: "";
@@ -33,8 +30,23 @@ const BAIMenu: React.FC<MenuProps> = ({ ...props }) => {
3330
theme={{
3431
components: {
3532
Menu: {
36-
itemBorderRadius: 2,
33+
itemBorderRadius: 20,
3734
itemMarginInline: 0,
35+
colorPrimaryBorder: props.isAdminMenu
36+
? token.colorSuccess
37+
: token.colorInfoHover,
38+
itemHoverBg: props.isAdminMenu
39+
? token.colorSuccessBgHover
40+
: token.colorInfoHover,
41+
itemHoverColor: props.isAdminMenu
42+
? token.colorSuccessHover
43+
: token.colorPrimaryBg,
44+
itemSelectedBg: props.isAdminMenu
45+
? token.colorSuccessBgHover
46+
: token.colorInfoHover,
47+
itemSelectedColor: props.isAdminMenu
48+
? token.colorSuccessHover
49+
: token.colorPrimaryBg,
3850
},
3951
},
4052
}}

react/src/components/BAINotificationButton.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import { atom, useAtom } from 'jotai';
1010
import _ from 'lodash';
1111
import React, { useEffect } from 'react';
1212

13-
interface Props extends ButtonProps {}
13+
interface Props extends ButtonProps {
14+
iconColor?: string;
15+
}
1416
export const isOpenDrawerState = atom(false);
1517

1618
const BAINotificationButton: React.FC<Props> = ({ ...props }) => {
@@ -37,7 +39,7 @@ const BAINotificationButton: React.FC<Props> = ({ ...props }) => {
3739
size="large"
3840
icon={
3941
<Badge dot={hasRunningBackgroundTask}>
40-
<BellOutlined />
42+
<BellOutlined style={{ color: props.iconColor ?? 'inherit' }} />
4143
</Badge>
4244
}
4345
type="text"

react/src/components/BAISider.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Flex from './Flex';
2+
import { DRAWER_WIDTH } from './WEBUINotificationDrawer';
23
import { ConfigProvider, Grid, SiderProps, Typography, theme } from 'antd';
34
import Sider from 'antd/es/layout/Sider';
45
import _ from 'lodash';
@@ -56,7 +57,7 @@ const BAISider: React.FC<BAISiderProps> = ({
5657
`}
5758
</style>
5859
<Sider
59-
width={221}
60+
width={DRAWER_WIDTH}
6061
breakpoint="md"
6162
style={{
6263
overflowX: 'hidden',
@@ -65,7 +66,7 @@ const BAISider: React.FC<BAISiderProps> = ({
6566
position: 'sticky',
6667
top: 0,
6768
left: 0,
68-
borderRight: '1px solid',
69+
background: '#FFF',
6970
borderColor: token.colorBorder,
7071
paddingTop: token.paddingContentVerticalSM,
7172
scrollbarColor: 'auto',
@@ -86,7 +87,7 @@ const BAISider: React.FC<BAISiderProps> = ({
8687
algorithm: siderTheme === 'dark' ? theme.darkAlgorithm : undefined,
8788
}}
8889
>
89-
<Flex
90+
{/* <Flex
9091
direction="column"
9192
justify="start"
9293
align="start"
@@ -120,7 +121,7 @@ const BAISider: React.FC<BAISiderProps> = ({
120121
{otherProps.collapsed ? logoTitleCollapsed : logoTitle}
121122
</Typography.Text>
122123
</div>
123-
</Flex>
124+
</Flex> */}
124125
{children}
125126
{bottomText && (
126127
<>

0 commit comments

Comments
 (0)