feat(stats): optimize dashboard data loading with internal ui endpoints
This commit is contained in:
50
README.md
50
README.md
@@ -32,6 +32,7 @@ The service exposes a clean HTTP API, provides workflow metrics, persists state
|
||||
- CSV export with injection protection
|
||||
- Persistent storage (`data/tasks.json`)
|
||||
- HTML dashboard (`/stats`)
|
||||
- Lightweight dashboard data loading via internal `/ui_data/*` routes
|
||||
- Atomic file writes with corruption recovery
|
||||
|
||||
---
|
||||
@@ -194,6 +195,8 @@ HTML page:
|
||||
- Top block:
|
||||
- Selected task details:
|
||||
- Title
|
||||
- Status
|
||||
- Created datetime
|
||||
- Start datetime
|
||||
- Done datetime
|
||||
- Cycle time
|
||||
@@ -204,6 +207,53 @@ HTML page:
|
||||
- In Progress
|
||||
- Done
|
||||
|
||||
Implementation notes:
|
||||
|
||||
- `/stats` returns a lightweight HTML shell
|
||||
- Task lists are loaded separately from an internal UI endpoint
|
||||
- Selected task details are loaded on demand when a card is selected
|
||||
- Full task payloads are not embedded into the HTML for every card
|
||||
|
||||
### Internal UI Data Routes
|
||||
|
||||
These routes are used only by the HTML dashboard and are intentionally hidden from Swagger / OpenAPI.
|
||||
|
||||
#### Board data
|
||||
|
||||
```
|
||||
GET /ui_data/stats/board
|
||||
```
|
||||
|
||||
Returns lightweight task list items grouped by status:
|
||||
|
||||
- `backlog_tasks`
|
||||
- `in_progress_tasks`
|
||||
- `done_tasks`
|
||||
|
||||
Each list item contains only:
|
||||
|
||||
- `id`
|
||||
- `title`
|
||||
- `status`
|
||||
- `display_date_label`
|
||||
- `display_date_value`
|
||||
|
||||
#### Task details
|
||||
|
||||
```
|
||||
GET /ui_data/tasks/{id}
|
||||
```
|
||||
|
||||
Returns the full details needed for the selected-task panel:
|
||||
|
||||
- `id`
|
||||
- `title`
|
||||
- `status`
|
||||
- `created_at`
|
||||
- `started_at`
|
||||
- `done_at`
|
||||
- `cycle_time`
|
||||
|
||||
---
|
||||
|
||||
## Error Format
|
||||
|
||||
Reference in New Issue
Block a user