Skip to content

Commit 795ce6f

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 c6f8a30 commit 795ce6f

Some content is hidden

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

54 files changed

+1518
-253
lines changed

Diff for: manifest/backend.ai-white-text.svg

+24
Loading

Diff for: 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',

Diff for: 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
}}

Diff for: 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"

Diff for: 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
<>

Diff for: react/src/components/BAIStartBasicCard.tsx

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import Flex from './Flex';
2+
import {
3+
Button,
4+
ButtonProps,
5+
Card,
6+
CardProps,
7+
ConfigProvider,
8+
Divider,
9+
theme,
10+
Typography,
11+
} from 'antd';
12+
13+
export interface BAIStartBasicCardProps extends CardProps {
14+
icon: React.ReactNode;
15+
title: React.ReactNode;
16+
footerButtonProps: ButtonProps;
17+
description?: string;
18+
secondary?: Boolean;
19+
}
20+
21+
const BAIStartBasicCard: React.FC<BAIStartBasicCardProps> = ({
22+
icon,
23+
title,
24+
footerButtonProps,
25+
description,
26+
secondary,
27+
...cardProps
28+
}) => {
29+
const { token } = theme.useToken();
30+
31+
return (
32+
<ConfigProvider
33+
theme={{
34+
components: {
35+
Button: {
36+
defaultBorderColor: 'none',
37+
defaultColor: secondary ? '#E8FAF6' : '#FFF6E8',
38+
defaultBg: secondary ? '#00BD9B' : token.colorPrimaryBg,
39+
defaultHoverColor: secondary ? '#00BD9B' : token.colorPrimary,
40+
defaultHoverBorderColor: secondary ? '#00BD9B' : token.colorPrimary,
41+
},
42+
},
43+
}}
44+
>
45+
<Card
46+
{...cardProps}
47+
styles={{
48+
body: {
49+
paddingTop: token.paddingSM,
50+
paddingBottom: token.paddingSM,
51+
paddingLeft: token.paddingMD,
52+
paddingRight: token.paddingMD,
53+
width: 210,
54+
height: 308,
55+
},
56+
}}
57+
>
58+
<Flex
59+
direction="column"
60+
justify="between"
61+
align="stretch"
62+
style={{ height: '100%' }}
63+
>
64+
<Flex
65+
align="center"
66+
direction="column"
67+
gap={16}
68+
style={{
69+
minHeight: 202,
70+
}}
71+
>
72+
<Flex
73+
align="center"
74+
justify="center"
75+
style={{
76+
width: 50,
77+
height: 50,
78+
padding: 0,
79+
border: 0,
80+
color: secondary ? '#00BD9B' : '#FF7A00',
81+
background: secondary ? '#E8FAF6' : '#FFF6E8',
82+
fontSize: token.sizeLG,
83+
borderRadius: '50%',
84+
}}
85+
>
86+
{icon}
87+
</Flex>
88+
<Typography.Text
89+
strong
90+
style={{
91+
fontSize: token.fontSizeLG,
92+
color: secondary ? '#00BD9B' : token.colorLink,
93+
textAlign: 'center',
94+
}}
95+
>
96+
{title}
97+
</Typography.Text>
98+
{description && (
99+
<Typography.Paragraph
100+
style={{
101+
color: token.colorTextDescription,
102+
fontSize: token.fontSize - 4,
103+
textAlign: 'center',
104+
}}
105+
>
106+
{description}
107+
</Typography.Paragraph>
108+
)}
109+
</Flex>
110+
<Flex direction="column">
111+
<Divider style={{ margin: 0, marginBottom: token.margin }} />
112+
<Button
113+
{...footerButtonProps}
114+
size="large"
115+
block
116+
style={{
117+
borderRadius: token.borderRadiusLG,
118+
}}
119+
/>
120+
</Flex>
121+
</Flex>
122+
</Card>
123+
</ConfigProvider>
124+
);
125+
};
126+
127+
export default BAIStartBasicCard;

0 commit comments

Comments
 (0)