fix: 修改终端全屏按钮样式 (#5442)

Refs #5435
This commit is contained in:
ssongliu 2024-06-13 16:12:36 +08:00 committed by GitHub
parent 99fc39d401
commit 01588ed9b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 22 deletions

View file

@ -23,14 +23,17 @@ export function initFavicon() {
} }
export async function getXpackSetting() { export async function getXpackSetting() {
const searchXSettingGlob = import.meta.glob('xpack/api/modules/setting.ts'); let searchXSetting;
const module = await searchXSettingGlob?.['../xpack/api/modules/setting.ts']?.(); const xpackModules = import.meta.glob('../xpack/api/modules/setting.ts', { eager: true });
const res = await module?.searchXSetting(); if (xpackModules['../xpack/api/modules/setting.ts']) {
if (!res) { searchXSetting = xpackModules['../xpack/api/modules/setting.ts']['searchXSetting'] || {};
resetXSetting(); const res = await searchXSetting();
return; if (!res) {
resetXSetting();
return;
}
return res;
} }
return res;
} }
const loadDataFromDB = async () => { const loadDataFromDB = async () => {
@ -81,24 +84,30 @@ export async function getXpackSettingForTheme() {
return; return;
} }
const searchXSettingGlob = import.meta.glob('xpack/api/modules/setting.ts'); let searchXSetting;
const module = await searchXSettingGlob?.['../xpack/api/modules/setting.ts']?.(); const xpackModules = import.meta.glob('../xpack/api/modules/setting.ts', { eager: true });
const res2 = await module?.searchXSetting(); if (xpackModules['../xpack/api/modules/setting.ts']) {
if (res2) { searchXSetting = xpackModules['../xpack/api/modules/setting.ts']['searchXSetting'] || {};
globalStore.themeConfig.title = res2.data?.title; const res2 = await searchXSetting();
globalStore.themeConfig.logo = res2.data?.logo; if (res2) {
globalStore.themeConfig.logoWithText = res2.data?.logoWithText; globalStore.themeConfig.title = res2.data?.title;
globalStore.themeConfig.favicon = res2.data?.favicon; globalStore.themeConfig.logo = res2.data?.logo;
globalStore.themeConfig.isGold = res2.data?.theme === 'dark-gold'; globalStore.themeConfig.logoWithText = res2.data?.logoWithText;
} else { globalStore.themeConfig.favicon = res2.data?.favicon;
resetXSetting(); globalStore.themeConfig.isGold = res2.data?.theme === 'dark-gold';
} else {
resetXSetting();
}
} }
switchTheme(); switchTheme();
initFavicon(); initFavicon();
} }
export async function updateXpackSettingByKey(key: string, value: string) { export async function updateXpackSettingByKey(key: string, value: string) {
const searchXSettingGlob = import.meta.glob('xpack/api/modules/setting.ts'); let updateXSettingByKey;
const module = await searchXSettingGlob?.['../xpack/api/modules/setting.ts']?.(); const xpackModules = import.meta.glob('../xpack/api/modules/setting.ts', { eager: true });
return module?.updateXSettingByKey(key, value); if (xpackModules['../xpack/api/modules/setting.ts']) {
updateXSettingByKey = xpackModules['../xpack/api/modules/setting.ts']['updateXSettingByKey'] || {};
return updateXSettingByKey(key, value);
}
} }

View file

@ -448,7 +448,7 @@ onMounted(() => {
font-weight: 600; font-weight: 600;
} }
.fullScreen { .fullScreen {
background-color: #efefef; background-color: transparent;
border: none; border: none;
position: absolute; position: absolute;
right: 50px; right: 50px;