From 65b4bf9679edfa57d7d32e7ebe3a6104bcddd03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 10 May 2026 00:37:02 +0200 Subject: [PATCH] fix(admin): system-status load-failed pairs alert with Retry button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When `/api/admin/status` 500s (rolling deploy, transient DB blip), the section's error state previously rendered a static "refresh the page" message — forcing a full reload + cookie revalidation just to recover from a 5-second hiccup. Pairing the alert with an inline Retry button (`refetch()` from React Query) lets the admin recover in-place without losing scroll position or any other open admin tab. The button is `min-h-9` desktop-tight (this is admin, not mobile- critical), shows a spinner while `isFetching`, and disables itself during the request. The German + English message strings drop the "refresh the page" tail since the button now does that work. --- messages/de.json | 3 ++- messages/en.json | 3 ++- .../admin/system-status-section.tsx | 27 ++++++++++++++++--- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/messages/de.json b/messages/de.json index 304174e73..fdfd90c37 100644 --- a/messages/de.json +++ b/messages/de.json @@ -1436,7 +1436,8 @@ "activeTokens": "Aktive API-Tokens", "activeSessions": "Aktive Sessions", "loadingStatus": "Lade Status...", - "systemStatusLoadError": "System-Status konnte nicht geladen werden. Bitte die Seite neu laden.", + "systemStatusLoadError": "System-Status konnte nicht geladen werden.", + "systemStatusRetry": "Erneut versuchen", "adminSettingsLoadError": "Admin-Einstellungen konnten nicht geladen werden. Schalter unten zeigen evtl. nicht den Live-Zustand — Seite neu laden.", "hostMetrics": { "title": "Host-Auslastung", diff --git a/messages/en.json b/messages/en.json index a91159b0d..cd6869721 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1436,7 +1436,8 @@ "activeTokens": "Active API Tokens", "activeSessions": "Active Sessions", "loadingStatus": "Loading status...", - "systemStatusLoadError": "Failed to load system status. Try refreshing the page.", + "systemStatusLoadError": "Failed to load system status.", + "systemStatusRetry": "Retry", "adminSettingsLoadError": "Failed to load admin settings. Toggles below may not reflect the live state — refresh the page.", "hostMetrics": { "title": "Host load", diff --git a/src/components/admin/system-status-section.tsx b/src/components/admin/system-status-section.tsx index a88e6721a..817a75fa0 100644 --- a/src/components/admin/system-status-section.tsx +++ b/src/components/admin/system-status-section.tsx @@ -13,9 +13,11 @@ import { Globe, Key, Loader2, + RotateCw, Server, Users, } from "lucide-react"; +import { Button } from "@/components/ui/button"; import { formatDateTime } from "@/lib/format"; import { useFormatters, useTranslations } from "@/lib/i18n/context"; import { StatusItem, useSystemStatus } from "./_shared"; @@ -41,7 +43,7 @@ const HostMetricsChart = dynamic( export function SystemStatusSection() { const { t } = useTranslations(); const fmt = useFormatters(); - const { data: status, isError } = useSystemStatus(); + const { data: status, isError, refetch, isFetching } = useSystemStatus(); return (
@@ -164,11 +166,30 @@ export function SystemStatusSection() { // P19: surface load failures inline instead of leaving the // section spinning forever. The hook throws on non-OK // responses, so isError is true on 500s, network errors, etc. + // v1.4.16 Wave-C MED — pair the alert with a Retry button so a + // transient 500 (rolling deploy, DB blip) doesn't require a + // full page reload to recover.
- {t("admin.systemStatusLoadError")} + {t("admin.systemStatusLoadError")} +
) : (