Files
sower/web/tsconfig.json
T
wweir 64a1b55e99 feat(admin): replace polling with Server-Sent Events
The console previously polled /api/traffic, /api/status, and /api/history
every 5-10s. It now subscribes to one SSE stream:

- GET /api/stream (session-cookie auth) pushes status and the traffic
  snapshot every 5s and history every 10s, with an immediate initial
  payload. The connection carries the page's sort/source/client filters
  and revalidates the session on each tick, closing with an auth event
  when it lapses. X-Accel-Buffering is disabled for proxied setups.
- Frontend: lib/live.svelte.ts is a module-level reactive store fed by
  EventSource (auto-reconnects; safe-parse tolerates malformed frames;
  auth event routes to the logout flow). App owns the connection, pages
  consume the store, Traffic re-points the stream on filter changes.
  The pause button and the polling helper are gone.
- tsconfig gains allowImportingTsExtensions for the .svelte.ts store.

Verified: initial + 5s-tick events stream, 401 without session, filter
params apply to the pushed snapshots.
2026-08-06 20:11:10 +08:00

22 lines
536 B
JSON

{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"verbatimModuleSyntax": true,
"allowImportingTsExtensions": true,
"isolatedModules": true,
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"noUncheckedIndexedAccess": true,
"baseUrl": ".",
"paths": {
"$lib": ["./src/lib"],
"$lib/*": ["./src/lib/*"],
"@/*": ["./src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.svelte", "vite.config.ts", "svelte.config.js"]
}