From 8d97be9f9ac958fd376eb9a53ced200a2384c1f5 Mon Sep 17 00:00:00 2001 From: argszero Date: Fri, 11 Sep 2026 17:47:11 +0800 Subject: [PATCH] feat(ui): redesign dashboard/marketplace/sharing views on the landed component layer Adapt the dashboard, model-market and sharing views to the new prototype (rant 2026-09-11T16:23:43, PR 4 of 6). Pure front-end; no API contract change. Dashboard: add the page-head breadcrumb + "call a model" action, move the sharings mini-list into its own card with a "manage sharing" ghost button, and add the new 14-day consumption-vs-earnings two-colour bar chart fed by the real /api/transactions/trend endpoint (same income/expense semantics as the transactions view, which was reused instead of the 7-day /api/dashboard series so both pages agree). The backend aggregates with GROUP BY, so days without transactions come back as missing rows, not zero rows. A fixed 14-column chart would then shift bars left and mislabel the axis, so the renderer now densifies the window to DASH_TREND_DAYS (empty days render as 0-height columns) and the request start is anchored to UTC midnight to line up with the backend's UTC day buckets. Marketplace: toolbar gain an availability filter (all / available only) and a count aligned right; the provider and model columns merge into one .provider-cell (status dot + provider + model name), a capability column renders only real backend fields (vision tag; peak-pricing tag for models with peak rates), and the availability column becomes a three-state pill carrying the real key count (>=2 available / ==1 tight / 0 no key, with "use" disabled when no key). New mk.avail.* / mk.col.caps / mk.cap.* keys; the now-unused mk.col.provider, mk.col.model, mk.avail and mk.busy entries were dropped from both languages. Sharing: move "list a new key" into the page-head as a primary action with the form as a sibling card, add the availability time-window column (real available_days / available_start / available_end), and render used/quota as a progress bar next to the numbers. share.col.time is dropped in favour of share.col.avail in both languages. Also define .mt16/.mb16, which the new layout uses but the stylesheet never declared. i18n stays complete: ZH/EN dictionaries are in exact parity and every data-i18n attribute plus every T() call in app.js resolves. --- ui/css/style.css | 5 ++ ui/index.html | 91 +++++++++++++++++++++++--------- ui/js/app.js | 135 ++++++++++++++++++++++++++++++++++++++++++----- ui/js/i18n.js | 64 +++++++++++++++++----- 4 files changed, 244 insertions(+), 51 deletions(-) diff --git a/ui/css/style.css b/ui/css/style.css index 6c2a8ba..19c8045 100644 --- a/ui/css/style.css +++ b/ui/css/style.css @@ -1108,6 +1108,11 @@ table.dt td.num, table.dt th.num { text-align: right; font-family: var(--mono); /* .search 的原型定位规则见上方「搜索增强」(线上既有实现即原型形态) */ .toolbar .grow { flex: 1; } +/* ---- 间距工具类(原型 .mt16/.mb16:视图内卡片纵向节奏;rant 2026-09-11T16:23:43 + 第 3/5 节新布局用到,此前标记在用但样式表未定义) ---- */ +.mt16 { margin-top: 16px; } +.mb16 { margin-bottom: 16px; } + /* ---- 表单 ---- */ /* label.f:原型表单标签(纵向 label + 说明文字) */ .form label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-dim); } diff --git a/ui/index.html b/ui/index.html index 263a24e..1d960eb 100644 --- a/ui/index.html +++ b/ui/index.html @@ -168,27 +168,54 @@

进入平台

-

仪表盘

-

总览你的点数、用量与收益

+
+
/ 仪表盘
+

仪表盘

+

总览你的点数、用量与收益

+
+
-
+
-

我的共享

-
+
+
+

近 14 天消耗与收益

+

单位:点数 · 每日合计

+
+
+
+
+ 消费 + 共享收益 +

本月点数变化

+

最近几笔累计

+
+
+
+

我的共享

+

上架中的 key 与实时用量

+
+ +
+
+