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:
@@ -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'] }),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user