mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-17 00:16:46 +00:00
REST API & CRUD: - Add REST API routes for profiles, cliproxy, accounts - Integrate React Query with data fetching hooks - Create API client wrapper with TypeScript types - Add shadcn/ui components (dialog, input, label, table) - Build profiles table with edit/delete actions - Create profile form dialog with zod validation - Mount QueryClientProvider in App Real-time Sync & WebSocket: - Implement file watcher with chokidar for config changes - Create WebSocket server with broadcast capability - Add client auto-reconnect with exponential backoff - Integrate React Query cache invalidation on WS messages - Add connection status indicator in header - Implement heartbeat keepalive (30s interval) - Add graceful cleanup on server shutdown - Show toast notifications for external config changes Dependencies: - Add @tanstack/react-query, react-table, react-hook-form, zod - Add chokidar for file watching
19 lines
348 B
TypeScript
19 lines
348 B
TypeScript
import { QueryClient } from '@tanstack/react-query';
|
|
|
|
/**
|
|
* React Query client configuration
|
|
* Phase 03: REST API Routes & CRUD
|
|
*/
|
|
export const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
staleTime: 5000,
|
|
refetchOnWindowFocus: false,
|
|
retry: 1,
|
|
},
|
|
mutations: {
|
|
retry: false,
|
|
},
|
|
},
|
|
});
|