feat: add toast when shell exec failed

This commit is contained in:
divocat
2025-10-23 19:08:27 +03:00
parent 9f8f032dce
commit 13d27dab21
7 changed files with 114 additions and 34 deletions

View File

@@ -3797,9 +3797,13 @@ async function handleShowGlobalCheck() {
_("Global check"),
renderModal(globalCheck.data, "global_check")
);
} else {
logger.error("[DIAGNOSTIC]", "handleShowGlobalCheck - e", globalCheck);
showToast(_("Failed to execute!"), "error");
}
} catch (e) {
logger.error("[DIAGNOSTIC]", "handleShowGlobalCheck - e", e);
showToast(_("Failed to execute!"), "error");
} finally {
store.set({
diagnosticsActions: {
@@ -3824,9 +3828,13 @@ async function handleViewLogs() {
_("View logs"),
renderModal(viewLogs.data, "view_logs")
);
} else {
logger.error("[DIAGNOSTIC]", "handleViewLogs - e", viewLogs);
showToast(_("Failed to execute!"), "error");
}
} catch (e) {
logger.error("[DIAGNOSTIC]", "handleViewLogs - e", e);
showToast(_("Failed to execute!"), "error");
} finally {
store.set({
diagnosticsActions: {
@@ -3851,9 +3859,17 @@ async function handleShowSingBoxConfig() {
_("Show sing-box config"),
renderModal(showSingBoxConfig.data, "show_sing_box_config")
);
} else {
logger.error(
"[DIAGNOSTIC]",
"handleShowSingBoxConfig - e",
showSingBoxConfig
);
showToast(_("Failed to execute!"), "error");
}
} catch (e) {
logger.error("[DIAGNOSTIC]", "handleShowSingBoxConfig - e", e);
showToast(_("Failed to execute!"), "error");
} finally {
store.set({
diagnosticsActions: {
@@ -3946,6 +3962,11 @@ function renderDiagnosticSystemInfoWidget() {
};
}
if (version !== `v${diagnosticsSystemInfo.podkop_latest_version}`) {
logger.debug(
"[DIAGNOSTIC]",
"diagnosticsSystemInfo",
diagnosticsSystemInfo
);
return {
key: "Podkop",
value: version,
@@ -3969,7 +3990,7 @@ function renderDiagnosticSystemInfoWidget() {
getPodkopVersionRow(),
{
key: "Luci App",
value: normalizeCompiledVersion(diagnosticsSystemInfo.luci_app_version)
value: normalizeCompiledVersion(PODKOP_LUCI_APP_VERSION)
},
{
key: "Sing-box",

View File

@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PODKOP\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-10-23 18:55+0300\n"
"PO-Revision-Date: 2025-10-23 18:55+0300\n"
"POT-Creation-Date: 2025-10-23 19:08+0300\n"
"PO-Revision-Date: 2025-10-23 19:08+0300\n"
"Last-Translator: divocat\n"
"Language-Team: none\n"
"Language: ru\n"
@@ -230,6 +230,9 @@ msgstr "Исключите трафик протокола NTP из туннел
msgid "Failed to copy!"
msgstr "Не удалось скопировать!"
msgid "Failed to execute!"
msgstr "Не удалось выполнить!"
msgid "Fastest"
msgstr "Самый быстрый"

View File

@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PODKOP\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-10-23 15:55+0300\n"
"PO-Revision-Date: 2025-10-23 15:55+0300\n"
"POT-Creation-Date: 2025-10-23 16:08+0300\n"
"PO-Revision-Date: 2025-10-23 16:08+0300\n"
"Last-Translator: divocat <divocatt@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
@@ -312,6 +312,15 @@ msgstr ""
msgid "Failed to copy!"
msgstr ""
#: src/podkop/tabs/diagnostic/initController.ts:225
#: src/podkop/tabs/diagnostic/initController.ts:229
#: src/podkop/tabs/diagnostic/initController.ts:259
#: src/podkop/tabs/diagnostic/initController.ts:263
#: src/podkop/tabs/diagnostic/initController.ts:297
#: src/podkop/tabs/diagnostic/initController.ts:301
msgid "Failed to execute!"
msgstr ""
#: src/podkop/methods/custom/getDashboardSections.ts:117
msgid "Fastest"
msgstr ""
@@ -324,7 +333,7 @@ msgstr ""
msgid "Get global check"
msgstr ""
#: src/podkop/tabs/diagnostic/initController.ts:218
#: src/podkop/tabs/diagnostic/initController.ts:220
msgid "Global check"
msgstr ""
@@ -469,7 +478,7 @@ msgstr ""
msgid "IP address 0.0.0.0 is not allowed"
msgstr ""
#: src/podkop/tabs/diagnostic/initController.ts:404
#: src/podkop/tabs/diagnostic/initController.ts:427
msgid "Latest"
msgstr ""
@@ -536,7 +545,7 @@ msgstr ""
msgid "Outbound JSON must contain at least \"type\", \"server\" and \"server_port\" fields"
msgstr ""
#: src/podkop/tabs/diagnostic/initController.ts:394
#: src/podkop/tabs/diagnostic/initController.ts:417
msgid "Outdated"
msgstr ""
@@ -724,7 +733,7 @@ msgstr ""
msgid "Settings"
msgstr ""
#: src/podkop/tabs/diagnostic/initController.ts:278
#: src/podkop/tabs/diagnostic/initController.ts:288
#: src/podkop/tabs/diagnostic/partials/renderAvailableActions.ts:116
msgid "Show sing-box config"
msgstr ""
@@ -851,13 +860,13 @@ msgstr ""
msgid "UDP over TCP"
msgstr ""
#: src/podkop/tabs/diagnostic/initController.ts:34
#: src/podkop/tabs/diagnostic/initController.ts:35
#: src/podkop/tabs/diagnostic/initController.ts:36
#: src/podkop/tabs/diagnostic/initController.ts:37
#: src/podkop/tabs/diagnostic/initController.ts:38
#: src/podkop/tabs/diagnostic/initController.ts:39
#: src/podkop/tabs/diagnostic/initController.ts:373
#: src/podkop/tabs/diagnostic/initController.ts:40
#: src/podkop/tabs/diagnostic/initController.ts:41
#: src/podkop/tabs/diagnostic/initController.ts:391
msgid "unknown"
msgstr ""
@@ -931,7 +940,7 @@ msgstr ""
msgid "Validation errors:"
msgstr ""
#: src/podkop/tabs/diagnostic/initController.ts:248
#: src/podkop/tabs/diagnostic/initController.ts:254
#: src/podkop/tabs/diagnostic/partials/renderAvailableActions.ts:107
msgid "View logs"
msgstr ""