mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-01-02 22:58:58 +03:00
feat: add getSingBoxCheck js method
This commit is contained in:
@@ -1079,8 +1079,8 @@ async function getPodkopStatus() {
|
||||
return { enabled: 0, status: "unknown" };
|
||||
}
|
||||
|
||||
// src/podkop/methods/getSingboxStatus.ts
|
||||
async function getSingboxStatus() {
|
||||
// src/podkop/methods/getSingBoxStatus.ts
|
||||
async function getSingBoxStatus() {
|
||||
const response = await executeShellCommand({
|
||||
command: "/usr/bin/podkop",
|
||||
args: ["get_sing_box_status"],
|
||||
@@ -1130,6 +1130,25 @@ async function getNftRulesCheck() {
|
||||
};
|
||||
}
|
||||
|
||||
// src/podkop/methods/getSingBoxCheck.ts
|
||||
async function getSingBoxCheck() {
|
||||
const response = await executeShellCommand({
|
||||
command: "/usr/bin/podkop",
|
||||
args: ["check_sing_box"],
|
||||
timeout: 1e4
|
||||
});
|
||||
if (response.stdout) {
|
||||
return {
|
||||
success: true,
|
||||
data: JSON.parse(response.stdout)
|
||||
};
|
||||
}
|
||||
return {
|
||||
success: false,
|
||||
error: ""
|
||||
};
|
||||
}
|
||||
|
||||
// src/podkop/services/tab.service.ts
|
||||
var TabService = class _TabService {
|
||||
constructor() {
|
||||
@@ -1691,7 +1710,7 @@ async function fetchServicesInfo() {
|
||||
try {
|
||||
const [podkop, singbox] = await Promise.all([
|
||||
getPodkopStatus(),
|
||||
getSingboxStatus()
|
||||
getSingBoxStatus()
|
||||
]);
|
||||
store.set({
|
||||
servicesInfoWidget: {
|
||||
@@ -2070,7 +2089,8 @@ return baseclass.extend({
|
||||
getNftRulesCheck,
|
||||
getPodkopStatus,
|
||||
getProxyUrlName,
|
||||
getSingboxStatus,
|
||||
getSingBoxCheck,
|
||||
getSingBoxStatus,
|
||||
initDashboardController,
|
||||
initDiagnosticController,
|
||||
injectGlobalStyles,
|
||||
|
||||
Reference in New Issue
Block a user