diff --git a/frontend/src/components/system-upgrade/index.vue b/frontend/src/components/system-upgrade/index.vue index 70e84b725..21df65844 100644 --- a/frontend/src/components/system-upgrade/index.vue +++ b/frontend/src/components/system-upgrade/index.vue @@ -14,6 +14,10 @@ + + {{ isProductPro ? $t('license.pro') : $t('license.community') }} + {{ ': ' + version }} + ({{ $t('setting.hasNewVersion') }}) @@ -77,6 +81,7 @@ import { ElMessageBox } from 'element-plus'; const globalStore = GlobalStore(); const version = ref(''); +const isProductPro = ref(); const loading = ref(false); const drawerVisible = ref(false); const upgradeInfo = ref(); @@ -98,6 +103,10 @@ const handleClose = () => { drawerVisible.value = false; }; +const toHalo = () => { + window.open('https://halo.test.lxware.cn/', '_blank', 'noopener,noreferrer'); +}; + const toDoc = () => { window.open('https://1panel.cn/docs/', '_blank', 'noopener,noreferrer'); }; @@ -149,6 +158,7 @@ const onUpgrade = async () => { }; onMounted(() => { + isProductPro.value = globalStore.isProductPro; search(); }); diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index c5fa77f23..6a34803e8 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1462,8 +1462,9 @@ const message = { expiresAt: 'Expiration Time', productName: 'Product Name', productStatus: 'Product Status', - lost01: 'Lost * 1', - lost02: 'Lost * 2', + Lost01: 'Lost * 1', + Lost02: 'Lost * 2', + Lost03: 'Lost', Enable: 'Enabled', Disable: 'Disabled', lostHelper: diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 952d38250..55c5bca5f 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1362,8 +1362,9 @@ const message = { authorizedUser: '被授權方', productName: '產品名稱', productStatus: '產品狀態', - lost01: '失聯 * 1', - lost02: '失聯 * 2', + Lost01: '失聯 * 1', + Lost02: '失聯 * 2', + Lost03: '失聯', Enable: '已啟用', Disable: '未啟用', lostHelper: 'License 需要定時同步是否可用,請確保正常外網訪問,失聯三次後將解除 License 綁定', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index ec8acd6c5..b56bf3047 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1357,20 +1357,23 @@ const message = { license: { community: '社区版', pro: '专业版', - trial: '实验版', + trial: '试用版', office: '正式版', + trialInfo: '版本', authorizationId: '订阅授权 ID', authorizedUser: '被授权方', expiresAt: '到期时间', productName: '产品名称', productStatus: '产品状态', - lost01: '失联 * 1', - lost02: '失联 * 2', + Lost01: '失联 * 1', + Lost02: '失联 * 2', + Lost03: '已失联', Enable: '已激活', Disable: '未激活', lostHelper: 'License 需要定时同步是否可用,请保证正常外网访问,失联三次后将解除 License 绑定', quickUpdate: '快速更新', import: '导入', + power: '授权', importLicense: '导入 License', importHelper: '点击或将 License 文件拖拽到此处', technicalAdvice: '技术咨询', @@ -1378,8 +1381,6 @@ const message = { indefinitePeriod: '无限期', levelUpPro: '升级专业版', knowMorePro: '了解更多专业版信息', - noLicense: '该部分为 Xpack 功能,请先在 面板设置-许可证 界面导入 License', - goImport: '去导入', closeAlert: '当前页面可在面板设置中关闭显示', }, clean: { diff --git a/frontend/src/views/home/index.vue b/frontend/src/views/home/index.vue index d2a54985e..68209ba6d 100644 --- a/frontend/src/views/home/index.vue +++ b/frontend/src/views/home/index.vue @@ -10,14 +10,8 @@ > {{ - baseInfo.platformVersion === '' + baseInfo.platformVersion ? baseInfo.platform : baseInfo.platform + '-' + baseInfo.platformVersion }} @@ -257,7 +234,7 @@ - + @@ -273,9 +250,9 @@ import { dateFormatForSecond, computeSize } from '@/utils/util'; import { useRouter } from 'vue-router'; import { loadBaseInfo, loadCurrentInfo } from '@/api/modules/dashboard'; import { getIOOptions, getNetworkOptions } from '@/api/modules/monitor'; -import { getLicense, getSettingInfo, loadUpgradeInfo } from '@/api/modules/setting'; +import { getSettingInfo, loadUpgradeInfo } from '@/api/modules/setting'; import { GlobalStore } from '@/store'; -import Upload from '@/views/setting/license/upload/index.vue'; +import License from '@/views/home/license/index.vue'; const router = useRouter(); const globalStore = GlobalStore(); @@ -300,21 +277,8 @@ const timeNetDatas = ref>([]); const ioOptions = ref(); const netOptions = ref(); -const dialogFormVisible = ref(false); - -const uploadRef = ref(); -const loading = ref(); -const show = ref(null); - -const license = reactive({ - licenseName: '', - trial: true, - expiresAt: '', - assigneeName: '', - productName: '', - - status: '', -}); +const licenseRef = ref(); +const isProductPro = ref(); const searchInfo = reactive({ ioOption: 'all', @@ -596,30 +560,12 @@ const onBlur = () => { isActive.value = false; }; -const search = async () => { - loading.value = true; - await getLicense() - .then((res) => { - loading.value = false; - license.status = res.data.status; - show.value = license.status !== 'Enable'; - }) - .catch(() => { - show.value = true; - loading.value = false; - }); -}; - -const toHalo = () => { - window.open('https://halo.test.lxware.cn/', '_blank', 'noopener,noreferrer'); -}; - const toUpload = () => { - uploadRef.value.acceptParams(); + licenseRef.value.acceptParams(); }; onMounted(() => { - search(); + isProductPro.value = globalStore.isProductPro; window.addEventListener('focus', onFocus); window.addEventListener('blur', onBlur); loadSafeStatus(); diff --git a/frontend/src/views/home/license/index.vue b/frontend/src/views/home/license/index.vue new file mode 100644 index 000000000..6afdab74c --- /dev/null +++ b/frontend/src/views/home/license/index.vue @@ -0,0 +1,113 @@ + + + diff --git a/frontend/src/views/setting/license/index.vue b/frontend/src/views/setting/license/index.vue index 135d4360b..366d0cca7 100644 --- a/frontend/src/views/setting/license/index.vue +++ b/frontend/src/views/setting/license/index.vue @@ -8,23 +8,33 @@ {{ license.licenseName || '-' }} - + {{ $t('commons.button.sync') }} {{ license.assigneeName || '-' }} - - {{ license.expiresAt || '-' }} - {{ license.productName || '-' }} + + {{ license.trial ? $t('license.trial') : $t('license.office') }} + + + {{ license.expiresAt || '-' }} +
@@ -40,7 +50,7 @@