feat(admin-web): expose AI point balance and usage ledger

Surfaces the new AI point quota in the workspace shell and adds a
Personal Center → AI Point Usage page that shows balance, base-char
rule, and the paginated reservation/refund history. Updates shared
types for the QuotaSummary and ledger payloads.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-28 11:34:07 +08:00
parent e307a048d1
commit bf7594ccd8
7 changed files with 536 additions and 4 deletions
+39
View File
@@ -86,6 +86,8 @@ const enUS = {
kolManage: "Prompt Management",
kolDashboard: "Dashboard",
kolProfile: "Profile",
personalCenter: "Personal Center",
aiPointUsage: "AI Point Usage",
},
auth: {
welcomeBack: "Welcome back",
@@ -117,10 +119,31 @@ const enUS = {
quotaTitle: "Plan & Quota",
quotaStatus: "Healthy",
remainingQuota: "Article quota",
aiPoints: "AI points",
resetAt: "Reset at",
userFallback: "Admin",
logout: "Logout",
planFallback: "Free Plan",
aiUsageTitle: "AI Point Usage",
aiUsageRecent: "Recent Usage",
aiUsageEmpty: "No AI point usage yet",
aiUsageBase: "Tiered every {base} chars",
aiUsageRule: "{chars} chars / base {base}",
aiUsagePendingHelp: "Points have been reserved. They will be confirmed once the AI task completes; if generation fails, the points are returned automatically.",
aiUsageTypes: {
article_selection_optimize: "Article Selection Optimize",
template_analyze: "AI Analysis",
template_title_generate: "AI Title Generation",
template_outline_generate: "AI Outline Generation",
kol_prompt_generate: "KOL Prompt Generation",
kol_prompt_optimize: "KOL Prompt Optimize",
},
aiUsageStatus: {
pending: "Processing",
completed: "Charged",
refunded: "Refunded",
failed: "Failed",
},
},
route: {
login: {
@@ -183,6 +206,22 @@ const enUS = {
title: "Image Management",
description: "Manage image assets, including folders, reference analysis, and cover library usage.",
},
aiPoints: {
title: "AI Point Usage",
description: "Review AI point balance, cycle rules, and recent usage records.",
},
},
aiPoints: {
balance: "Available Points",
baseChars: "Base Characters",
ledgerTitle: "Usage Ledger",
ledgerLimit: "Latest {limit} records",
ledgerTotal: "{total} records",
table: {
usageType: "Usage",
points: "Points",
requestChars: "Metered Chars",
},
},
kol: {
marketplace: {
+39
View File
@@ -86,6 +86,8 @@ const zhCN = {
kolManage: "提示词管理",
kolDashboard: "数据看板",
kolProfile: "个人主页",
personalCenter: "个人中心",
aiPointUsage: "AI 点数明细",
},
auth: {
welcomeBack: "欢迎回来",
@@ -117,10 +119,31 @@ const zhCN = {
quotaTitle: "套餐与额度",
quotaStatus: "状态正常",
remainingQuota: "生成文章",
aiPoints: "AI 点数",
resetAt: "重置时间",
userFallback: "管理员",
logout: "退出",
planFallback: "免费版",
aiUsageTitle: "AI 点数明细",
aiUsageRecent: "最近消耗",
aiUsageEmpty: "暂无 AI 点数流水",
aiUsageBase: "每 {base} 字进一档",
aiUsageRule: "{chars} 字 / 基准 {base}",
aiUsagePendingHelp: "点数已先行占用,AI 任务完成后会确认为扣除;如果生成失败,系统会自动退回点数。",
aiUsageTypes: {
article_selection_optimize: "文章片段优化",
template_analyze: "AI 分析",
template_title_generate: "AI 生成标题",
template_outline_generate: "AI 生成大纲",
kol_prompt_generate: "KOL 模版生成",
kol_prompt_optimize: "KOL 模版优化",
},
aiUsageStatus: {
pending: "处理中",
completed: "已扣除",
refunded: "已退回",
failed: "失败",
},
},
route: {
login: {
@@ -183,6 +206,22 @@ const zhCN = {
title: "图片管理",
description: "管理图片素材库,支持分组管理、引用分析与封面图库引用。",
},
aiPoints: {
title: "AI 点数明细",
description: "查看当前套餐 AI 点数余额、周期规则和最近消耗流水。",
},
},
aiPoints: {
balance: "可用点数",
baseChars: "基准字数",
ledgerTitle: "消耗流水",
ledgerLimit: "最近 {limit} 条记录",
ledgerTotal: "共 {total} 条记录",
table: {
usageType: "使用场景",
points: "点数",
requestChars: "计费字数",
},
},
kol: {
marketplace: {