From 546bb2fe126a93ee2c90eabfd8dff65f673a7184 Mon Sep 17 00:00:00 2001 From: agatha197 Date: Thu, 29 Aug 2024 15:39:56 +0900 Subject: [PATCH] feat: publishing --- react/src/App.tsx | 2 + react/src/components/BAIStartBasicCard.tsx | 127 +++++++++++++++++ react/src/components/BAIStartSimpleCard.tsx | 111 +++++++++++++++ react/src/pages/StartPage.tsx | 142 ++++++++++++++++++++ resources/icons/URLStart.svg | 4 + resources/icons/batchSession.svg | 4 + resources/icons/exampleStart.svg | 6 + resources/icons/interactiveSession.svg | 4 + resources/icons/modelService.svg | 3 + resources/icons/session.svg | 3 + resources/theme.json | 9 +- src/components/backend-ai-webui.ts | 4 +- 12 files changed, 413 insertions(+), 6 deletions(-) create mode 100644 react/src/components/BAIStartBasicCard.tsx create mode 100644 react/src/components/BAIStartSimpleCard.tsx create mode 100644 react/src/pages/StartPage.tsx create mode 100644 resources/icons/URLStart.svg create mode 100644 resources/icons/batchSession.svg create mode 100644 resources/icons/exampleStart.svg create mode 100644 resources/icons/interactiveSession.svg create mode 100644 resources/icons/modelService.svg create mode 100644 resources/icons/session.svg diff --git a/react/src/App.tsx b/react/src/App.tsx index 2eb8e37f05..f5c273b721 100644 --- a/react/src/App.tsx +++ b/react/src/App.tsx @@ -29,6 +29,7 @@ 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( @@ -134,6 +135,7 @@ const router = createBrowserRouter([ closable /> {/* */} + ); }, diff --git a/react/src/components/BAIStartBasicCard.tsx b/react/src/components/BAIStartBasicCard.tsx new file mode 100644 index 0000000000..7bc3c5b932 --- /dev/null +++ b/react/src/components/BAIStartBasicCard.tsx @@ -0,0 +1,127 @@ +import Flex from './Flex'; +import { + Button, + ButtonProps, + Card, + CardProps, + ConfigProvider, + Divider, + theme, + Typography, +} from 'antd'; + +export interface BAIStartBasicCardProps extends CardProps { + icon: React.ReactNode; + title: React.ReactNode; + footerButtonProps: ButtonProps; + description?: string; + secondary?: Boolean; +} + +const BAIStartBasicCard: React.FC = ({ + icon, + title, + footerButtonProps, + description, + secondary, + ...cardProps +}) => { + const { token } = theme.useToken(); + + return ( + + + + + + {icon} + + + {title} + + {description && ( + + {description} + + )} + + + +