{item.description}
-{item.message}
-diff --git a/frontend/src/pages/AlertsPage.jsx b/frontend/src/pages/AlertsPage.jsx index cb6ceaa..2d96407 100644 --- a/frontend/src/pages/AlertsPage.jsx +++ b/frontend/src/pages/AlertsPage.jsx @@ -19,12 +19,18 @@ function formatAlertValue(value) { return Number(value).toFixed(2); } +function formatTs(ts) { + if (!ts) return "-"; + return new Date(ts).toLocaleString(); +} + export function AlertsPage() { const { tokens, refresh, me } = useAuth(); const [targets, setTargets] = useState([]); const [status, setStatus] = useState({ warnings: [], alerts: [], warning_count: 0, alert_count: 0 }); const [definitions, setDefinitions] = useState([]); const [form, setForm] = useState(initialForm); + const [expandedKey, setExpandedKey] = useState(""); const [error, setError] = useState(""); const [loading, setLoading] = useState(true); const [testing, setTesting] = useState(false); @@ -160,6 +166,10 @@ export function AlertsPage() { } }; + const toggleExpanded = (key) => { + setExpandedKey((prev) => (prev === key ? "" : key)); + }; + if (loading) return
{item.description}
-{item.message}
-{item.description}
+{item.message}
+ {isOpen && ( +{item.sql_text}No warning-level alerts right now.
@@ -205,17 +237,39 @@ export function AlertsPage() {{item.description}
-{item.message}
-{item.description}
+{item.message}
+ {isOpen && ( +{item.sql_text}No critical alerts right now.
@@ -225,9 +279,14 @@ export function AlertsPage() { {canManageAlerts && ( <> -Admins and operators can add SQL-based checks with warning and alert thresholds.
+Admins and operators can add SQL-based checks with warning and alert thresholds.
+