web: Show host name in live-stats error messages (#170)

Error rows now include the host name (e.g., "nuc: Connection refused")
and have proper id/data-host attributes so they get replaced in place
instead of accumulating on each refresh interval.
This commit is contained in:
Bas Nijholt
2026-01-18 21:08:39 +01:00
committed by GitHub
parent 9c72e0937a
commit 0f84864a06

View File

@@ -268,7 +268,8 @@ async def get_containers_rows_by_host(host_name: str) -> HTMLResponse:
error,
)
return HTMLResponse(
f'<tr class="text-error"><td colspan="12" class="text-center py-2">Error: {error}</td></tr>'
f'<tr id="error-{host_name}" class="text-error" data-host="{host_name}">'
f'<td colspan="12" class="text-center py-2">{host_name}: {error}</td></tr>'
)
if not containers: