8000 feat(web): manage accounts from the overview and drop the accounts page by InfinityPacer · Pull Request #11 · InfinityPacer/meterleaf · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [未发布]

- 「账户额度」页并入用量总览。排序、重命名、归档和删除直接在总览的账户区完成,有归档账户时标题旁出现「已归档 N」,可查看和恢复。手机底部导航减为首页、统计、明细和关于。
- 调整账户顺序时跳过已归档账户,上移或下移每次都能看到变化。
- 旧的 `#accounts` 与 `#period` 链接不再特殊处理,打开后显示上次停留的页面。

## [0.5.0] - 2026-09-26

- 「累计总览」和「时间段用量」合并为一个用量总览。默认显示历史至今,也可切换今天、近 7 天、近 30 天或自定义日期。摘要、趋势和模型分布跟随所选范围,账户额度始终按当前周期显示。旧的 `#period` 链接会打开总览。
Expand Down
23 changes: 7 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Meterleaf 只读采集一个 Sub2API PostgreSQL 实例,也可以接收本机

## 能做什么

- **用量总览**:默认看历史至今的 Tokens、费用、请求和缓存命中率,可切到今天、近 7 天等范围;账户额度始终按当前周期显示,下方是同一范围的消耗趋势和模型分布。
- **账户额度**:5 小时与 7 天窗口、重置时间及七天额度预估,支持排序和归档。
- **用量总览**:默认看历史至今的 Tokens、费用、请求和缓存命中率,可切到今天、近 7 天等范围;下方是同一范围的消耗趋势和模型分布。
- **账户额度**:总览中按当前周期显示 5 小时与 7 天窗口、重置时间及七天额度预估,并可直接排序、重命名和归档账户。
- **统计报表**:顶部是所选范围的摘要与环比,按小时、天、周、模型或账户汇总 Tokens、缓存命中率、请求数和费用,附合计行。
- **请求明细**:查看模型、来源、推理强度、Token 拆分与计价依据。
- **独立估值**:同时保留订阅 Credits 与 USD,美元可切换订阅等价和标准 API 口径。
Expand All @@ -20,13 +20,6 @@ Meterleaf 只读采集一个 Sub2API PostgreSQL 实例,也可以接收本机

![Web 用量总览:历史至今摘要、缓存命中率与账户额度](docs/images/web-overview.png)

<details>
<summary>账户额度</summary>

![Web 账户额度:周期用量、重置时间与预估趋势](docs/images/web-accounts.png)

</details>

<details>
<summary>统计报表</summary>

Expand All @@ -43,16 +36,14 @@ Meterleaf 只读采集一个 Sub2API PostgreSQL 实例,也可以接收本机

### 移动端

| 用量总览 | 账户额度 |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| <img src="docs/images/mobile-overview.png" alt="移动端用量总览" width="300" /> | <img src="docs/images/mobile-accounts.png" alt="移动端账户额度" width="300" /> |
| 用量总览 | 统计报表 |
| ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
| <img src="docs/images/mobile-overview.png" alt="移动端用量总览" width="300" /> | <img src="docs/images/mobile-reports.png" alt="移动端统计报表" width="300" /> |

<details>
<summary>统计报表与请求明细</summary>
<summary>请求明细</summary>

| 统计报表 | 请求明细 |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| <img src="docs/images/mobile-reports.png" alt="移动端统计报表" width="300" /> | <img src="docs/images/mobile-requests.png" alt="移动端请求明细" width="300" /> |
<img src="docs/images/mobile-requests.png" alt="移动端请求明细" width="300" />

</details>

Expand Down
2 changes: 1 addition & 1 deletion docs/collector.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ alias meterleaf-collector="/Applications/Meterleaf.app/Contents/MacOS/meterleaf-
meterleaf-collector sync
```

`scan` 只在本地汇总,不联网,可用来与其他统计工具对照。`sync` 成功后,Meterleaf 的账户页会出现名为「Claude Code」的账户,套餐显示在徽标中。可以在账户菜单里改成更容易辨认的名称,见[使用与报表](reporting.md#账户管理)。
`scan` 只在本地汇总,不联网,可用来与其他统计工具对照。`sync` 成功后,Meterleaf 总览的账户区会出现名为「Claude Code」的账户,套餐显示在徽标中。可以在账户菜单里改成更容易辨认的名称,见[使用与报表](reporting.md#账户管理)。

4. 安装后台任务。

Expand Down
Binary file removed docs/images/mobile-accounts.png
Binary file not shown.
Binary file modified docs/images/mobile-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/mobile-reports.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/mobile-requests.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/web-accounts.png
Binary file not shown.
Binary file modified docs/images/web-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/web-reports.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/web-requests.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 15 additions & 13 deletions docs/reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@

[返回首页](../README.md)

## 四个页面
## 三个页面

| 页面 | 内容 | 时间范围 |
| -------- | ------------------------------------------------------------ | -------------------------------------------------- |
| 用量总览 | 所选范围的摘要、账户额度、消耗趋势与模型分布 | 默认历史至今,可切换,账户额度始终按当前周期 |
| 账户额度 | 周期百分比、重置时间、Tokens、请求数、估算费用与七天预估 | 有额度快照的账户按当前窗口;无快照账户显示历史累计 |
| 统计报表 | 范围摘要、模型分布与小时、天、周、模型、账户分组汇总 | 按本页日期和筛选条件 |
| 请求明细 | 来源、模型、推理强度、账户、Token 数和费用;点击查看完整证据 | 按本页条件筛选并在服务端分页 |
| 页面 | 内容 | 时间范围 | C2C1
| -------- | ------------------------------------------------------------ | -------------------------------------------- |
| 用量总览 | 所选范围的摘要、账户额度与账户管理、消耗趋势与模型分布 | 默认历史至今,可切换,账户额度始终按当前周期 |
| 统计报表 | 范围摘要、模型分布与小时、天、周、模型、账户分组汇总 | 按本页日期和筛选条件 |
| 请求明细 | 来源、模型、推理强度、账户、Token 数和费用;点击查看完整证据 | 按本页条件筛选并在服务端分页 |

Web 总览与手机 App 首页中,无额度快照的账户优先展示历史累计,缺少累计时才使用当前区间汇总。API 接入只表示接入方式;有快照时仍可展示订阅额度。
总览的账户区列出每个账户的周期百分比、重置时间、Tokens、请求数、估算费用与七天预估。无额度快照的账户优先展示历史累计,缺少累计时才使用当前区间汇总。点击有额度的账户打开额度详情,点击其它账户打开它的请求明细。API 接入只表示接入方式;有快照时仍可展示订阅额度。

总览只按时间切换,不按模型或账户筛选。第一眼是总量和账户额度,默认范围「历史至今」从账本第一条记录起算。换成今天、近 7 天、近 30 天或自定义日期后,摘要、趋势和模型分布一起变化,账户额度仍按各自当前周期显示,不受范围影响。

摘要有四格。Tokens、费用和请求在历史至今下显示日均和起始日期,其它范围显示与上一个等长时段相比的环比,上期没有用量时显示「暂无对比」。缓存命中率是缓存读取占输入侧(普通输入、缓存读取、缓存写入)的比例,下方的条形图按这三部分拆开,输出 Tokens 不计入命中率,单独列出数量。趋势图下方给出峰值时段、有用量的时段数和单次请求平均值。点击模型分布中的模型,会带着同一范围打开统计报表。

统计报表顶部使用同样的摘要。分组汇总多一列缓存命中率,多于一行时末尾有合计行。

手机默认使用 App 模式,底部为首页、账户、统计、明细和我的。首页顶部可在全部、近 7 天和近 30 天之间切换,日历按钮提供其它范围。可在“我的”中切换为侧栏模式;导航模式和主题会记住,重新打开仍然生效。
手机默认使用 App 模式,底部为首页、统计、明细和关于。首页顶部可在全部、近 7 天和近 30 天之间切换,日历按钮提供其它范围。可在“关于”中切换为侧栏模式;导航模式和主题会记住,重新打开仍然生效。

## 筛选与图表

Expand All @@ -35,10 +34,13 @@ Web 总览与手机 App 首页中,无额度快照的账户优先展示历史

## 账户管理

- 手工调整账户顺序后,总览卡片沿用该顺序;新账户追加在末尾。
- 归档账户默认不展示,可在账户页切换归档状态查看和恢复。
- 删除账户只移除账户展示,也可删除已归档账户;不会删除历史请求、累计统计或 Sub2API 数据。
- 可以在账户菜单中重命名账户,名称只在 Meterleaf 中显示,最长 40 个字,不会改动上游。清空名称或选择恢复原名后,重新显示上游提供的名称。
账户管理都在总览的账户区完成,手机首页相同。

- 点击标题右侧的「排序」后,每个账户下方出现上移和下移按钮,点「完成」结束。新账户追加在末尾。
- 每个账户右侧的「⋯」菜单提供重命名、归档和删除。
- 归档账户不在账户区显示。有归档账户时,标题右侧出现「已归档 N」,点击后查看归档列表,可在菜单中恢复或删除,点「使用中账户」返回。
- 删除账户只移除账户展示,不会删除历史请求、累计统计或 Sub2API 数据。
- 重命名的名称只在 Meterleaf 中显示,最长 40 个字,不会改动上游。清空名称或选择恢复原名后,重新显示上游提供的名称。
- 套餐徽标按使用倍数分三档显示,同一档外观相同。Claude Pro 与 ChatGPT Plus 为一档,Claude Max 5x 与 ChatGPT Pro 5x 为二档,Claude Max 20x 与 ChatGPT Pro 20x 为三档。无法识别的套餐只显示名称。
- 本地归档、删除状态和账户名称不会被同步覆盖。上游删除账户后,本地历史请求仍保留。

Expand Down
Loading
Loading
0