diff --git a/ui/src/layout/layout-header/avatar/AboutDialog.vue b/ui/src/layout/layout-header/avatar/AboutDialog.vue index 482d633e2..4a365681d 100644 --- a/ui/src/layout/layout-header/avatar/AboutDialog.vue +++ b/ui/src/layout/layout-header/avatar/AboutDialog.vue @@ -16,20 +16,18 @@
{{ $t('layout.about.expiredTime') }} - - + {{ licenseInfo?.expired || '-' }} - - - + +
{{ $t('layout.about.edition.label') }} {{ - user.showXpack() - ? $t('layout.about.edition.professional') - : $t('layout.about.edition.community') + editionText }}
@@ -71,7 +69,7 @@ import licenseApi from '@/api/system/license' //import {fromNowDate} from '@/utils/time' import {Role} from '@/utils/permission/type' import useStore from '@/stores' - +import { t } from '@/locales' const {user, theme} = useStore() const isDefaultTheme = computed(() => { return theme.isDefaultTheme() @@ -98,6 +96,7 @@ const open = () => { aboutDialogVisible.value = true } + const onChange = (file: any) => { const fd = new FormData() fd.append('license_file', file.raw) @@ -107,9 +106,20 @@ const onChange = (file: any) => { }) } +const editionText = computed(() => { + if (!user) return '-' + if (user.isPE()) { + return t('layout.about.edition.professional') + } else if (user.isEE()) { + return t('layout.about.edition.enterprise') + } else { + return t('layout.about.edition.community') + } +}) function getLicenseInfo() { licenseApi.getLicense(loading).then((res: any) => { licenseInfo.value = res.data?.license + console.log(licenseInfo.value) }) } diff --git a/ui/src/locales/lang/en-US/layout.ts b/ui/src/locales/lang/en-US/layout.ts index 8ceecd753..64e639fb8 100644 --- a/ui/src/locales/lang/en-US/layout.ts +++ b/ui/src/locales/lang/en-US/layout.ts @@ -13,14 +13,15 @@ export default { edition: { label: 'Edition', community: 'Community Edition', - professional: 'Professional Edition' + professional: 'Professional Edition', + enterprise: 'Enterprise Edition', }, version: 'Version', serialNo: 'Serial No.', remark: 'Remarks', update: 'Update', authorize: 'Authorized', - + }, time: { daysLater: 'days later', diff --git a/ui/src/locales/lang/zh-CN/layout.ts b/ui/src/locales/lang/zh-CN/layout.ts index 915048961..d3c5e5ad4 100644 --- a/ui/src/locales/lang/zh-CN/layout.ts +++ b/ui/src/locales/lang/zh-CN/layout.ts @@ -13,7 +13,8 @@ export default { edition: { label: '版本', community: '社区版', - professional: '专业版' + professional: '专业版', + enterprise: '企业版', }, version: '版本号', serialNo: '序列号', diff --git a/ui/src/locales/lang/zh-Hant/layout.ts b/ui/src/locales/lang/zh-Hant/layout.ts index b70da8eba..35d7151f7 100644 --- a/ui/src/locales/lang/zh-Hant/layout.ts +++ b/ui/src/locales/lang/zh-Hant/layout.ts @@ -14,7 +14,8 @@ export default { edition: { label: '版本', community: '社群版', - professional: '專業版' + professional: '專業版', + enterprise: '企業版' }, version: '版本號', serialNo: '序列號',