@@ -394,7 +394,14 @@ import { dateFormatForSecond, computeSize, computeSizeFromKBs, loadUpTime, jumpT
394394import { useRouter } from ' vue-router' ;
395395import { loadBaseInfo , loadCurrentInfo } from ' @/api/modules/dashboard' ;
396396import { getIOOptions , getNetworkOptions } from ' @/api/modules/host' ;
397- import { getSettingInfo , listAllSimpleNodes , loadUpgradeInfo , getMemo , updateMemo } from ' @/api/modules/setting' ;
397+ import {
398+ getSettingInfo ,
399+ getAgentSettingInfo ,
400+ listAllSimpleNodes ,
401+ loadUpgradeInfo ,
402+ getMemo ,
403+ updateMemo ,
404+ } from ' @/api/modules/setting' ;
398405import { GlobalStore } from ' @/store' ;
399406import { storeToRefs } from ' pinia' ;
400407import { routerToFileWithPath , routerToNameWithQuery , routerToPath } from ' @/utils/router' ;
@@ -555,6 +562,13 @@ const applyDefaultNetOption = () => {
555562 }
556563};
557564
565+ const onLoadAgentSettingInfo = async () => {
566+ await getAgentSettingInfo ().then ((res ) => {
567+ globalStore .defaultIO = res .data .defaultIO ;
568+ globalStore .defaultNetwork = res .data .defaultNetwork ;
569+ });
570+ };
571+
558572const onLoadNetworkOptions = async (force ? : boolean ) => {
559573 const cache = force ? null : getDashboardCache (' netOptions' );
560574 if (cache !== null ) {
@@ -575,7 +589,7 @@ const onLoadSimpleNode = async () => {
575589 simpleNodes .value = res .data || [];
576590};
577591
578- const applyDefaultIOOption = () => {
592+ const applyDefaultIOOption = async () => {
579593 if (! ioOptions .value || ioOptions .value .length === 0 ) return ;
580594 const defaultIO = globalStore .defaultIO || ioOptions .value [0 ];
581595 if (defaultIO && searchInfo .ioOption !== defaultIO ) {
@@ -905,6 +919,7 @@ const fetchData = async () => {
905919 window .addEventListener (' blur' , onBlur );
906920 hasRefreshedOptionsOnHover .value = false ;
907921 loadSafeStatus ();
922+ onLoadAgentSettingInfo ();
908923 onLoadBaseInfo (true , ' all' );
909924 scheduleDeferredFetch ();
910925 setTimeout (() => {
0 commit comments