From fd73ede7c8ef0e98a58b49b2de78f3127e1fe82c Mon Sep 17 00:00:00 2001
From: wxg0103 <727495428@qq.com>
Date: Thu, 19 Jun 2025 17:49:47 +0800
Subject: [PATCH] refactor: license ui
---
.../layout-header/avatar/AboutDialog.vue | 28 +++++++++++++------
ui/src/locales/lang/en-US/layout.ts | 5 ++--
ui/src/locales/lang/zh-CN/layout.ts | 3 +-
ui/src/locales/lang/zh-Hant/layout.ts | 3 +-
4 files changed, 26 insertions(+), 13 deletions(-)
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: '序列號',