mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-13 17:24:44 +08:00
parent
99fc39d401
commit
01588ed9b5
@ -23,14 +23,17 @@ export function initFavicon() {
|
||||
}
|
||||
|
||||
export async function getXpackSetting() {
|
||||
const searchXSettingGlob = import.meta.glob('xpack/api/modules/setting.ts');
|
||||
const module = await searchXSettingGlob?.['../xpack/api/modules/setting.ts']?.();
|
||||
const res = await module?.searchXSetting();
|
||||
if (!res) {
|
||||
resetXSetting();
|
||||
return;
|
||||
let searchXSetting;
|
||||
const xpackModules = import.meta.glob('../xpack/api/modules/setting.ts', { eager: true });
|
||||
if (xpackModules['../xpack/api/modules/setting.ts']) {
|
||||
searchXSetting = xpackModules['../xpack/api/modules/setting.ts']['searchXSetting'] || {};
|
||||
const res = await searchXSetting();
|
||||
if (!res) {
|
||||
resetXSetting();
|
||||
return;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
const loadDataFromDB = async () => {
|
||||
@ -81,24 +84,30 @@ export async function getXpackSettingForTheme() {
|
||||
return;
|
||||
}
|
||||
|
||||
const searchXSettingGlob = import.meta.glob('xpack/api/modules/setting.ts');
|
||||
const module = await searchXSettingGlob?.['../xpack/api/modules/setting.ts']?.();
|
||||
const res2 = await module?.searchXSetting();
|
||||
if (res2) {
|
||||
globalStore.themeConfig.title = res2.data?.title;
|
||||
globalStore.themeConfig.logo = res2.data?.logo;
|
||||
globalStore.themeConfig.logoWithText = res2.data?.logoWithText;
|
||||
globalStore.themeConfig.favicon = res2.data?.favicon;
|
||||
globalStore.themeConfig.isGold = res2.data?.theme === 'dark-gold';
|
||||
} else {
|
||||
resetXSetting();
|
||||
let searchXSetting;
|
||||
const xpackModules = import.meta.glob('../xpack/api/modules/setting.ts', { eager: true });
|
||||
if (xpackModules['../xpack/api/modules/setting.ts']) {
|
||||
searchXSetting = xpackModules['../xpack/api/modules/setting.ts']['searchXSetting'] || {};
|
||||
const res2 = await searchXSetting();
|
||||
if (res2) {
|
||||
globalStore.themeConfig.title = res2.data?.title;
|
||||
globalStore.themeConfig.logo = res2.data?.logo;
|
||||
globalStore.themeConfig.logoWithText = res2.data?.logoWithText;
|
||||
globalStore.themeConfig.favicon = res2.data?.favicon;
|
||||
globalStore.themeConfig.isGold = res2.data?.theme === 'dark-gold';
|
||||
} else {
|
||||
resetXSetting();
|
||||
}
|
||||
}
|
||||
switchTheme();
|
||||
initFavicon();
|
||||
}
|
||||
|
||||
export async function updateXpackSettingByKey(key: string, value: string) {
|
||||
const searchXSettingGlob = import.meta.glob('xpack/api/modules/setting.ts');
|
||||
const module = await searchXSettingGlob?.['../xpack/api/modules/setting.ts']?.();
|
||||
return module?.updateXSettingByKey(key, value);
|
||||
let updateXSettingByKey;
|
||||
const xpackModules = import.meta.glob('../xpack/api/modules/setting.ts', { eager: true });
|
||||
if (xpackModules['../xpack/api/modules/setting.ts']) {
|
||||
updateXSettingByKey = xpackModules['../xpack/api/modules/setting.ts']['updateXSettingByKey'] || {};
|
||||
return updateXSettingByKey(key, value);
|
||||
}
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ onMounted(() => {
|
||||
font-weight: 600;
|
||||
}
|
||||
.fullScreen {
|
||||
background-color: #efefef;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
position: absolute;
|
||||
right: 50px;
|
||||
|
Loading…
x
Reference in New Issue
Block a user