refactor(runtimes): split monolithic page, add zustand store, time range selector, and delete support

- Split 1189-line runtimes-page.tsx into focused sub-components (list, detail, ping, usage, 5 chart files, shared UI, utils)
- Add useRuntimeStore zustand store for shared runtime state across pages (agents page now uses it too)
- Add 7d/30d/90d time range selector to usage charts
- Add full-stack runtime delete: SQL query, Go handler, API route, frontend with confirmation dialog
- Remove unused daemon:heartbeat WS listener (server never broadcasts it)
This commit is contained in:
Jiayuan 2026-03-29 17:02:25 +08:00
parent 42f72371bd
commit ceba8556f5
21 changed files with 1398 additions and 1138 deletions

View file

@ -283,6 +283,10 @@ export class ApiClient {
return this.fetch(`/api/runtimes/${runtimeId}/activity`);
}
async deleteRuntime(runtimeId: string): Promise<void> {
await this.fetch(`/api/runtimes/${runtimeId}`, { method: "DELETE" });
}
async pingRuntime(runtimeId: string): Promise<RuntimePing> {
return this.fetch(`/api/runtimes/${runtimeId}/ping`, { method: "POST" });
}