feat(provider): 订阅源流量信息展示#19
Open
PrintNow wants to merge 1 commit into
Open
Conversation
解析上游订阅源返回的 subscription-userinfo 响应头,存储并展示 流量使用情况(已用/总量进度条、到期时间倒计时)。 后端: - Provider 模型新增 traffic_upload/download/total/expire_at 字段 - FetchAndCache 中解析 subscription-userinfo header - 数据库迁移使用时间戳版本号 (20260429133900) 前端: - 拆分 Providers 页面为目录结构(参考 CustomConfigDetail 模式) - TrafficCell 组件:进度条 + 百分比 Badge + 到期天数 - 安装 shadcn Progress 组件 - 新增流量相关 i18n 翻译
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
subscription-userinfo响应头,存储流量使用数据(upload/download/total/expire)Changes
后端:
internal/model/provider.go— 新增 4 个可空流量字段internal/service/provider.go— FetchAndCache 解析 subscription-userinfo headerinternal/repository/migrations/schema.go— 迁移版本号改用时间戳 (20260429133900)前端:
frontend/src/pages/Providers/— 页面拆分为 traffic + shared 子模块traffic/TrafficCell.tsx— 流量展示组件(进度条、Badge、CalendarDays 图标)traffic/traffic-utils.ts— formatBytes / calcUsagePercent / daysRemaining 等工具函数Test plan
subscription-userinfo的订阅源,确认 API 响应中traffic_*字段有值traffic_*字段为 null,前端显示-