From 76a995d7e3cef02c50081809b8f55b870efba40e Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Wed, 17 Jul 2024 15:24:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=B3=E4=BA=8E=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/api/license.ts | 24 +++ ui/src/enums/common.ts | 5 + .../components/top-bar/avatar/AboutDialog.vue | 99 +++++++--- ui/src/locales/lang/zh_CN/layout.ts | 2 +- ui/src/styles/app.scss | 4 + ui/src/views/theme/index.vue | 184 +++++++++--------- 6 files changed, 197 insertions(+), 121 deletions(-) create mode 100644 ui/src/api/license.ts diff --git a/ui/src/api/license.ts b/ui/src/api/license.ts new file mode 100644 index 000000000..16e5acdf6 --- /dev/null +++ b/ui/src/api/license.ts @@ -0,0 +1,24 @@ +import { Result } from '@/request/Result' +import { get, post, del, put } from '@/request/index' +import { type Ref } from 'vue' + +const prefix = '/license' + +/** + * 获得license信息 + */ +const getLicense: (loading?: Ref) => Promise> = (loading) => { + return get(`${prefix}/profile`, undefined, loading) +} +/** + * 更新license信息 + * @param 参数 license_file:file + */ +const putLicense: (data: any, loading?: Ref) => Promise> = (data, loading) => { + return put(`${prefix}/profile`, data, undefined, loading) +} + +export default { + getLicense, + putLicense +} diff --git a/ui/src/enums/common.ts b/ui/src/enums/common.ts index 3afd8fc26..e63bf033f 100644 --- a/ui/src/enums/common.ts +++ b/ui/src/enums/common.ts @@ -14,3 +14,8 @@ export enum ValidCount { Dataset = 50, User = 2 } + +export enum EditionType { + Standard = '社区版', + Enterprise = '专业版' +} diff --git a/ui/src/layout/components/top-bar/avatar/AboutDialog.vue b/ui/src/layout/components/top-bar/avatar/AboutDialog.vue index 35e1f5308..16491b937 100644 --- a/ui/src/layout/components/top-bar/avatar/AboutDialog.vue +++ b/ui/src/layout/components/top-bar/avatar/AboutDialog.vue @@ -9,31 +9,55 @@ -
- -
- - {{ $t('layout.topbar.wiki') }} -
-
- -
- - {{ $t('layout.topbar.github') }} -
-
- -
- - {{ $t('layout.topbar.forum') }} -
-
+
+
+ 授权给{{ licenseInfo?.corporation || '-' }} +
+
+ ISV{{ licenseInfo?.isv || '-' }} +
+
+ 过期时间{{ licenseInfo?.expired || '-' }} +
+
+ 版本{{ + licenseInfo?.edition ? EditionType[licenseInfo.edition as keyof typeof EditionType] : '-' + }} +
+
+ 版本号{{ licenseInfo?.licenseVersion || '-' }} +
+
+ 序列号{{ licenseInfo?.serialNo || '-' }} +
+
+ 备注{{ licenseInfo?.remark || '-' }} +
+ +
+ + 更新 License + + + 获取技术支持 +
-
{{ $t('layout.topbar.avatar.version') }}:{{ user.version }}
+ +