feat: add skip next checks if sb is not running

This commit is contained in:
divocat
2025-10-15 21:24:56 +03:00
parent c0b35c865d
commit d8b7e12c4d
5 changed files with 14 additions and 3 deletions

View File

@@ -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),
};

View File

@@ -101,7 +101,7 @@ export async function runSingBoxCheck() {
],
});
if (!atLeastOneGood) {
if (!atLeastOneGood || !data.sing_box_process_running) {
throw new Error('Sing-box checks failed');
}
}

View File

@@ -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);
}
}

View File

@@ -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 {