feat: 支持离线版许可证 (#6651)

This commit is contained in:
ssongliu 2024-10-08 21:56:55 +08:00 committed by GitHub
parent 31cdc28143
commit 0c216ba87a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -169,6 +169,7 @@ export namespace Setting {
assigneeName: string;
productPro: string;
trial: boolean;
offline: boolean;
status: string;
message: string;
}

View File

@ -18,7 +18,14 @@
>
{{ $t('commons.button.sync') }}
</el-button>
<el-button type="primary" class="ml-3" plain @click="onUnBind()" size="small">
<el-button
v-if="!license.offline"
type="primary"
class="ml-3"
plain
@click="onUnBind()"
size="small"
>
{{ $t('license.unbind') }}
</el-button>
</el-descriptions-item>
@ -124,6 +131,7 @@ const hasLicense = ref();
const license = reactive({
licenseName: '',
trial: true,
offline: true,
expiresAt: '',
assigneeName: '',
productName: '',
@ -207,6 +215,7 @@ const search = async () => {
license.message = res.data.message;
license.assigneeName = res.data.assigneeName;
license.trial = res.data.trial;
license.offline = res.data.offline;
if (res.data.productPro) {
license.productName = 'product-1panel-pro';
license.expiresAt =
@ -221,7 +230,7 @@ const search = async () => {
};
const showSync = () => {
return license.status.indexOf('Lost') !== -1 || license.status === 'Disable';
return (license.status.indexOf('Lost') !== -1 || license.status === 'Disable') && !license.offline;
};
const toUpload = () => {