Fix status filter OR logic and add P99/active stats endpoint
Status filter now parses comma-separated values into SQL IN clause instead of exact match, so filtering by multiple statuses works. Added GET /api/v1/search/stats returning P99 latency (last hour) and active execution count, wired into the UI stat cards with 10s polling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,18 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import { api } from '../client';
|
||||
import type { SearchRequest } from '../schema';
|
||||
|
||||
export function useExecutionStats() {
|
||||
return useQuery({
|
||||
queryKey: ['executions', 'stats'],
|
||||
queryFn: async () => {
|
||||
const { data, error } = await api.GET('/search/stats');
|
||||
if (error) throw new Error('Failed to load stats');
|
||||
return data!;
|
||||
},
|
||||
refetchInterval: 10_000,
|
||||
});
|
||||
}
|
||||
|
||||
export function useSearchExecutions(filters: SearchRequest) {
|
||||
return useQuery({
|
||||
queryKey: ['executions', 'search', filters],
|
||||
|
||||
Reference in New Issue
Block a user