feat: global Docker health indicator and graceful degradation

- GET /api/health endpoint returning Docker connectivity status
- Sidebar shows Docker connection dot (green=connected, red=disconnected)
- Stale scanner returns store-only results when Docker is unavailable
- Polls health every 30s
This commit is contained in:
2026-03-30 13:43:33 +03:00
parent b57b164be0
commit 37cfa090ac
15 changed files with 317 additions and 277 deletions
+3 -1
View File
@@ -5,6 +5,8 @@
* event streams (deploy logs and instance status changes).
*/
import { getAuthToken } from './auth';
// ── Types ──────────────────────────────────────────────────────────
export type SSEEventType = 'deploy_log' | 'instance_status' | 'deploy_status' | 'event_log';
@@ -97,7 +99,7 @@ export function connectSSE(url: string, options: SSEOptions): SSEConnection {
if (closed) return;
// Append auth token as query param (EventSource doesn't support custom headers).
const token = typeof localStorage !== 'undefined' ? localStorage.getItem('auth_token') : null;
const token = getAuthToken();
const authUrl = token ? `${url}${url.includes('?') ? '&' : '?'}token=${encodeURIComponent(token)}` : url;
eventSource = new EventSource(authUrl);