From 0f7b5206b65f4b2a6486bcbb259c52834a065773 Mon Sep 17 00:00:00 2001 From: nick Date: Mon, 8 Jun 2026 08:09:33 -0600 Subject: [PATCH] webui: clarify API connection badge --- .../esp32/overland-controller/overland-controller.ino | 6 +++--- tests/test_http_api_contract.py | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/firmware/esp32/overland-controller/overland-controller.ino b/firmware/esp32/overland-controller/overland-controller.ino index f973ef7..252196e 100644 --- a/firmware/esp32/overland-controller/overland-controller.ino +++ b/firmware/esp32/overland-controller/overland-controller.ino @@ -107,7 +107,7 @@ input{width:100%;border:1px solid var(--line);border-radius:12px;padding:12px;ba
-
Connecting...
+
API Connecting...
@@ -579,7 +579,7 @@ async function relay(id,on){ function render(data){ data=mergeStatus(window.lastStatus,data); window.lastStatus=data; - $("conn").textContent="Live"; + $("conn").textContent="API Live"; $("conn").className="pill good"; $("device").textContent=data.config?.device_name||"Overland Controller"; renderWeatherBadge(data); @@ -915,7 +915,7 @@ async function load(){ const r=await fetch(statusUrl(),{cache:"no-store"}); render(await r.json()); }catch(e){ - $("conn").textContent="Offline"; + $("conn").textContent="API Error"; $("conn").className="pill bad"; } } diff --git a/tests/test_http_api_contract.py b/tests/test_http_api_contract.py index 2418bf9..062196f 100644 --- a/tests/test_http_api_contract.py +++ b/tests/test_http_api_contract.py @@ -366,3 +366,12 @@ def test_embedded_webui_config_subtabs(): assert "config-maintenance" in source assert "WiFi / AP" in source assert "Maintenance" in source + + +def test_embedded_webui_api_badge_labels_are_clear(): + source = firmware_source() + + assert "API Connecting..." in source + assert "API Live" in source + assert "API Error" in source + assert 'textContent="Offline"' not in source