feat(frontend): update sessions page for enhanced health monitoring
- Add new status badges: starting, probing, unhealthy - Show tunnel error only when tunnel_status is unreachable - Show app error badge with status code for error_response - Add collapsible probe output section for diagnostics - Update health polling to check all active instances - Only show Recreate Tunnel button for unreachable tunnels
This commit is contained in:
@@ -25,6 +25,8 @@ export interface Session {
|
||||
project_id: string;
|
||||
status: string;
|
||||
url: string | null;
|
||||
container_status?: string;
|
||||
probe_status?: string;
|
||||
}
|
||||
|
||||
export async function listInstances(
|
||||
@@ -101,11 +103,23 @@ export async function getUserSessions(): Promise<Session[]> {
|
||||
return response.data.sessions;
|
||||
}
|
||||
|
||||
export interface InstanceHealth {
|
||||
healthy: boolean;
|
||||
container_status: string;
|
||||
container_health?: string;
|
||||
container_exit_code?: number | null;
|
||||
tunnel_status: string;
|
||||
tunnel_status_code: number | null;
|
||||
probe_status: string;
|
||||
last_probe_output?: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export async function checkInstanceHealth(
|
||||
projectId: string,
|
||||
repoId: string,
|
||||
instanceId: string
|
||||
): Promise<{ healthy: boolean; status_code: number | null; error?: string }> {
|
||||
): Promise<InstanceHealth> {
|
||||
const response = await apiClient.get(
|
||||
`/projects/${projectId}/repositories/${repoId}/instances/${instanceId}/health`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user