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

@@ -508,6 +508,18 @@
"src/helpers/copyToClipboard.ts:12"
]
},
{
"call": "Failed to execute!",
"key": "Failed to execute!",
"places": [
"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"
]
},
{
"call": "Fastest",
"key": "Fastest",
@@ -533,7 +545,7 @@
"call": "Global check",
"key": "Global check",
"places": [
"src/podkop/tabs/diagnostic/initController.ts:218"
"src/podkop/tabs/diagnostic/initController.ts:220"
]
},
{
@@ -786,7 +798,7 @@
"call": "Latest",
"key": "Latest",
"places": [
"src/podkop/tabs/diagnostic/initController.ts:404"
"src/podkop/tabs/diagnostic/initController.ts:427"
]
},
{
@@ -901,7 +913,7 @@
"call": "Outdated",
"key": "Outdated",
"places": [
"src/podkop/tabs/diagnostic/initController.ts:394"
"src/podkop/tabs/diagnostic/initController.ts:417"
]
},
{
@@ -1227,7 +1239,7 @@
"call": "Show sing-box config",
"key": "Show sing-box config",
"places": [
"src/podkop/tabs/diagnostic/initController.ts:278",
"src/podkop/tabs/diagnostic/initController.ts:288",
"src/podkop/tabs/diagnostic/partials/renderAvailableActions.ts:116"
]
},
@@ -1447,13 +1459,13 @@
"call": "unknown",
"key": "unknown",
"places": [
"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"
]
},
{
@@ -1572,7 +1584,7 @@
"call": "View logs",
"key": "View logs",
"places": [
"src/podkop/tabs/diagnostic/initController.ts:248",
"src/podkop/tabs/diagnostic/initController.ts:254",
"src/podkop/tabs/diagnostic/partials/renderAvailableActions.ts:107"
]
},

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 ""

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

@@ -16,6 +16,8 @@ import { PodkopShellMethods } from '../../methods';
import { fetchServicesInfo } from '../../fetchers';
import { normalizeCompiledVersion } from '../../../helpers/normalizeCompiledVersion';
import { renderModal } from '../../../partials';
import { PODKOP_LUCI_APP_VERSION } from '../../../constants';
import { showToast } from '../../../helpers/showToast';
async function fetchSystemInfo() {
const systemInfo = await PodkopShellMethods.getSystemInfo();
@@ -218,9 +220,13 @@ async function handleShowGlobalCheck() {
_('Global check'),
renderModal(globalCheck.data as string, '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: {
@@ -248,9 +254,13 @@ async function handleViewLogs() {
_('View logs'),
renderModal(viewLogs.data as string, '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: {
@@ -278,9 +288,17 @@ async function handleShowSingBoxConfig() {
_('Show sing-box config'),
renderModal(showSingBoxConfig.data as string, '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: {
@@ -387,6 +405,11 @@ function renderDiagnosticSystemInfoWidget() {
}
if (version !== `v${diagnosticsSystemInfo.podkop_latest_version}`) {
logger.debug(
'[DIAGNOSTIC]',
'diagnosticsSystemInfo',
diagnosticsSystemInfo,
);
return {
key: 'Podkop',
value: version,
@@ -412,7 +435,7 @@ function renderDiagnosticSystemInfoWidget() {
getPodkopVersionRow(),
{
key: 'Luci App',
value: normalizeCompiledVersion(diagnosticsSystemInfo.luci_app_version),
value: normalizeCompiledVersion(PODKOP_LUCI_APP_VERSION),
},
{
key: 'Sing-box',