diff --git a/apps/web/src/api/buster_rest/healthcheck/queryRequests.ts b/apps/web/src/api/buster_rest/healthcheck/queryRequests.ts index 92d494f5e..0c368bb34 100644 --- a/apps/web/src/api/buster_rest/healthcheck/queryRequests.ts +++ b/apps/web/src/api/buster_rest/healthcheck/queryRequests.ts @@ -3,7 +3,7 @@ import { getHealthcheck } from './requests'; export const useHealthcheck = () => { return useQuery({ - queryKey: ['healthcheck'], + queryKey: ['healthcheck'] as const, queryFn: getHealthcheck, refetchInterval: 1000 * 30, // 30 seconds }); diff --git a/apps/web/src/api/createAxiosInstance.ts b/apps/web/src/api/createAxiosInstance.ts index e3d69827f..ffaec40b1 100644 --- a/apps/web/src/api/createAxiosInstance.ts +++ b/apps/web/src/api/createAxiosInstance.ts @@ -3,7 +3,6 @@ import type { AxiosRequestHeaders } from 'axios'; import axios, { type AxiosError, type InternalAxiosRequestConfig } from 'axios'; import qs from 'qs'; import { getSupabaseSession } from '@/integrations/supabase/getSupabaseUserClient'; -import { Route as AuthRoute } from '@/routes/auth.login'; import { BASE_URL_V2 } from './config'; import { rustErrorHandler } from './errors'; @@ -50,7 +49,7 @@ export const defaultAxiosRequestHandler = async (config: InternalAxiosRequestCon const { accessToken: token } = session; if (!token) { - console.warn('No token found', config); + console.warn('No token found', config.url, session); //embed route were having an issue with this... //window.location.href = AuthRoute.to; //return Promise.reject(new Error('No token found')); diff --git a/apps/web/src/routes/healthcheck.tsx b/apps/web/src/routes/healthcheck.tsx index 5816b9a3a..761e94609 100644 --- a/apps/web/src/routes/healthcheck.tsx +++ b/apps/web/src/routes/healthcheck.tsx @@ -9,7 +9,6 @@ import { Card, CardContent, CardDescription, - CardFooter, CardHeader, CardTitle, } from '@/components/ui/card/CardBase'; @@ -61,7 +60,7 @@ function RouteComponent() { function LoadingState() { return ( -
+
@@ -76,7 +75,7 @@ function LoadingState() { function ErrorState({ error }: { error: Error | RustApiError }) { return ( -
+
@@ -206,8 +205,8 @@ function HealthcheckDashboard({ }; return ( -
-
+
+
{/* Header */}
@@ -274,10 +273,16 @@ function HealthcheckDashboard({ -
-
-                  {JSON.stringify(user, null, 2)}
-                
+
+ {user ? ( +
+                    {JSON.stringify(user, null, 2)}
+                  
+ ) : ( + + No user data available + + )}
@@ -473,6 +478,11 @@ function HealthcheckDashboard({
+ {check.responseTime && ( + + {check.responseTime}ms + + )} {check.status} - {check.responseTime && ( - - {check.responseTime}ms - - )}
@@ -494,9 +499,9 @@ function HealthcheckDashboard({ {/* Footer */} -
+
- System health is monitored continuously. Data refreshes automatically. + System health is monitored continuously. Data refreshes about every 30 seconds.