Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions frontend/src/components/license-import/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,35 @@ 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<UploadInstance>();
const uploaderFiles = ref<UploadFiles>([]);
const isImport = ref();
const isForce = ref();
const withoutReload = ref();

const withDockerRestart = ref();

const oldLicense = ref();
interface DialogProps {
oldLicense: string;
isImport: boolean;
withoutReload: boolean;
}

const acceptParams = (params: DialogProps) => {
oldLicense.value = params?.oldLicense || '';
uploaderFiles.value = [];
uploadRef.value?.clearFiles();
isImport.value = params?.isImport;
withoutReload.value = params.withoutReload;

open.value = true;
};

Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/es-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1979,6 +1979,7 @@ const message = {
pro: '専門',
trial: '体験',
add: 'コミュニティ版を追加',
licenseBindHelper: 'ライセンスがノードにバインドされている場合にのみ、無料ノードクォータを使用できます',
licenseAlert:
'ライセンスがノードに正常にバインドされている場合のみ、コミュニティ版ノードを追加できます。ライセンスに正常にバインドされているノードのみ切り替えがサポートされます。',
licenseUnbindHelper:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,7 @@ const message = {
pro: 'Pro',
trial: '체험판',
add: '커뮤니티 에디션 추가',
licenseBindHelper: '라이선스가 노드에 바인딩된 경우에만 무료 노드 할당량을 사용할 수 있습니다',
licenseAlert:
'라이선스가 노드에 정상적으로 바인딩된 경우에만 커뮤니티 에디션 노드를 추가할 수 있습니다. 라이선스에 정상적으로 바인딩된 노드만 전환이 지원됩니다.',
licenseUnbindHelper: '이 라이선스에 커뮤니티 에디션 노드가 존재합니다. 바인딩 해제 후 다시 시도하세요!',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,7 @@ const message = {
pro: 'Pro',
trial: 'Пробная версия',
add: 'Добавить Community Edition',
licenseBindHelper: 'Бесплатные квоты узлов можно использовать только тогда, когда лицензия привязана к узлу',
licenseAlert:
'Узлы Community Edition можно добавлять только при правильной привязке лицензии к узлу. Переключение поддерживается только для узлов, правильно привязанных к лицензии.',
licenseUnbindHelper:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,7 @@ const message = {
pro: '專業版:',
trial: '試用',
add: '新增社區版',
licenseBindHelper: '僅當授權已綁定節點時,才能使用其免費節點額度',
licenseAlert: '僅當許可證正常綁定到節點時,該許可證才能新增社區版節點,只有正常綁定到許可證的節點支援切換。',
licenseUnbindHelper: '檢測到該許可證存在社區版節點,請解除綁定後重試!',
subscription: '訂閱',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,7 @@ const message = {
pro: '专业版',
trial: '试用',
add: '添加社区版',
licenseBindHelper: '仅当许可证已绑定节点时,才能使用其免费节点额度',
licenseAlert: '仅当许可证正常绑定到节点时,该许可证才能添加社区版节点,只有正常绑定到许可证的节点支持切换。',
licenseUnbindHelper: '检测到该许可证存在社区版节点,请解绑后重试!',
subscription: '订阅',
Expand Down
Loading