diff --git a/frontend/providers/applaunchpad/public/locales/en/common.json b/frontend/providers/applaunchpad/public/locales/en/common.json index 0b7147775e8..0062715f00c 100644 --- a/frontend/providers/applaunchpad/public/locales/en/common.json +++ b/frontend/providers/applaunchpad/public/locales/en/common.json @@ -276,5 +276,6 @@ "add_configmap": "Add Configmaps", "storage_path_placeholder": "For Example: /data" }, - "guide_deploy_button": "Complete creation" -} \ No newline at end of file + "guide_deploy_button": "Complete creation", + "shared": "Shared" +} diff --git a/frontend/providers/applaunchpad/public/locales/zh/common.json b/frontend/providers/applaunchpad/public/locales/zh/common.json index da5b88f3929..95df44ea1ac 100644 --- a/frontend/providers/applaunchpad/public/locales/zh/common.json +++ b/frontend/providers/applaunchpad/public/locales/zh/common.json @@ -277,5 +277,6 @@ "add_configmap": "新增配置文件", "storage_path_placeholder": "如:/data" }, - "guide_deploy_button": "完成创建" -} \ No newline at end of file + "guide_deploy_button": "完成创建", + "shared": "共享" +} diff --git a/frontend/providers/applaunchpad/src/constants/editApp.ts b/frontend/providers/applaunchpad/src/constants/editApp.ts index 9b19828fbfc..6cf0e2a1915 100644 --- a/frontend/providers/applaunchpad/src/constants/editApp.ts +++ b/frontend/providers/applaunchpad/src/constants/editApp.ts @@ -23,6 +23,7 @@ export const editModeMap = (isEdit: boolean) => { }; export const defaultEditVal: AppEditType = { + kind: 'deployment', appName: 'hello-world', imageName: 'nginx', runCMD: '', @@ -58,6 +59,8 @@ export const defaultEditVal: AppEditType = { serverAddress: 'docker.io' }, storeList: [], + volumes: [], + volumeMounts: [], gpu: { manufacturers: 'nvidia', type: '', diff --git a/frontend/providers/applaunchpad/src/mock/apps.ts b/frontend/providers/applaunchpad/src/mock/apps.ts index f6809b3a744..af76efe453a 100644 --- a/frontend/providers/applaunchpad/src/mock/apps.ts +++ b/frontend/providers/applaunchpad/src/mock/apps.ts @@ -238,6 +238,9 @@ export const MOCK_PODS: PodDetailType[] = [ ]; export const MOCK_APP_DETAIL: AppDetailType = { + kind: 'deployment', + volumes: [], + volumeMounts: [], crYamlList: [], id: '4bd50c41-149e-4da5-89d5-0308b9dd75c6', createTime: '2022/1/22', diff --git a/frontend/providers/applaunchpad/src/pages/app/detail/components/AppBaseInfo.tsx b/frontend/providers/applaunchpad/src/pages/app/detail/components/AppBaseInfo.tsx index 5c6ec64d031..4448388b6ac 100644 --- a/frontend/providers/applaunchpad/src/pages/app/detail/components/AppBaseInfo.tsx +++ b/frontend/providers/applaunchpad/src/pages/app/detail/components/AppBaseInfo.tsx @@ -100,6 +100,30 @@ const AppBaseInfo = ({ app = MOCK_APP_DETAIL }: { app: AppDetailType }) => { [app] ); + const persistentVolumes = useMemo(() => { + return app.volumes + .filter((item) => 'persistentVolumeClaim' in item) + .reduce( + ( + acc: { + path: string; + name: string; + }[], + volume + ) => { + const mount = app.volumeMounts.find((m) => m.name === volume.name); + if (mount) { + acc.push({ + path: mount.mountPath, + name: volume.name + }); + } + return acc; + }, + [] + ); + }, [app.volumes, app.volumeMounts]); + return ( {app?.source?.hasSource && ( @@ -383,7 +407,7 @@ const AppBaseInfo = ({ app = MOCK_APP_DETAIL }: { app: AppDetailType }) => { borderRadius={'md'} overflow={'hidden'} bg={'#FFF'} - {...(app.storeList.length > 0 + {...(app.storeList.length > 0 || persistentVolumes.length > 0 ? { mb: 4, border: theme.borders.base @@ -415,6 +439,27 @@ const AppBaseInfo = ({ app = MOCK_APP_DETAIL }: { app: AppDetailType }) => { ))} + {persistentVolumes.map((item) => ( + + + + + {item.path} + + + + {t('shared')} + + + ))} diff --git a/frontend/providers/applaunchpad/src/pages/app/edit/components/ConfigmapModal.tsx b/frontend/providers/applaunchpad/src/pages/app/edit/components/ConfigmapModal.tsx index c5ede83d5bf..62a68556299 100644 --- a/frontend/providers/applaunchpad/src/pages/app/edit/components/ConfigmapModal.tsx +++ b/frontend/providers/applaunchpad/src/pages/app/edit/components/ConfigmapModal.tsx @@ -94,6 +94,7 @@ const ConfigmapModal = ({ {t('file value')}{' '}