feat: 完成UserUsageStatsModal和ChangeRoleModal组件国际化

- 添加用户使用统计模态框的完整国际化支持
  * 时间选择器选项(最近24小时/7天/30天/90天)
  * 统计卡片(请求数/输入Token/输出Token/总费用)
  * API Keys表格表头和状态显示
  * 使用趋势图表占位符和无数据状态

- 添加角色变更模态框的完整国际化支持
  * 角色选择表单和描述文本
  * 动态警告消息(授予/移除管理员权限)
  * 按钮状态和成功提示消息

- 更新三种语言文件(zh-cn/en/zh-tw)添加新的翻译键值
- 集成Vue I18n组合式API支持动态参数替换
- 保持响应式翻译和用户体验的一致性
This commit is contained in:
Wangnov
2025-09-09 21:26:15 +08:00
parent 5706c32933
commit 26d8c98c9d
5 changed files with 336 additions and 44 deletions

View File

@@ -789,6 +789,102 @@ export default {
loadUsersError: 'Failed to load users',
toggleStatusError: 'Failed to toggleStatus',
disableKeysError: 'Failed to disableKeys'
},
// User Usage Stats Modal
usageStatsModal: {
title: '使用統計',
titleWithUser: '使用統計 - {displayName}',
// Time period selection
periodSelection: {
day: '最近24小時',
week: '最近7天',
month: '最近30天',
quarter: '最近90天'
},
// Loading state
loadingStats: '正在載入使用統計...',
// Summary cards
summaryCards: {
requests: '請求數',
inputTokens: '輸入Token',
outputTokens: '輸出Token',
totalCost: '總費用'
},
// API Keys table
apiKeysTable: {
title: 'API Keys 使用情況',
headers: {
apiKey: 'API Key',
status: '狀態',
requests: '請求數',
tokens: 'Token數',
cost: '費用',
lastUsed: '最後使用'
},
status: {
active: '活躍',
disabled: '已停用'
},
tokensFormat: {
input: '輸入',
output: '輸出'
},
never: '從未使用'
},
// Usage trend chart
usageTrend: {
title: '使用趨勢',
chartTitle: '使用圖表',
dailyTrends: '最近 {period} 的日使用趨勢',
chartNote: '(可整合 Chart.js、D3.js 或類似圖表庫)'
},
// No data state
noData: {
title: '暫無使用資料',
description: '該使用者在所選時間段內尚未發起任何API請求。'
},
// Buttons
close: '關閉'
},
// Change Role Modal
changeRoleModal: {
title: '修改使用者角色',
// User info display
currentRole: '當前角色:{role}',
// Role selection form
newRole: '新角色',
roles: {
user: '使用者',
userDesc: '具有基本權限的普通使用者',
admin: '管理員',
adminDesc: '擁有管理使用者和系統的完整權限'
},
// Warning messages
roleChangeWarning: {
title: '角色變更警告',
grantAdmin: '授予管理員權限將使該使用者擁有系統的完整存取權限包括管理其他使用者及其API密鑰的能力。',
removeAdmin: '移除管理員權限將限制該使用者只能管理自己的API密鑰和檢視自己的使用統計。'
},
// Buttons
cancel: '取消',
updateRole: '更新角色',
updating: '更新中...',
// Success message
roleUpdated: '使用者角色已更新為 {role}'
}
},