Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:deploy menuData helpDocs #4437

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ spec:
url: "https://adminer.{{ .cloudDomain }}"
icon: "https://adminer.{{ .cloudDomain }}/logo.svg"
menuData:
helpDocs: https://www.sealos.io/docs/cloud/apps/adminer/
helpDropDown: false
nameColor: text-black
name: Adminer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ spec:
zh-Hans:
name: 费用中心
menuData:
helpDocs: https://www.sealos.io/docs/cloud/apps/costcenter/
helpDropDown: false
nameColor: text-black
name: Cost Center
Expand Down
1 change: 1 addition & 0 deletions frontend/providers/dbprovider/deploy/Kubefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ ENV minioSecretKey=""
ENV minioPort=""
ENV migrateFileImage=""
ENV minioBucketName=""
ENV BACKUP_ENABLED="false"

CMD ["kubectl apply -f manifests"]
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ spec:
zh-Hans:
name: 数据库
menuData:
helpDocs: https://sealos.run/docs/guides/dbprovider/config-docs/
helpDropDown: false
nameColor: text-black
name: Database
Expand Down
6 changes: 3 additions & 3 deletions frontend/providers/dbprovider/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@
"Migrate": "Migrate",
"Advanced Configuration": "Advanced Configuration",
"Option": "Option",
"Internet Migration": "Internet Migration",
"File Migration": "File Migration",
"Online Import": "Online Import",
"Import Through File": "Import Through File",
"Source Database": "Source Database",
"Database Host": "Database Host",
"DB Name": "DataBase Name",
Expand Down Expand Up @@ -259,4 +259,4 @@
"Failed to turn off automatic backup": "Failed to turn off automatic backup",
"Automatic backup is turned off": "Automatic backup is turned off",
"Are you sure you want to turn off automatic backup": "Are you sure you want to turn off automatic backup?"
}
}
6 changes: 3 additions & 3 deletions frontend/providers/dbprovider/public/locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@
"Migrate": "迁移",
"Advanced Configuration": "高级配置",
"Option": "选填",
"Internet Migration": "公网迁移",
"File Migration": "文件迁移",
"Online Import": "在线导入",
"Import Through File": "文件导入",
"Source Database": "源数据库",
"Database Host": "数据库 Host",
"DB Name": "数据库名字",
Expand Down Expand Up @@ -261,4 +261,4 @@
"Failed to turn off automatic backup": "关闭自动备份失败",
"Automatic backup is turned off": "已关闭自动备份",
"Are you sure you want to turn off automatic backup": "确定关闭自动备份吗"
}
}
4 changes: 3 additions & 1 deletion frontend/providers/dbprovider/src/pages/api/getEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type SystemEnvResponse = {
env_storage_className: string;
migrate_file_image: string;
minio_url: string;
BACKUP_ENABLED: boolean;
};

export default async function handler(req: NextApiRequest, res: NextApiResponse<ApiResp>) {
Expand All @@ -15,7 +16,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
domain: process.env.SEALOS_DOMAIN || 'cloud.sealos.io',
env_storage_className: process.env.STORAGE_CLASSNAME || 'openebs-backup',
migrate_file_image: process.env.MIGRATE_FILE_IMAGE || 'ghcr.io/wallyxjh/test:7.1',
minio_url: process.env.MINIO_URL || ''
minio_url: process.env.MINIO_URL || '',
BACKUP_ENABLED: process.env.BACKUP_ENABLED === 'true'
}
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ const ChartTemplate = ({
</Flex>
</Flex>
) : (
<Flex
justifyContent={'center'}
alignItems={'center'}
flexDirection={'column'}
w="100%"
h="100%"
>
<MyIcon name={'noEvents'} color={'transparent'} width={'36px'} height={'36px'} />
<Box pt={'8px'}>{t('No Data Available')}</Box>
<Flex flexDirection={'column'} h="100%">
<Box fontSize={'12px'} fontWeight={500} color={'#24282C'}>
{t(chartTitle)}
{unit ? `(${unit})` : ''}
</Box>
<Flex justifyContent={'center'} alignItems={'center'} flexDirection={'column'} flex={1}>
<MyIcon name={'noEvents'} color={'transparent'} width={'36px'} height={'36px'} />
<Box pt={'8px'}>{t('No Data Available')}</Box>
</Flex>
</Flex>
)}
</Box>
Expand Down
12 changes: 6 additions & 6 deletions frontend/providers/dbprovider/src/pages/db/detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ const AppDetail = ({
const { listNav } = useMemo(() => {
const PublicNetMigration = ['postgresql', 'apecloud-mysql', 'mongodb'].includes(dbType);
const MigrateSupported = ['postgresql', 'mongodb', 'apecloud-mysql'].includes(dbType);
const BackupSupported = ['postgresql', 'mongodb', 'apecloud-mysql', 'redis'].includes(dbType);
const BackupSupported =
['postgresql', 'mongodb', 'apecloud-mysql', 'redis'].includes(dbType) &&
SystemEnv.BACKUP_ENABLED;

const listNavValue = [
{ label: 'Monitor List', value: TabEnum.monitor },
{ label: 'Replicas List', value: TabEnum.pod },
...(BackupSupported ? [{ label: 'Backup List', value: TabEnum.backup }] : []),
...(PublicNetMigration
? [{ label: 'Internet Migration', value: TabEnum.InternetMigration }]
: []),
...(PublicNetMigration ? [{ label: 'Online Import', value: TabEnum.InternetMigration }] : []),
...(PublicNetMigration && !!SystemEnv.minio_url
? [{ label: 'File Migration', value: TabEnum.DumpImport }]
? [{ label: 'Import Through File', value: TabEnum.DumpImport }]
: [])
];

Expand All @@ -64,7 +64,7 @@ const AppDetail = ({
isBackupSupported: BackupSupported,
listNav: listNavValue
};
}, [SystemEnv.minio_url, dbType]);
}, [SystemEnv, dbType]);

const theme = useTheme();
const { toast } = useToast();
Expand Down
3 changes: 2 additions & 1 deletion frontend/providers/dbprovider/src/store/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const useEnvStore = create<EnvState>()(
domain: '',
env_storage_className: '',
migrate_file_image: '',
minio_url: ''
minio_url: '',
BACKUP_ENABLED: false
},
initSystemEnv: async () => {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import type { NextApiRequest, NextApiResponse } from 'next';

export default async function handler(req: NextApiRequest, res: NextApiResponse<ApiResp>) {
try {
const { namespace } = await getK8s({
kubeconfig: await authSession(req)
});

const defaultKc = K8sApiDefault();

const result = await defaultKc.makeApiClient(k8s.CoreV1Api).readNamespace('kube-system');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ spec:
zh-Hans:
name: 对象存储
menuData:
helpDocs: https://www.sealos.io/docs/cloud/apps/objectstorage/
helpDropDown: false
nameColor: text-black
name: Object Storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ spec:
zh-Hans:
name: 终端
menuData:
helpDocs: https://www.sealos.io/docs/cloud/apps/terminal/
helpDropDown: false
nameColor: text-black
name: Terminal
Expand Down