From 4acac1276491c051774dc9bbc77fe9c613c086d7 Mon Sep 17 00:00:00 2001 From: Desktop Date: Fri, 14 Nov 2025 23:12:31 +0500 Subject: [PATCH] Revert "Update Status.tsx" This reverts commit af73a786eda711bfd305463875f02caad81fe515. --- frontend/src/pages/Settings/Status.tsx | 43 +++----------------------- 1 file changed, 5 insertions(+), 38 deletions(-) diff --git a/frontend/src/pages/Settings/Status.tsx b/frontend/src/pages/Settings/Status.tsx index 6806782b..ad658edb 100644 --- a/frontend/src/pages/Settings/Status.tsx +++ b/frontend/src/pages/Settings/Status.tsx @@ -275,7 +275,7 @@ export default function Status() { {/* Module Statistics */} - +
{/* Planner Module */}
@@ -359,28 +359,11 @@ function APIMonitoringCard() { const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), 10000); // 10 second timeout - // Get auth token if available (for endpoints that require auth) - const headers: HeadersInit = { - 'Content-Type': 'application/json', - }; - - // Try to get JWT token from localStorage for authenticated endpoints - try { - const authStorage = localStorage.getItem('auth-storage'); - if (authStorage) { - const parsed = JSON.parse(authStorage); - const token = parsed?.state?.token; - if (token) { - headers['Authorization'] = `Bearer ${token}`; - } - } - } catch (e) { - // Ignore errors getting token - } - const response = await fetch(`${API_BASE_URL}${endpoint.endpoint}`, { method: 'GET', - headers, + headers: { + 'Content-Type': 'application/json', + }, credentials: 'include', signal: controller.signal, }); @@ -391,29 +374,13 @@ function APIMonitoringCard() { // Determine status based on response time and status code let status: 'healthy' | 'warning' | 'critical' = 'healthy'; - - // 401/403 for auth endpoints is normal (endpoint works, just needs auth) - const isAuthEndpoint = endpoint.endpoint.includes('/auth/') || - endpoint.endpoint.includes('/me/'); - if (response.status >= 500) { - // Server errors are critical status = 'critical'; - } else if (response.status === 401 || response.status === 403) { - // Auth errors are healthy for auth endpoints (endpoint is working) - // For other endpoints, it's a warning (endpoint works but access denied) - status = isAuthEndpoint ? 'healthy' : 'warning'; - } else if (response.status >= 400) { - // Other 4xx errors are warnings (client errors, but endpoint responds) + } else if (response.status >= 400 || responseTime > 2000) { status = 'warning'; - } else if (responseTime > 2000) { - // Very slow responses are critical - status = 'critical'; } else if (responseTime > 1000) { - // Slow responses are warnings status = 'warning'; } - // Otherwise healthy (200-299, fast response) return { ...endpoint,