mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-10 09:02:42 +08:00
parent
09dc15a940
commit
b6f2497346
2 changed files with 11 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { getLicenseStatus } from '@/api/modules/setting';
|
import { getLicenseStatus, getSettingInfo } from '@/api/modules/setting';
|
||||||
import { useTheme } from '@/hooks/use-theme';
|
import { useTheme } from '@/hooks/use-theme';
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
const globalStore = GlobalStore();
|
const globalStore = GlobalStore();
|
||||||
|
@ -33,6 +33,14 @@ export async function getXpackSetting() {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const loadDataFromDB = async () => {
|
||||||
|
const res = await getSettingInfo();
|
||||||
|
document.title = res.data.panelName;
|
||||||
|
globalStore.entrance = res.data.securityEntrance;
|
||||||
|
globalStore.setDefaultNetwork(res.data.defaultNetwork);
|
||||||
|
globalStore.setOpenMenuTabs(res.data.menuTabs === 'enable');
|
||||||
|
};
|
||||||
|
|
||||||
export async function loadProductProFromDB() {
|
export async function loadProductProFromDB() {
|
||||||
const res = await getLicenseStatus();
|
const res = await getLicenseStatus();
|
||||||
if (!res.data) {
|
if (!res.data) {
|
||||||
|
@ -48,6 +56,7 @@ export async function loadProductProFromDB() {
|
||||||
}
|
}
|
||||||
switchTheme();
|
switchTheme();
|
||||||
initFavicon();
|
initFavicon();
|
||||||
|
loadDataFromDB();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getXpackSettingForTheme() {
|
export async function getXpackSettingForTheme() {
|
||||||
|
|
|
@ -361,6 +361,7 @@ const loadDataFromDB = async () => {
|
||||||
i18n.locale.value = res.data.language;
|
i18n.locale.value = res.data.language;
|
||||||
i18n.warnHtmlMessage = false;
|
i18n.warnHtmlMessage = false;
|
||||||
globalStore.entrance = res.data.securityEntrance;
|
globalStore.entrance = res.data.securityEntrance;
|
||||||
|
globalStore.setDefaultNetwork(res.data.defaultNetwork);
|
||||||
globalStore.setOpenMenuTabs(res.data.menuTabs === 'enable');
|
globalStore.setOpenMenuTabs(res.data.menuTabs === 'enable');
|
||||||
globalStore.updateLanguage(res.data.language);
|
globalStore.updateLanguage(res.data.language);
|
||||||
globalStore.setThemeConfig({ ...themeConfig.value, theme: res.data.theme, panelName: res.data.panelName });
|
globalStore.setThemeConfig({ ...themeConfig.value, theme: res.data.theme, panelName: res.data.panelName });
|
||||||
|
|
Loading…
Reference in a new issue