mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-18 13:29:03 +08:00
fix: Fix the issue of abnormal default network card display (#10525)
Refs #10520
This commit is contained in:
parent
8937acee13
commit
97d6d9c69f
1 changed files with 9 additions and 1 deletions
|
|
@ -82,7 +82,7 @@ import { DropdownInstance } from 'element-plus';
|
|||
import { countExecutingTask } from '@/api/modules/log';
|
||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
import i18n from '@/lang';
|
||||
import { listNodeOptions } from '@/api/modules/setting';
|
||||
import { getAgentSettingInfo, listNodeOptions } from '@/api/modules/setting';
|
||||
import { ref, watch } from 'vue';
|
||||
import bus from '@/global/bus';
|
||||
import { logOutApi } from '@/api/modules/auth';
|
||||
|
|
@ -182,6 +182,7 @@ const changeNode = (command: string) => {
|
|||
if (command == 'local') {
|
||||
globalStore.currentNode = 'local';
|
||||
globalStore.currentNodeAddr = item.addr;
|
||||
loadGlobalSetting();
|
||||
loadProductProFromDB();
|
||||
routerToNameWithQuery('home', { t: Date.now() });
|
||||
return;
|
||||
|
|
@ -198,6 +199,7 @@ const changeNode = (command: string) => {
|
|||
MsgError(i18n.global.t('setting.versionNotSame'));
|
||||
return;
|
||||
}
|
||||
loadGlobalSetting();
|
||||
globalStore.currentNode = command || 'local';
|
||||
globalStore.currentNodeAddr = item.addr;
|
||||
loadProductProFromDB();
|
||||
|
|
@ -206,6 +208,12 @@ const changeNode = (command: string) => {
|
|||
}
|
||||
};
|
||||
|
||||
const loadGlobalSetting = async () => {
|
||||
await getAgentSettingInfo().then((res) => {
|
||||
globalStore.defaultNetwork = res.data.defaultNetwork;
|
||||
});
|
||||
};
|
||||
|
||||
const showNodes = () => {
|
||||
return nodes.value.length > 0 && isMasterPro;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue