Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/api/interface/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export namespace Setting {
theme: string;
menuTabs: string;
language: string;
defaultIO: string;
defaultNetwork: string;
lastCleanTime: string;
lastCleanSize: string;
Expand Down
19 changes: 17 additions & 2 deletions frontend/src/views/home/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,14 @@ import { dateFormatForSecond, computeSize, computeSizeFromKBs, loadUpTime, jumpT
import { useRouter } from 'vue-router';
import { loadBaseInfo, loadCurrentInfo } from '@/api/modules/dashboard';
import { getIOOptions, getNetworkOptions } from '@/api/modules/host';
import { getSettingInfo, listAllSimpleNodes, loadUpgradeInfo, getMemo, updateMemo } from '@/api/modules/setting';
import {
getSettingInfo,
getAgentSettingInfo,
listAllSimpleNodes,
loadUpgradeInfo,
getMemo,
updateMemo,
} from '@/api/modules/setting';
import { GlobalStore } from '@/store';
import { storeToRefs } from 'pinia';
import { routerToFileWithPath, routerToNameWithQuery, routerToPath } from '@/utils/router';
Expand Down Expand Up @@ -555,6 +562,13 @@ const applyDefaultNetOption = () => {
}
};

const onLoadAgentSettingInfo = async () => {
await getAgentSettingInfo().then((res) => {
globalStore.defaultIO = res.data.defaultIO;
globalStore.defaultNetwork = res.data.defaultNetwork;
});
};

const onLoadNetworkOptions = async (force?: boolean) => {
const cache = force ? null : getDashboardCache('netOptions');
if (cache !== null) {
Expand All @@ -575,7 +589,7 @@ const onLoadSimpleNode = async () => {
simpleNodes.value = res.data || [];
};

const applyDefaultIOOption = () => {
const applyDefaultIOOption = async () => {
if (!ioOptions.value || ioOptions.value.length === 0) return;
const defaultIO = globalStore.defaultIO || ioOptions.value[0];
if (defaultIO && searchInfo.ioOption !== defaultIO) {
Expand Down Expand Up @@ -905,6 +919,7 @@ const fetchData = async () => {
window.addEventListener('blur', onBlur);
hasRefreshedOptionsOnHover.value = false;
loadSafeStatus();
onLoadAgentSettingInfo();
onLoadBaseInfo(true, 'all');
scheduleDeferredFetch();
setTimeout(() => {
Expand Down
Loading