mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 08:00:53 +00:00
fix: resolve delayed theme update after license import (#12911)
This commit is contained in:
@@ -4,7 +4,7 @@ base:
|
||||
is_demo: false
|
||||
is_offline: false
|
||||
is_fxplay: false
|
||||
is_enterprise: true
|
||||
is_enterprise: false
|
||||
|
||||
log:
|
||||
level: debug
|
||||
|
||||
@@ -4,7 +4,7 @@ base:
|
||||
is_demo: false
|
||||
is_offline: false
|
||||
is_fxplay: false
|
||||
is_enterprise: true
|
||||
is_enterprise: false
|
||||
port: 9999
|
||||
username: admin
|
||||
password: admin123
|
||||
|
||||
@@ -130,7 +130,7 @@ const submit = async () => {
|
||||
loading.value = true;
|
||||
await uploadEnterpriseLicense(formData)
|
||||
.then(async () => {
|
||||
handleAfterSubmit();
|
||||
await handleAfterSubmit();
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
@@ -150,7 +150,7 @@ const submit = async () => {
|
||||
loading.value = true;
|
||||
await uploadLicense(oldLicense.value, formData)
|
||||
.then(async () => {
|
||||
handleAfterSubmit();
|
||||
await handleAfterSubmit();
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
@@ -159,7 +159,7 @@ const submit = async () => {
|
||||
});
|
||||
};
|
||||
|
||||
const handleAfterSubmit = () => {
|
||||
const handleAfterSubmit = async () => {
|
||||
loading.value = false;
|
||||
uploadRef.value!.clearFiles();
|
||||
uploaderFiles.value = [];
|
||||
@@ -172,9 +172,9 @@ const handleAfterSubmit = () => {
|
||||
isEnterpriseLicensed.value = true;
|
||||
}
|
||||
if (!withoutReload.value) {
|
||||
loadMasterProductProFromDB();
|
||||
loadProductProFromDB();
|
||||
getXpackSettingForTheme();
|
||||
await loadMasterProductProFromDB();
|
||||
await loadProductProFromDB();
|
||||
await getXpackSettingForTheme();
|
||||
window.location.reload();
|
||||
} else {
|
||||
em('search');
|
||||
|
||||
@@ -7,7 +7,8 @@ export const useTheme = () => {
|
||||
const { isXpackOrEE, themeConfig } = useGlobalStore();
|
||||
|
||||
const switchTheme = () => {
|
||||
let itemTheme = themeConfig.value.theme;
|
||||
const rawTheme = themeConfig.value.theme;
|
||||
let itemTheme = rawTheme;
|
||||
if (itemTheme === 'auto') {
|
||||
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
itemTheme = prefersDark ? 'dark' : 'light';
|
||||
|
||||
@@ -193,7 +193,7 @@ function buildVisibleMenu(menu: RouteRecordRaw, showSet: Set<string>): RouteReco
|
||||
|
||||
const visibleChildren = children
|
||||
.map((item) => {
|
||||
if ((item.name === 'Upage' || item.name === 'XApp') && (isIntl.value || isEE.value)) {
|
||||
if ((item.name === 'Upage' || item.name === 'XApp') && (isIntl.value || (isEE.value && !isAdmin.value))) {
|
||||
return null;
|
||||
}
|
||||
return buildVisibleMenu(item, showSet);
|
||||
|
||||
@@ -56,7 +56,7 @@ import { MsgSuccess } from '@/utils/message';
|
||||
import { useGlobalStore } from '@/composables/useGlobalStore';
|
||||
import { ArrowRight } from '@element-plus/icons-vue';
|
||||
import { sortMenu } from '@/utils/misc';
|
||||
const { isEE, isIntl } = useGlobalStore();
|
||||
const { isEE, isIntl, isAdmin } = useGlobalStore();
|
||||
|
||||
const drawerVisible = ref();
|
||||
const loading = ref();
|
||||
@@ -69,7 +69,7 @@ const acceptParams = (params: DialogProps): void => {
|
||||
let hideMenu = JSON.parse(params.hideMenu);
|
||||
sortMenu(hideMenu);
|
||||
treeData.hideMenu = hideMenu;
|
||||
if (isIntl.value || isEE.value) {
|
||||
if (isIntl.value || (isEE.value && !isAdmin.value)) {
|
||||
treeData.hideMenu = removeUpage(treeData.hideMenu);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user