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:
+3
-1
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user