fix: align frontend interfaces with backend DTO field names

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-17 16:36:11 +01:00
parent 329e4b0b16
commit 038b663b8c
7 changed files with 153 additions and 168 deletions

View File

@@ -6,26 +6,29 @@ export interface DatabaseStatus {
version: string;
host: string;
schema: string;
timescaleDb: boolean;
}
export interface PoolStats {
activeConnections: number;
idleConnections: number;
pendingConnections: number;
maxConnections: number;
maxWaitMillis: number;
pendingThreads: number;
maxPoolSize: number;
maxWaitMs: number;
}
export interface TableInfo {
tableName: string;
rowEstimate: number;
rowCount: number;
dataSize: string;
indexSize: string;
dataSizeBytes: number;
indexSizeBytes: number;
}
export interface ActiveQuery {
pid: number;
durationMs: number;
durationSeconds: number;
state: string;
query: string;
}
@@ -64,7 +67,7 @@ export function useKillQuery() {
const qc = useQueryClient();
return useMutation({
mutationFn: async (pid: number) => {
await adminFetch<void>(`/database/queries/${pid}`, { method: 'DELETE' });
await adminFetch<void>(`/database/queries/${pid}/kill`, { method: 'POST' });
},
onSuccess: () => qc.invalidateQueries({ queryKey: ['admin', 'database', 'queries'] }),
});