feat(client/stats): 两周流量折线图加 Y轴刻度 + X轴日期 + 14个数据点
ci-pangolin / Lint — shellcheck (push) Successful in 9s
ci-pangolin / OpenAPI Sync Check (push) Successful in 16s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Successful in 5s
ci-pangolin / Flutter — analyze + test (push) Successful in 22s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (push) Successful in 5s
ci-pangolin / Codegen Drift — token 生成物未漂移 (push) Successful in 5s
ci-pangolin / Go — build + test (push) Successful in 8s
ci-pangolin / E2E Smoke — L4 进程级端到端 (push) Successful in 14s
ci-pangolin / Go — integration (mysql/redis testcontainers) (push) Successful in 4m18s
ci-pangolin / Golden — 视觉回归 (components + auth) (push) Successful in 13s
ci-pangolin / Lint — shellcheck (push) Successful in 9s
ci-pangolin / OpenAPI Sync Check (push) Successful in 16s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Successful in 5s
ci-pangolin / Flutter — analyze + test (push) Successful in 22s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (push) Successful in 5s
ci-pangolin / Codegen Drift — token 生成物未漂移 (push) Successful in 5s
ci-pangolin / Go — build + test (push) Successful in 8s
ci-pangolin / E2E Smoke — L4 进程级端到端 (push) Successful in 14s
ci-pangolin / Go — integration (mysql/redis testcontainers) (push) Successful in 4m18s
ci-pangolin / Golden — 视觉回归 (components + auth) (push) Successful in 13s
之前折线太简单(只一条线+末点)。增强 UsageLineChart: - Y 轴:3 条网格 + 左侧 GB 刻度(max/mid/0) - X 轴:隔几天标一个日期(M/D,始终含末点) - 14 个数据点全画出(surface 光晕+accent 实心,末点加大) 传入每点日期(chartDates)。token 色经参数传入(axis=fg3/surface),零硬编码。 统计页 golden 重生成。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -44,10 +44,10 @@ class StatsPage extends ConsumerWidget {
|
||||
];
|
||||
}
|
||||
|
||||
// 折线:最后 14 天每日总流量(GB)。
|
||||
final chart = <double>[
|
||||
for (var i = usage.length > 14 ? usage.length - 14 : 0; i < usage.length; i++) usage[i].gbTotal,
|
||||
];
|
||||
// 折线:最后 14 天每日总流量(GB) + 对应日期(X 轴标注)。
|
||||
final chartPts = usage.length > 14 ? usage.sublist(usage.length - 14) : usage;
|
||||
final chartVals = chartPts.map((p) => p.gbTotal).toList();
|
||||
final chartDates = chartPts.map((p) => p.date).toList();
|
||||
|
||||
final body = RefreshIndicator(
|
||||
color: c.accent,
|
||||
@@ -92,7 +92,14 @@ class StatsPage extends ConsumerWidget {
|
||||
Text('GB', style: PangolinText.mono.copyWith(color: c.fg3, fontSize: 11)),
|
||||
]),
|
||||
const SizedBox(height: 10),
|
||||
UsageLineChart(values: chart, accent: c.accent, grid: c.border),
|
||||
UsageLineChart(
|
||||
values: chartVals,
|
||||
dates: chartDates,
|
||||
accent: c.accent,
|
||||
grid: c.border,
|
||||
axis: c.fg3,
|
||||
surface: c.surface,
|
||||
),
|
||||
]),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user