mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-19 03:46:10 +08:00
fix: Fix the problem of abnormal display of license import (#8506)
This commit is contained in:
parent
2bde755fc4
commit
e44a56e301
2 changed files with 12 additions and 9 deletions
|
@ -49,11 +49,9 @@ import { MsgSuccess } from '@/utils/message';
|
||||||
import { uploadLicense } from '@/api/modules/setting';
|
import { uploadLicense } from '@/api/modules/setting';
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
import { UploadFile, UploadFiles, UploadInstance, UploadProps, UploadRawFile, genFileId } from 'element-plus';
|
import { UploadFile, UploadFiles, UploadInstance, UploadProps, UploadRawFile, genFileId } from 'element-plus';
|
||||||
import { useTheme } from '@/global/use-theme';
|
import { getXpackSettingForTheme } from '@/utils/xpack';
|
||||||
import { getXpackSetting, initFavicon } from '@/utils/xpack';
|
|
||||||
const globalStore = GlobalStore();
|
const globalStore = GlobalStore();
|
||||||
|
|
||||||
const { switchTheme } = useTheme();
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const open = ref(false);
|
const open = ref(false);
|
||||||
const uploadRef = ref<UploadInstance>();
|
const uploadRef = ref<UploadInstance>();
|
||||||
|
@ -115,18 +113,15 @@ const submit = async () => {
|
||||||
await uploadLicense(oldLicense.value, formData)
|
await uploadLicense(oldLicense.value, formData)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
globalStore.isProductPro = true;
|
globalStore.isProductPro = true;
|
||||||
const xpackRes = await getXpackSetting();
|
if (globalStore.isMaster) {
|
||||||
if (xpackRes) {
|
globalStore.isMasterProductPro = true;
|
||||||
globalStore.themeConfig.theme = xpackRes.data.theme;
|
|
||||||
globalStore.themeConfig.themeColor = xpackRes.data.themeColor;
|
|
||||||
}
|
}
|
||||||
|
getXpackSettingForTheme();
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
uploadRef.value!.clearFiles();
|
uploadRef.value!.clearFiles();
|
||||||
uploaderFiles.value = [];
|
uploaderFiles.value = [];
|
||||||
open.value = false;
|
open.value = false;
|
||||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||||
switchTheme();
|
|
||||||
initFavicon();
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|
|
@ -83,6 +83,7 @@ import { countExecutingTask } from '@/api/modules/log';
|
||||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { listNodeOptions } from '@/api/modules/setting';
|
import { listNodeOptions } from '@/api/modules/setting';
|
||||||
|
import { ref, watch } from 'vue';
|
||||||
import bus from '@/global/bus';
|
import bus from '@/global/bus';
|
||||||
import { logOutApi } from '@/api/modules/auth';
|
import { logOutApi } from '@/api/modules/auth';
|
||||||
import router from '@/routers';
|
import router from '@/routers';
|
||||||
|
@ -99,6 +100,12 @@ const props = defineProps({
|
||||||
const isMasterPro = computed(() => {
|
const isMasterPro = computed(() => {
|
||||||
return globalStore.isMasterPro();
|
return globalStore.isMasterPro();
|
||||||
});
|
});
|
||||||
|
watch(
|
||||||
|
() => globalStore.isMasterPro(),
|
||||||
|
() => {
|
||||||
|
loadNodes();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const emit = defineEmits(['openTask']);
|
const emit = defineEmits(['openTask']);
|
||||||
bus.on('refreshTask', () => {
|
bus.on('refreshTask', () => {
|
||||||
|
@ -131,6 +138,7 @@ const changeFilter = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadNodes = async () => {
|
const loadNodes = async () => {
|
||||||
|
nodes.value = [];
|
||||||
if (!isMasterPro.value) {
|
if (!isMasterPro.value) {
|
||||||
globalStore.currentNode = 'local';
|
globalStore.currentNode = 'local';
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue