From 69688800546762609d984118090e94761b882901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=85=E8=86=80?= Date: Fri, 23 Oct 2026 23:23:58 +0800 Subject: [PATCH] fix(console): lock route edits and show failures Lock the route editor while saving and show fragment load failures with a retry action rather than presenting a false empty list. --- app/components/RouteEditor.vue | 472 +++++++++++++++++---------------- app/composables/useI18n.ts | 4 + 2 files changed, 252 insertions(+), 224 deletions(-) diff --git a/app/components/RouteEditor.vue b/app/components/RouteEditor.vue index 2f37dc4..333a1bc 100644 --- a/app/components/RouteEditor.vue +++ b/app/components/RouteEditor.vue @@ -77,6 +77,8 @@ const eventSuggestions = computed(() => eventOptions(locale.value)); const { fragments, + loading: fragmentsLoading, + error: fragmentsLoadError, readyFor: fragmentsReadyFor, load: loadFragments, save: saveFragments, @@ -459,250 +461,272 @@ watch(
-
-

{{ t("routeEditor.sectionBasic") }}

-
- - {{ t(tmpl.nameKey) }} - -
-
-
- - -
-
- - -
{{ t("routeEditor.idHint") }}
-
-
-
- -
-

{{ t("routeEditor.sectionOptions") }}

-
-
- -
-
- -

{{ t("routeEditor.fallbackHint") }}

-
-
- -

{{ t("routeEditor.stopHint") }}

-
-
-
- - -
{{ t("routeEditor.discordRolesHint") }}
-
-
- -
-

{{ t("routeEditor.sectionFilters") }}

- -
{{ filterError }}
-
- -
-

{{ t("routeEditor.testMatch") }}

-
- -
-
- -
-
- - {{ testing ? "…" : t("routeEditor.testRun") }} - -
-
- - {{ - testResult.matched ? t("routeEditor.testMatched") : t("routeEditor.testNotMatched") - }} - - {{ testResult.explanation }} -
-
{{ testError }}
-
- -
-

{{ t("routeEditor.fragments") }}

-
- {{ t("routeEditor.fragmentsPresets") }} -
- {{ t(preset.nameKey) }} + +
+
+

{{ t("routeEditor.sectionBasic") }}

+
- {{ t("routeEditor.fragmentsInsert") }} + {{ t(tmpl.nameKey) }}
-
-
-
{{ t("routeEditor.fragmentsEmpty") }}
-
- {{ frag.name }} - - {{ t("routeEditor.fragmentsInsert") }} - - - - +
+
+ + +
+
+ + +
{{ t("routeEditor.idHint") }}
+
-
-
-
- + +
+

{{ t("routeEditor.sectionOptions") }}

+
+
+ +
+
+ +

{{ t("routeEditor.fallbackHint") }}

+
+
+ +

{{ t("routeEditor.stopHint") }}

+
+
+
+ + +
{{ t("routeEditor.discordRolesHint") }}
+
+
+ +
+

{{ t("routeEditor.sectionFilters") }}

+ +
{{ filterError }}
+
+ +
+

{{ t("routeEditor.testMatch") }}

+
+
- - {{ t("routeEditor.fragmentsSave") }} - -
-
{{ fragmentError }}
-
+
+ +
+
+ + {{ testing ? "…" : t("routeEditor.testRun") }} + +
+
+ + {{ + testResult.matched ? t("routeEditor.testMatched") : t("routeEditor.testNotMatched") + }} + + {{ testResult.explanation }} +
+
{{ testError }}
+ -
-

{{ t("routeEditor.sectionTargets") }}

-
-
-
- +

{{ t("routeEditor.fragments") }}

+
+ {{ t("routeEditor.fragmentsPresets") }} +
+ {{ t(preset.nameKey) }} + + {{ t("routeEditor.fragmentsInsert") }} + +
+
+
+ +
+ {{ t("routeEditor.fragmentsLoadFailed", { error: fragmentsLoadError }) }} + + {{ t("routeEditor.fragmentsRetry") }} + +
+
+ {{ t("routeEditor.fragmentsEmpty") }} +
+
+ {{ frag.name }} + + {{ t("routeEditor.fragmentsInsert") }} + + + + +
+
+
+
+
- + {{ t("routeEditor.fragmentsSave") }}
- - -
- - {{ t("routeEditor.addTarget") }} - -
{{ targetError }}
-
+
{{ fragmentError }}
+ -
{{ formError }}
+
+

{{ t("routeEditor.sectionTargets") }}

+
+
+
+ +
+ + + +
+ + +
+ + {{ t("routeEditor.addTarget") }} + +
{{ targetError }}
+
+ +
{{ formError }}
+