mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 03:26:51 +03:00
feat: add skip next checks if sb is not running
This commit is contained in:
@@ -80,4 +80,6 @@ export const PodkopShellMethods = {
|
||||
callBaseMethod<unknown>(Podkop.AvailableMethods.SHOW_SING_BOX_CONFIG),
|
||||
checkLogs: async () =>
|
||||
callBaseMethod<unknown>(Podkop.AvailableMethods.CHECK_LOGS),
|
||||
getSystemInfo: async () =>
|
||||
callBaseMethod<unknown>(Podkop.AvailableMethods.GET_SYSTEM_INFO),
|
||||
};
|
||||
|
||||
@@ -101,7 +101,7 @@ export async function runSingBoxCheck() {
|
||||
],
|
||||
});
|
||||
|
||||
if (!atLeastOneGood) {
|
||||
if (!atLeastOneGood || !data.sing_box_process_running) {
|
||||
throw new Error('Sing-box checks failed');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ async function handleRestart() {
|
||||
restart: { loading: false },
|
||||
},
|
||||
});
|
||||
store.reset(['diagnosticsChecks']);
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
@@ -93,6 +94,7 @@ async function handleStop() {
|
||||
stop: { loading: false },
|
||||
},
|
||||
});
|
||||
store.reset(['diagnosticsChecks']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +120,7 @@ async function handleStart() {
|
||||
start: { loading: false },
|
||||
},
|
||||
});
|
||||
store.reset(['diagnosticsChecks']);
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ export namespace Podkop {
|
||||
GLOBAL_CHECK = 'global_check',
|
||||
SHOW_SING_BOX_CONFIG = 'show_sing_box_config',
|
||||
CHECK_LOGS = 'check_logs',
|
||||
GET_SYSTEM_INFO = 'get_system_info',
|
||||
}
|
||||
|
||||
export enum AvailableClashAPIMethods {
|
||||
|
||||
@@ -449,6 +449,7 @@ var Podkop;
|
||||
AvailableMethods2["GLOBAL_CHECK"] = "global_check";
|
||||
AvailableMethods2["SHOW_SING_BOX_CONFIG"] = "show_sing_box_config";
|
||||
AvailableMethods2["CHECK_LOGS"] = "check_logs";
|
||||
AvailableMethods2["GET_SYSTEM_INFO"] = "get_system_info";
|
||||
})(AvailableMethods = Podkop2.AvailableMethods || (Podkop2.AvailableMethods = {}));
|
||||
let AvailableClashAPIMethods;
|
||||
((AvailableClashAPIMethods2) => {
|
||||
@@ -520,7 +521,8 @@ var PodkopShellMethods = {
|
||||
),
|
||||
globalCheck: async () => callBaseMethod(Podkop.AvailableMethods.GLOBAL_CHECK),
|
||||
showSingBoxConfig: async () => callBaseMethod(Podkop.AvailableMethods.SHOW_SING_BOX_CONFIG),
|
||||
checkLogs: async () => callBaseMethod(Podkop.AvailableMethods.CHECK_LOGS)
|
||||
checkLogs: async () => callBaseMethod(Podkop.AvailableMethods.CHECK_LOGS),
|
||||
getSystemInfo: async () => callBaseMethod(Podkop.AvailableMethods.GET_SYSTEM_INFO)
|
||||
};
|
||||
|
||||
// src/podkop/methods/custom/getDashboardSections.ts
|
||||
@@ -2172,7 +2174,7 @@ async function runSingBoxCheck() {
|
||||
}
|
||||
]
|
||||
});
|
||||
if (!atLeastOneGood) {
|
||||
if (!atLeastOneGood || !data.sing_box_process_running) {
|
||||
throw new Error("Sing-box checks failed");
|
||||
}
|
||||
}
|
||||
@@ -3244,6 +3246,7 @@ async function handleRestart() {
|
||||
restart: { loading: false }
|
||||
}
|
||||
});
|
||||
store.reset(["diagnosticsChecks"]);
|
||||
}, 5e3);
|
||||
}
|
||||
}
|
||||
@@ -3267,6 +3270,7 @@ async function handleStop() {
|
||||
stop: { loading: false }
|
||||
}
|
||||
});
|
||||
store.reset(["diagnosticsChecks"]);
|
||||
}
|
||||
}
|
||||
async function handleStart() {
|
||||
@@ -3290,6 +3294,7 @@ async function handleStart() {
|
||||
start: { loading: false }
|
||||
}
|
||||
});
|
||||
store.reset(["diagnosticsChecks"]);
|
||||
}, 5e3);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user