feat(ui): interactive graph, strip context menus, days by activity, message times, limit status words
This commit is contained in:
1 parent
025f2dbc3f
commit
c6401f1114
27 files changed
+1619
-381
No files matched your search
@@ -750,7 +750,25 @@ def build_app( # noqa: PLR0915
|
||||
)
|
||||
gateway = _sum_usage(await _usage_rows(runtime, since, now))
|
||||
gateway["since"] = since.isoformat(timespec="seconds")
|
||||
windows.append({**_limit_public(row), "gateway": gateway})
|
||||
# The API sends a figure only when a window nears its limit;
|
||||
# the last one inside this window is the best lower bound.
|
||||
known = next(
|
||||
(
|
||||
r
|
||||
for r in rows
|
||||
if r.window == window
|
||||
and r.utilization is not None
|
||||
and _aware(r.ts) >= since
|
||||
),
|
||||
None,
|
||||
)
|
||||
windows.append(
|
||||
{
|
||||
**_limit_public(row),
|
||||
"gateway": gateway,
|
||||
"last_known": _limit_public(known) if known else None,
|
||||
}
|
||||
)
|
||||
windows.sort(
|
||||
key=lambda w: (WINDOWS.get(w["window"], timedelta.max), w["window"])
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user