mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-18 19:36:21 +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 { GlobalStore } from '@/store';
|
||||
import { UploadFile, UploadFiles, UploadInstance, UploadProps, UploadRawFile, genFileId } from 'element-plus';
|
||||
import { useTheme } from '@/global/use-theme';
|
||||
import { getXpackSetting, initFavicon } from '@/utils/xpack';
|
||||
import { getXpackSettingForTheme } from '@/utils/xpack';
|
||||
const globalStore = GlobalStore();
|
||||
|
||||
const { switchTheme } = useTheme();
|
||||
const loading = ref(false);
|
||||
const open = ref(false);
|
||||
const uploadRef = ref<UploadInstance>();
|
||||
|
@ -115,18 +113,15 @@ const submit = async () => {
|
|||
await uploadLicense(oldLicense.value, formData)
|
||||
.then(async () => {
|
||||
globalStore.isProductPro = true;
|
||||
const xpackRes = await getXpackSetting();
|
||||
if (xpackRes) {
|
||||
globalStore.themeConfig.theme = xpackRes.data.theme;
|
||||
globalStore.themeConfig.themeColor = xpackRes.data.themeColor;
|
||||
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'));
|
||||
switchTheme();
|
||||
initFavicon();
|
||||
window.location.reload();
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -83,6 +83,7 @@ import { countExecutingTask } from '@/api/modules/log';
|
|||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
import i18n from '@/lang';
|
||||
import { listNodeOptions } from '@/api/modules/setting';
|
||||
import { ref, watch } from 'vue';
|
||||
import bus from '@/global/bus';
|
||||
import { logOutApi } from '@/api/modules/auth';
|
||||
import router from '@/routers';
|
||||
|
@ -99,6 +100,12 @@ const props = defineProps({
|
|||
const isMasterPro = computed(() => {
|
||||
return globalStore.isMasterPro();
|
||||
});
|
||||
watch(
|
||||
() => globalStore.isMasterPro(),
|
||||
() => {
|
||||
loadNodes();
|
||||
},
|
||||
);
|
||||
|
||||
const emit = defineEmits(['openTask']);
|
||||
bus.on('refreshTask', () => {
|
||||
|
@ -131,6 +138,7 @@ const changeFilter = () => {
|
|||
};
|
||||
|
||||
const loadNodes = async () => {
|
||||
nodes.value = [];
|
||||
if (!isMasterPro.value) {
|
||||
globalStore.currentNode = 'local';
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue