feat: show update service status in UI

This commit is contained in:
2026-01-15 11:06:54 +01:00
parent 55e452b6a2
commit f513d46d08
22 changed files with 351 additions and 2 deletions

View File

@ -220,3 +220,35 @@ def get_logs(settings: Settings, limit: int = 200) -> List[Dict[str, Any]]:
except json.JSONDecodeError:
continue
return entries
def get_service_status(settings: Settings) -> Dict[str, Any]:
base_url = settings.update_service_url.rstrip("/")
if not base_url:
return {
"url": "",
"reachable": False,
"status_code": None,
"error": "update service url not configured",
"checked_url": "",
}
check_url = base_url
try:
with httpx.Client(timeout=3.0) as client:
response = client.get(check_url)
return {
"url": base_url,
"reachable": True,
"status_code": response.status_code,
"error": None,
"checked_url": check_url,
}
except Exception as exc:
return {
"url": base_url,
"reachable": False,
"status_code": None,
"error": str(exc),
"checked_url": check_url,
}