feat: show error keys and relative ages

This commit is contained in:
2026-07-27 04:12:27 +08:00
parent 082c8f22fe
commit 0c7e437b7b
5 changed files with 65 additions and 24 deletions
+7 -5
View File
@@ -92,8 +92,8 @@ horizontal scrolling:
```text
ACCOUNT | Group | Today | Daily | 5h | 7d | Avail
KEY | Today | Tokens | Req
LOG KEY | Account | Model | Cost | Latency | Time
ERR | Status | Account | Model | Phase | Type | Time
LOG KEY | Account | Model | Cost | Latency | Time | Age
ERR | Status | Key | Account | Model | Time | Age
```
The Keys table shows today's usage sorted by actual cost, including key name,
@@ -114,7 +114,7 @@ Sub2API admin usage API and refreshes every 60 seconds by default
(`--logs-refresh-seconds` / `SHUSUB2_LOGS_REFRESH_SECONDS`). Columns:
```text
Key | Account | Model | Effort | Type | Tokens | Cost | First | Latency | Tok/s | Time
Key | Account | Model | Effort | Type | Tokens | Cost | First | Latency | Tok/s | Time | Age
```
`Type` is the Sub2API `request_type` (`sync` / `stream` / `ws_v2` / `cyber`).
@@ -126,7 +126,8 @@ decode speed, upstream model mapping, user, and request id.
first-token latency and `Latency` the total duration, both shown in seconds.
`Tok/s` is the decode throughput computed as
`output_tokens / (latency - first_token)`; it shows
`-` when there is no output or no positive decode window. In the TUI each
`-` when there is no output or no positive decode window. `Age` is relative to
local current time (`now`, `5m ago`, `2h ago`, etc.). In the TUI each
API key name is rendered in a stable per-key color so rows from the same
key are easy to group visually (`--once --logs` output stays plain text).
@@ -172,9 +173,10 @@ defaults to `24h` (`--errors-time-range` / `SHUSUB2_ERRORS_TIME_RANGE`); each so
Columns:
```text
Node | Status | Key | Account | Model | Phase | Type | Owner | Time
Node | Status | Key | Account | Model | Phase | Type | Owner | Time | Age
```
`Age` is relative to local current time (`now`, `5m ago`, `2h ago`, etc.).
Auth reuses the same admin API key as the logs page.
## Local Development