refactor: license ui

This commit is contained in:
wxg0103 2025-06-19 17:49:47 +08:00
parent 5237f8b5fc
commit fd73ede7c8
4 changed files with 26 additions and 13 deletions

View File

@ -16,20 +16,18 @@
</div>
<div class="flex">
<span class="label">{{ $t('layout.about.expiredTime') }}</span>
<!-- <span-->
<!-- >{{ licenseInfo?.expired || '-' }}-->
<span
>{{ licenseInfo?.expired || '-' }}
<!-- <span class="color-danger"-->
<!-- v-if="licenseInfo?.expired && fromNowDate(licenseInfo?.expired)"-->
<!-- >{{ fromNowDate(licenseInfo?.expired) }}</span-->
<!-- ></span-->
<!-- >-->
<!-- >{{ fromNowDate(licenseInfo?.expired) }}</span>-->
</span
>
</div>
<div class="flex">
<span class="label">{{ $t('layout.about.edition.label') }}</span>
<span>{{
user.showXpack()
? $t('layout.about.edition.professional')
: $t('layout.about.edition.community')
editionText
}}</span>
</div>
<div class="flex">
@ -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)
})
}

View File

@ -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',

View File

@ -13,7 +13,8 @@ export default {
edition: {
label: '版本',
community: '社区版',
professional: '专业版'
professional: '专业版',
enterprise: '企业版',
},
version: '版本号',
serialNo: '序列号',

View File

@ -14,7 +14,8 @@ export default {
edition: {
label: '版本',
community: '社群版',
professional: '專業版'
professional: '專業版',
enterprise: '企業版'
},
version: '版本號',
serialNo: '序列號',