diff --git a/monitoring_ui/src/App.jsx b/monitoring_ui/src/App.jsx index eafb72a..88f7f8a 100644 --- a/monitoring_ui/src/App.jsx +++ b/monitoring_ui/src/App.jsx @@ -4,26 +4,10 @@ const runtime = typeof window !== "undefined" && window.__ENV__ ? window.__ENV__ : {}; const configured = { - auth: - runtime.AUTH_API || - import.meta.env.VITE_AUTH_API || - "http://localhost:5000", - employee: - runtime.EMPLOYEE_API || - import.meta.env.VITE_EMPLOYEE_API || - "http://localhost:4000", - transit: - runtime.TRANSIT_API || - import.meta.env.VITE_TRANSIT_API || - "http://localhost:5001", - errors: - runtime.ERROR_LOG_API || - import.meta.env.VITE_ERROR_LOG_API || - "http://localhost:5003", - admin: - runtime.ADMIN_UI || - import.meta.env.VITE_ADMIN_UI || - "http://localhost:5174", + auth: runtime.AUTH_API || import.meta.env.VITE_AUTH_API || "", + employee: runtime.EMPLOYEE_API || import.meta.env.VITE_EMPLOYEE_API || "", + transit: runtime.TRANSIT_API || import.meta.env.VITE_TRANSIT_API || "", + errors: runtime.ERROR_LOG_API || import.meta.env.VITE_ERROR_LOG_API || "", }; const serviceMeta = { @@ -60,13 +44,6 @@ const serviceMeta = { data: "Centralized bad requests and service errors", routes: ["/health", "/error_log?limit=100"], }, - admin: { - label: "Admin UI", - role: "Operator surface", - color: "violet", - data: "The deployed React administration console", - routes: ["/health"], - }, }; const healthPaths = { @@ -74,7 +51,6 @@ const healthPaths = { employee: "/health", transit: "/health", errors: "/health", - admin: "/health", }; const testerRoutes = [ { service: "auth", method: "GET", path: "/me", label: "Current session" }, @@ -146,9 +122,19 @@ function App() { const checkService = useCallback( async (key) => { const started = performance.now(); + const url = urls[key]; + if (!url) { + return { + ok: false, + status: 0, + body: { error: "No URL configured" }, + latency: 0, + checkedAt: new Date().toISOString(), + }; + } const headers = token ? { Authorization: `Bearer ${token}` } : {}; try { - const response = await fetch(`${urls[key]}${healthPaths[key]}`, { + const response = await fetch(`${url}${healthPaths[key]}`, { headers, }); const body = await response.json().catch(() => null);