From 945a8a8c9736cd8a0310cfdd99503cfa58be6ea9 Mon Sep 17 00:00:00 2001 From: Zakk Date: Fri, 18 Sep 2026 01:41:28 +1000 Subject: [PATCH] fix(gui): guard runtime errors and follow the active locale in more places - Latency test: a network error left the selected rows on "testing..." forever; reset them in .catch. - Relative times only knew zh and en from localStorage; use the vue-i18n locale and load the dayjs locales for fa, ru, pt and ko. - i18n: an unknown stored _lang silently fell back to English; ignore it and detect from the browser. Set to the chosen locale. - networkInspect polled err.response.status on plain network errors (TypeError every 3 s); the GFW list update spinner never closed on a rejected request; the routing dialog threw in render when a saved rule named a .dat file that no longer exists. - axios: the "https frontend talking to http backend" branch fired for every error on HTTPS deployments because parseURL fabricates http:// for a relative apiRoot; require an absolute http:// backend URL, and do not dereference the parsed URL when err.config is absent. - The status tag is focusable and announced as a button but only reacted to clicks; Enter and Space now activate it. --- gui/src/App.vue | 3 ++- gui/src/assets/js/networkInspect.js | 2 +- gui/src/components/modalCustomRouting.vue | 13 +++++++------ gui/src/components/modalUpdateGfwList.vue | 2 ++ gui/src/node.vue | 17 ++++++++++------- gui/src/plugins/axios.js | 11 ++++++++--- gui/src/plugins/dayjs.js | 4 ++++ gui/src/plugins/i18n.js | 3 ++- 8 files changed, 36 insertions(+), 19 deletions(-) diff --git a/gui/src/App.vue b/gui/src/App.vue index b1a7e2bd..cc3ded86 100644 --- a/gui/src/App.vue +++ b/gui/src/App.vue @@ -8,7 +8,8 @@ {{ coverStatusText ? coverStatusText : runningState.running }} + @click.native="handleClickStatus" @keydown.native.enter.prevent="handleClickStatus" + @keydown.native.space.prevent="handleClickStatus">{{ coverStatusText ? coverStatusText : runningState.running }} diff --git a/gui/src/assets/js/networkInspect.js b/gui/src/assets/js/networkInspect.js index a5029a6c..a191bd19 100644 --- a/gui/src/assets/js/networkInspect.js +++ b/gui/src/assets/js/networkInspect.js @@ -36,7 +36,7 @@ function waitingConnected(promise, interval, cancel, timeout) { ); }) .catch((err) => { - if (err.response.status === 401) { + if (err && err.response && err.response.status === 401) { clearInterval(timer); cancel && cancel(); } diff --git a/gui/src/components/modalCustomRouting.vue b/gui/src/components/modalCustomRouting.vue index 73d2936c..a4314281 100644 --- a/gui/src/components/modalCustomRouting.vue +++ b/gui/src/components/modalCustomRouting.vue @@ -104,16 +104,12 @@