feat(ui): постоянная кнопка аварийного возврата прямого интернета в окне AI Doctor и действиях диагностики
This commit is contained in:
@@ -3926,3 +3926,22 @@ msgstr "Сбросить Bootstrap DNS"
|
||||
msgid "Optimize AWG MTU"
|
||||
msgstr "Оптимизировать MTU AWG"
|
||||
|
||||
msgid "Restore Native Internet"
|
||||
msgstr "Вернуть обычный интернет"
|
||||
|
||||
msgid "Restoring native direct internet (stopping Tachyon)..."
|
||||
msgstr "Восстановление прямого интернета (остановка Tachyon)..."
|
||||
|
||||
msgid "Restoring native direct internet..."
|
||||
msgstr "Восстановление прямого интернета..."
|
||||
|
||||
msgid "Native internet restored. Tachyon stopped."
|
||||
msgstr "Обычный интернет восстановлен. Tachyon остановлен."
|
||||
|
||||
msgid "Failed to restore native internet"
|
||||
msgstr "Не удалось восстановить прямой интернет"
|
||||
|
||||
msgid "This action will stop Tachyon, restore standard dnsmasq/DNS, remove all proxy/anti-censorship firewall rules and restore direct Internet connection through your ISP."
|
||||
msgstr "Это действие остановит Tachyon, восстановит стандартный dnsmasq/DNS, удалит все правила файрвола и вернет прямое подключение к интернету через вашего провайдера."
|
||||
|
||||
|
||||
|
||||
@@ -1489,11 +1489,57 @@ async function handleRunAiDoctor() {
|
||||
'margin-top: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;',
|
||||
},
|
||||
[
|
||||
renderButton({
|
||||
classNames: ['cbi-button-action'],
|
||||
text: '📋 ' + _('Copy Support Report'),
|
||||
onClick: copySupportReport,
|
||||
}),
|
||||
E(
|
||||
'div',
|
||||
{
|
||||
style:
|
||||
'display: flex; gap: 8px; flex-wrap: wrap; align-items: center;',
|
||||
},
|
||||
[
|
||||
renderButton({
|
||||
classNames: ['cbi-button-action'],
|
||||
text: '📋 ' + _('Copy Support Report'),
|
||||
onClick: copySupportReport,
|
||||
}),
|
||||
renderButton({
|
||||
classNames: ['cbi-button-reset'],
|
||||
text:
|
||||
'🚨 ' + _('Restore Native Internet (Stop Tachyon)'),
|
||||
onClick: async () => {
|
||||
showToast(
|
||||
_(
|
||||
'Restoring native direct internet (stopping Tachyon)...',
|
||||
),
|
||||
'success',
|
||||
);
|
||||
const fixRes =
|
||||
await TachyonShellMethods.applyQuickFix(
|
||||
'restore_native_internet',
|
||||
);
|
||||
if (
|
||||
fixRes &&
|
||||
typeof fixRes === 'object' &&
|
||||
(fixRes as { success?: boolean }).success
|
||||
) {
|
||||
showToast(
|
||||
_('Native internet restored. Tachyon stopped.'),
|
||||
'success',
|
||||
);
|
||||
ui.hideModal();
|
||||
await refreshDiagnosticServicesInfo({
|
||||
force: true,
|
||||
allowInactive: true,
|
||||
});
|
||||
} else {
|
||||
showToast(
|
||||
_('Failed to restore native internet'),
|
||||
'error',
|
||||
);
|
||||
}
|
||||
},
|
||||
}),
|
||||
],
|
||||
),
|
||||
renderButton({
|
||||
classNames: ['cbi-button-neutral'],
|
||||
text: _('Close'),
|
||||
@@ -1530,6 +1576,67 @@ function handleOpenAiChat() {
|
||||
renderAiChatModal();
|
||||
}
|
||||
|
||||
function handleRestoreNativeInternet() {
|
||||
ui.showModal(
|
||||
_('Restore Native Internet'),
|
||||
E('div', {}, [
|
||||
E(
|
||||
'p',
|
||||
{},
|
||||
_(
|
||||
'This action will stop Tachyon, restore standard dnsmasq/DNS, remove all proxy/anti-censorship firewall rules and restore direct Internet connection through your ISP.',
|
||||
),
|
||||
),
|
||||
E(
|
||||
'div',
|
||||
{
|
||||
class: 'right',
|
||||
style:
|
||||
'display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px;',
|
||||
},
|
||||
[
|
||||
renderButton({
|
||||
classNames: ['cbi-button-neutral'],
|
||||
text: _('Cancel'),
|
||||
onClick: () => ui.hideModal(),
|
||||
}),
|
||||
renderButton({
|
||||
classNames: ['cbi-button-reset'],
|
||||
text: '🚨 ' + _('Restore Native Internet'),
|
||||
onClick: async () => {
|
||||
ui.hideModal();
|
||||
showToast(
|
||||
_('Restoring native direct internet (stopping Tachyon)...'),
|
||||
'success',
|
||||
);
|
||||
const res =
|
||||
await TachyonShellMethods.applyQuickFix(
|
||||
'restore_native_internet',
|
||||
);
|
||||
if (
|
||||
res &&
|
||||
typeof res === 'object' &&
|
||||
(res as { success?: boolean }).success
|
||||
) {
|
||||
showToast(
|
||||
_('Native internet restored. Tachyon stopped.'),
|
||||
'success',
|
||||
);
|
||||
await refreshDiagnosticServicesInfo({
|
||||
force: true,
|
||||
allowInactive: true,
|
||||
});
|
||||
} else {
|
||||
showToast(_('Failed to restore native internet'), 'error');
|
||||
}
|
||||
},
|
||||
}),
|
||||
],
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
async function handleShowSingBoxConfig() {
|
||||
setDiagnosticActionLoading('showSingBoxConfig', true);
|
||||
|
||||
@@ -1742,6 +1849,12 @@ function renderDiagnosticAvailableActionsWidget() {
|
||||
onClick: handleRunAiDoctor,
|
||||
disabled: diagnosticsActions.aiDoctor.loading,
|
||||
},
|
||||
restoreNativeInternet: {
|
||||
loading: false,
|
||||
visible: true,
|
||||
onClick: handleRestoreNativeInternet,
|
||||
disabled: false,
|
||||
},
|
||||
aiChat: {
|
||||
loading: false,
|
||||
visible: true,
|
||||
|
||||
@@ -29,6 +29,7 @@ interface IRenderAvailableActionsProps {
|
||||
doctor: ActionProps;
|
||||
aiDoctor: ActionProps;
|
||||
aiChat?: ActionProps;
|
||||
restoreNativeInternet?: ActionProps;
|
||||
viewLogs: ActionProps;
|
||||
showSingBoxConfig: ActionProps;
|
||||
generateBugReport: ActionProps;
|
||||
@@ -45,6 +46,7 @@ export function renderAvailableActions({
|
||||
doctor,
|
||||
aiDoctor,
|
||||
aiChat,
|
||||
restoreNativeInternet,
|
||||
viewLogs,
|
||||
showSingBoxConfig,
|
||||
generateBugReport,
|
||||
@@ -130,6 +132,16 @@ export function renderAvailableActions({
|
||||
disabled: aiDoctor.disabled,
|
||||
}),
|
||||
]),
|
||||
...insertIf(!!restoreNativeInternet?.visible, [
|
||||
renderButton({
|
||||
classNames: ['cbi-button-reset'],
|
||||
onClick: restoreNativeInternet!.onClick,
|
||||
icon: renderCircleStopIcon24,
|
||||
text: _('Restore Native Internet'),
|
||||
loading: restoreNativeInternet!.loading,
|
||||
disabled: restoreNativeInternet!.disabled,
|
||||
}),
|
||||
]),
|
||||
...insertIf(!!aiChat?.visible, [
|
||||
renderButton({
|
||||
classNames: ['cbi-button-action'],
|
||||
|
||||
@@ -10099,6 +10099,7 @@ function renderAvailableActions({
|
||||
doctor,
|
||||
aiDoctor,
|
||||
aiChat,
|
||||
restoreNativeInternet,
|
||||
viewLogs,
|
||||
showSingBoxConfig,
|
||||
generateBugReport,
|
||||
@@ -10184,6 +10185,16 @@ function renderAvailableActions({
|
||||
disabled: aiDoctor.disabled
|
||||
})
|
||||
]),
|
||||
...insertIf(!!restoreNativeInternet?.visible, [
|
||||
renderButton({
|
||||
classNames: ["cbi-button-reset"],
|
||||
onClick: restoreNativeInternet.onClick,
|
||||
icon: renderCircleStopIcon24,
|
||||
text: _("Restore Native Internet"),
|
||||
loading: restoreNativeInternet.loading,
|
||||
disabled: restoreNativeInternet.disabled
|
||||
})
|
||||
]),
|
||||
...insertIf(!!aiChat?.visible, [
|
||||
renderButton({
|
||||
classNames: ["cbi-button-action"],
|
||||
@@ -12976,11 +12987,50 @@ async function handleRunAiDoctor() {
|
||||
style: "margin-top: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;"
|
||||
},
|
||||
[
|
||||
renderButton({
|
||||
classNames: ["cbi-button-action"],
|
||||
text: "\u{1F4CB} " + _("Copy Support Report"),
|
||||
onClick: copySupportReport
|
||||
}),
|
||||
E(
|
||||
"div",
|
||||
{
|
||||
style: "display: flex; gap: 8px; flex-wrap: wrap; align-items: center;"
|
||||
},
|
||||
[
|
||||
renderButton({
|
||||
classNames: ["cbi-button-action"],
|
||||
text: "\u{1F4CB} " + _("Copy Support Report"),
|
||||
onClick: copySupportReport
|
||||
}),
|
||||
renderButton({
|
||||
classNames: ["cbi-button-reset"],
|
||||
text: "\u{1F6A8} " + _("Restore Native Internet (Stop Tachyon)"),
|
||||
onClick: async () => {
|
||||
showToast(
|
||||
_(
|
||||
"Restoring native direct internet (stopping Tachyon)..."
|
||||
),
|
||||
"success"
|
||||
);
|
||||
const fixRes = await TachyonShellMethods.applyQuickFix(
|
||||
"restore_native_internet"
|
||||
);
|
||||
if (fixRes && typeof fixRes === "object" && fixRes.success) {
|
||||
showToast(
|
||||
_("Native internet restored. Tachyon stopped."),
|
||||
"success"
|
||||
);
|
||||
ui.hideModal();
|
||||
await refreshDiagnosticServicesInfo({
|
||||
force: true,
|
||||
allowInactive: true
|
||||
});
|
||||
} else {
|
||||
showToast(
|
||||
_("Failed to restore native internet"),
|
||||
"error"
|
||||
);
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
),
|
||||
renderButton({
|
||||
classNames: ["cbi-button-neutral"],
|
||||
text: _("Close"),
|
||||
@@ -13011,6 +13061,60 @@ async function handleRunAiDoctor() {
|
||||
function handleOpenAiChat() {
|
||||
renderAiChatModal();
|
||||
}
|
||||
function handleRestoreNativeInternet() {
|
||||
ui.showModal(
|
||||
_("Restore Native Internet"),
|
||||
E("div", {}, [
|
||||
E(
|
||||
"p",
|
||||
{},
|
||||
_(
|
||||
"This action will stop Tachyon, restore standard dnsmasq/DNS, remove all proxy/anti-censorship firewall rules and restore direct Internet connection through your ISP."
|
||||
)
|
||||
),
|
||||
E(
|
||||
"div",
|
||||
{
|
||||
class: "right",
|
||||
style: "display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px;"
|
||||
},
|
||||
[
|
||||
renderButton({
|
||||
classNames: ["cbi-button-neutral"],
|
||||
text: _("Cancel"),
|
||||
onClick: () => ui.hideModal()
|
||||
}),
|
||||
renderButton({
|
||||
classNames: ["cbi-button-reset"],
|
||||
text: "\u{1F6A8} " + _("Restore Native Internet"),
|
||||
onClick: async () => {
|
||||
ui.hideModal();
|
||||
showToast(
|
||||
_("Restoring native direct internet (stopping Tachyon)..."),
|
||||
"success"
|
||||
);
|
||||
const res = await TachyonShellMethods.applyQuickFix(
|
||||
"restore_native_internet"
|
||||
);
|
||||
if (res && typeof res === "object" && res.success) {
|
||||
showToast(
|
||||
_("Native internet restored. Tachyon stopped."),
|
||||
"success"
|
||||
);
|
||||
await refreshDiagnosticServicesInfo({
|
||||
force: true,
|
||||
allowInactive: true
|
||||
});
|
||||
} else {
|
||||
showToast(_("Failed to restore native internet"), "error");
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
)
|
||||
])
|
||||
);
|
||||
}
|
||||
async function handleShowSingBoxConfig() {
|
||||
setDiagnosticActionLoading("showSingBoxConfig", true);
|
||||
try {
|
||||
@@ -13188,6 +13292,12 @@ function renderDiagnosticAvailableActionsWidget() {
|
||||
onClick: handleRunAiDoctor,
|
||||
disabled: diagnosticsActions.aiDoctor.loading
|
||||
},
|
||||
restoreNativeInternet: {
|
||||
loading: false,
|
||||
visible: true,
|
||||
onClick: handleRestoreNativeInternet,
|
||||
disabled: false
|
||||
},
|
||||
aiChat: {
|
||||
loading: false,
|
||||
visible: true,
|
||||
|
||||
@@ -3926,3 +3926,22 @@ msgstr "Сбросить Bootstrap DNS"
|
||||
msgid "Optimize AWG MTU"
|
||||
msgstr "Оптимизировать MTU AWG"
|
||||
|
||||
msgid "Restore Native Internet"
|
||||
msgstr "Вернуть обычный интернет"
|
||||
|
||||
msgid "Restoring native direct internet (stopping Tachyon)..."
|
||||
msgstr "Восстановление прямого интернета (остановка Tachyon)..."
|
||||
|
||||
msgid "Restoring native direct internet..."
|
||||
msgstr "Восстановление прямого интернета..."
|
||||
|
||||
msgid "Native internet restored. Tachyon stopped."
|
||||
msgstr "Обычный интернет восстановлен. Tachyon остановлен."
|
||||
|
||||
msgid "Failed to restore native internet"
|
||||
msgstr "Не удалось восстановить прямой интернет"
|
||||
|
||||
msgid "This action will stop Tachyon, restore standard dnsmasq/DNS, remove all proxy/anti-censorship firewall rules and restore direct Internet connection through your ISP."
|
||||
msgstr "Это действие остановит Tachyon, восстановит стандартный dnsmasq/DNS, удалит все правила файрвола и вернет прямое подключение к интернету через вашего провайдера."
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user