From 97189dc7891353dcaca92f7560f2acacce131dc6 Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 3 Aug 2025 12:29:11 +0200 Subject: [PATCH] Config UI: allow repairing broken loadpoints and site (#22671) --- assets/js/components/Auth/auth.ts | 2 +- .../js/components/Config/LoadpointModal.vue | 4 +- .../Footer/OfflineIndicator.stories.ts | 8 +- .../js/components/Footer/OfflineIndicator.vue | 18 +- assets/js/components/Site/Site.vue | 11 +- assets/js/components/Top/Navigation.vue | 4 +- assets/js/types/evcc.ts | 7 +- assets/js/utils/fatal.ts | 12 +- assets/js/views/Config.vue | 42 ++--- cmd/helper.go | 12 ++ cmd/root.go | 8 +- cmd/setup.go | 52 +++--- cmd/setup_circuits_test.go | 10 +- core/circuit/circuit.go | 10 +- core/loadpoint.go | 13 ++ core/site.go | 4 + server/http_config_device_handler.go | 15 +- server/http_config_loadpoint_handler.go | 28 +++- tests/config-fatals.spec.ts | 157 ++++++++++++++++++ tests/config-loadpoint.spec.ts | 88 ++-------- tests/config-pv.spec.ts | 41 ----- tests/utils.ts | 63 +++++++ 22 files changed, 412 insertions(+), 197 deletions(-) create mode 100644 tests/config-fatals.spec.ts diff --git a/assets/js/components/Auth/auth.ts b/assets/js/components/Auth/auth.ts index 074f3968c..b23f64171 100644 --- a/assets/js/components/Auth/auth.ts +++ b/assets/js/components/Auth/auth.ts @@ -13,7 +13,7 @@ const auth = reactive({ }); export async function updateAuthStatus() { - if (store.state.offline || isSystemError(store.state.fatal)) { + if (store.state.offline || isSystemError(store.state.fatal ?? [])) { // system not ready, skip auth check return; } diff --git a/assets/js/components/Config/LoadpointModal.vue b/assets/js/components/Config/LoadpointModal.vue index 2ec5b6819..1b8201fa9 100644 --- a/assets/js/components/Config/LoadpointModal.vue +++ b/assets/js/components/Config/LoadpointModal.vue @@ -53,7 +53,7 @@ class="me-2 flex-grow-1" readonly required - :invalid="!charger" + :invalid="!charger || hasDeviceError('charger', values.charger)" @click.prevent="editCharger" />