Optimize dashboard overview loading
This commit is contained in:
parent
a412998c96
commit
b340489d96
14 changed files with 990 additions and 88 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import uuid
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
|
@ -84,3 +85,51 @@ class StateSummary(BaseModel):
|
|||
contribution_counts: dict[str, int] = {}
|
||||
licence_risk_count: int = 0
|
||||
open_capability_requests: int = 0
|
||||
|
||||
|
||||
class DashboardWorkplanRow(BaseModel):
|
||||
id: uuid.UUID
|
||||
title: str
|
||||
status: str
|
||||
domain: str = "unknown"
|
||||
repo_label: str = "unassigned"
|
||||
workplan_filename: str | None = None
|
||||
workplan_relative_path: str | None = None
|
||||
workplan_archived: bool = False
|
||||
health_labels: list[str] = []
|
||||
href: str
|
||||
done: int = 0
|
||||
progress: int = 0
|
||||
wait: int = 0
|
||||
todo: int = 0
|
||||
total: int = 0
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
class DashboardSourceMeta(BaseModel):
|
||||
ok: bool = True
|
||||
stale: bool = False
|
||||
cache_age_seconds: float | None = None
|
||||
refresh_in_progress: bool = False
|
||||
error: str | None = None
|
||||
|
||||
|
||||
class DashboardOverview(BaseModel):
|
||||
generated_at: datetime
|
||||
totals: Totals
|
||||
topics: list[TopicWithWorkstreams]
|
||||
blocking_decisions: list[DecisionRead]
|
||||
waiting_tasks: list[TaskRead]
|
||||
blocked_tasks: list[TaskRead] = []
|
||||
recent_progress: list[ProgressEventRead]
|
||||
next_steps: list[NextStep] = []
|
||||
contribution_counts: dict[str, int] = {}
|
||||
licence_risk_count: int = 0
|
||||
open_capability_requests: int = 0
|
||||
sbom_snapshot_count: int = 0
|
||||
sbom_package_total: int = 0
|
||||
registration_milestones: list[ProgressEventRead] = []
|
||||
workplan_rows: list[DashboardWorkplanRow] = []
|
||||
sources: dict[str, DashboardSourceMeta] = {}
|
||||
diagnostics: dict[str, Any] = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue