diff --git a/frontend/src/components/license-import/index.vue b/frontend/src/components/license-import/index.vue index 1c140863c..f8efad712 100644 --- a/frontend/src/components/license-import/index.vue +++ b/frontend/src/components/license-import/index.vue @@ -63,15 +63,18 @@ import { uploadLicense } from '@/api/modules/setting'; import DockerProxy from '@/components/docker-proxy/index.vue'; import { GlobalStore } from '@/store'; import { UploadFile, UploadFiles, UploadInstance, UploadProps, UploadRawFile, genFileId } from 'element-plus'; -import { getXpackSettingForTheme } from '@/utils/xpack'; +import { getXpackSettingForTheme, loadMasterProductProFromDB, loadProductProFromDB } from '@/utils/xpack'; const globalStore = GlobalStore(); +const em = defineEmits(['search']); + const loading = ref(false); const open = ref(false); const uploadRef = ref(); const uploaderFiles = ref([]); const isImport = ref(); const isForce = ref(); +const withoutReload = ref(); const withDockerRestart = ref(); @@ -79,6 +82,7 @@ const oldLicense = ref(); interface DialogProps { oldLicense: string; isImport: boolean; + withoutReload: boolean; } const acceptParams = (params: DialogProps) => { @@ -86,6 +90,8 @@ const acceptParams = (params: DialogProps) => { uploaderFiles.value = []; uploadRef.value?.clearFiles(); isImport.value = params?.isImport; + withoutReload.value = params.withoutReload; + open.value = true; }; @@ -131,17 +137,19 @@ const submit = async () => { loading.value = true; await uploadLicense(oldLicense.value, formData) .then(async () => { - globalStore.isProductPro = true; - if (globalStore.isMaster) { - globalStore.isMasterProductPro = true; - } - getXpackSettingForTheme(); loading.value = false; uploadRef.value!.clearFiles(); uploaderFiles.value = []; open.value = false; MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); - window.location.reload(); + if (!withoutReload.value) { + loadMasterProductProFromDB(); + loadProductProFromDB(); + getXpackSettingForTheme(); + window.location.reload(); + } else { + em('search'); + } }) .catch(() => { loading.value = false; diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index f00c1597c..66c4caabd 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -2065,6 +2065,7 @@ const message = { pro: 'Pro', trial: 'Trial', add: 'Add Community Edition', + licenseBindHelper: 'Free node quotas can only be used when the license is bound to a node', licenseAlert: 'Community Edition nodes can only be added when the license is properly bound to a node. Only nodes properly bound to the license support switching.', licenseUnbindHelper: 'Community Edition nodes detected for this license. Please unbind and try again!', diff --git a/frontend/src/lang/modules/es-es.ts b/frontend/src/lang/modules/es-es.ts index 23d2ba61a..5f5a3c956 100644 --- a/frontend/src/lang/modules/es-es.ts +++ b/frontend/src/lang/modules/es-es.ts @@ -2074,6 +2074,8 @@ const message = { pro: 'Pro', trial: 'Prueba', add: 'Agregar versión Community', + licenseBindHelper: + 'Las cuotas de nodo gratuitas solo se pueden utilizar cuando la licencia está vinculada a un nodo', licenseAlert: 'Solo se pueden agregar nodos Community cuando la licencia está correctamente vinculada. Solo los nodos vinculados admiten cambios.', licenseUnbindHelper: 'Nodos Community detectados en esta licencia. Desvincule e intente nuevamente.', diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts index bf1a47a87..9f190ca07 100644 --- a/frontend/src/lang/modules/ja.ts +++ b/frontend/src/lang/modules/ja.ts @@ -1979,6 +1979,7 @@ const message = { pro: '専門', trial: '体験', add: 'コミュニティ版を追加', + licenseBindHelper: 'ライセンスがノードにバインドされている場合にのみ、無料ノードクォータを使用できます', licenseAlert: 'ライセンスがノードに正常にバインドされている場合のみ、コミュニティ版ノードを追加できます。ライセンスに正常にバインドされているノードのみ切り替えがサポートされます。', licenseUnbindHelper: diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts index 04bf22f67..d6d2a35bf 100644 --- a/frontend/src/lang/modules/ko.ts +++ b/frontend/src/lang/modules/ko.ts @@ -1948,6 +1948,7 @@ const message = { pro: 'Pro', trial: '체험판', add: '커뮤니티 에디션 추가', + licenseBindHelper: '라이선스가 노드에 바인딩된 경우에만 무료 노드 할당량을 사용할 수 있습니다', licenseAlert: '라이선스가 노드에 정상적으로 바인딩된 경우에만 커뮤니티 에디션 노드를 추가할 수 있습니다. 라이선스에 정상적으로 바인딩된 노드만 전환이 지원됩니다.', licenseUnbindHelper: '이 라이선스에 커뮤니티 에디션 노드가 존재합니다. 바인딩 해제 후 다시 시도하세요!', diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts index cf679bc4d..cef38d07b 100644 --- a/frontend/src/lang/modules/ms.ts +++ b/frontend/src/lang/modules/ms.ts @@ -2042,6 +2042,7 @@ const message = { pro: 'Pro', trial: 'Percubaan', add: 'Tambah Edisi Komuniti', + licenseBindHelper: 'Kuota nod percuma hanya boleh digunakan apabila lesen terikat pada nod', licenseAlert: 'Nod Edisi Komuniti hanya boleh ditambah apabila lesen terikat dengan betul pada nod. Hanya nod yang terikat dengan betul pada lesen menyokong penukaran.', licenseUnbindHelper: 'Nod Edisi Komuniti dikesan untuk lesen ini. Sila lepaskan ikatan dan cuba lagi!', diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts index 3b21caa12..baae16642 100644 --- a/frontend/src/lang/modules/pt-br.ts +++ b/frontend/src/lang/modules/pt-br.ts @@ -2034,6 +2034,7 @@ const message = { pro: 'Pro', trial: 'Teste', add: 'Adicionar Edição Comunitária', + licenseBindHelper: 'As cotas de nó gratuitas só podem ser usadas quando a licença está vinculada a um nó', licenseAlert: 'Nós da Edição Comunitária só podem ser adicionados quando a licença está devidamente vinculada a um nó. Apenas nós devidamente vinculados à licença suportam troca.', licenseUnbindHelper: diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts index 7c9057170..94a180c6a 100644 --- a/frontend/src/lang/modules/ru.ts +++ b/frontend/src/lang/modules/ru.ts @@ -2033,6 +2033,7 @@ const message = { pro: 'Pro', trial: 'Пробная версия', add: 'Добавить Community Edition', + licenseBindHelper: 'Бесплатные квоты узлов можно использовать только тогда, когда лицензия привязана к узлу', licenseAlert: 'Узлы Community Edition можно добавлять только при правильной привязке лицензии к узлу. Переключение поддерживается только для узлов, правильно привязанных к лицензии.', licenseUnbindHelper: diff --git a/frontend/src/lang/modules/tr.ts b/frontend/src/lang/modules/tr.ts index 5fc76aff0..025c89d74 100644 --- a/frontend/src/lang/modules/tr.ts +++ b/frontend/src/lang/modules/tr.ts @@ -2087,6 +2087,7 @@ const message = { pro: 'Pro', trial: 'Deneme', add: 'Topluluk Sürümünü Ekle', + licenseBindHelper: 'Ücretsiz düğüm kotası yalnızca lisans bir düğüme bağlı olduğunda kullanılabilir', licenseAlert: 'Topluluk Sürümü düğümleri yalnızca lisans bir düğüme düzgün şekilde bağlandığında eklenebilir. Yalnızca düzgün şekilde bağlanmış düğümler geçiş yapmayı destekler.', licenseUnbindHelper: diff --git a/frontend/src/lang/modules/zh-Hant.ts b/frontend/src/lang/modules/zh-Hant.ts index 227608d3c..fb9594973 100644 --- a/frontend/src/lang/modules/zh-Hant.ts +++ b/frontend/src/lang/modules/zh-Hant.ts @@ -1927,6 +1927,7 @@ const message = { pro: '專業版:', trial: '試用', add: '新增社區版', + licenseBindHelper: '僅當授權已綁定節點時,才能使用其免費節點額度', licenseAlert: '僅當許可證正常綁定到節點時,該許可證才能新增社區版節點,只有正常綁定到許可證的節點支援切換。', licenseUnbindHelper: '檢測到該許可證存在社區版節點,請解除綁定後重試!', subscription: '訂閱', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index e8e429a4c..58f31fc02 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1920,6 +1920,7 @@ const message = { pro: '专业版', trial: '试用', add: '添加社区版', + licenseBindHelper: '仅当许可证已绑定节点时,才能使用其免费节点额度', licenseAlert: '仅当许可证正常绑定到节点时,该许可证才能添加社区版节点,只有正常绑定到许可证的节点支持切换。', licenseUnbindHelper: '检测到该许可证存在社区版节点,请解绑后重试!', subscription: '订阅',