diff --git a/web/admin-spa/src/i18n/locales/en.js b/web/admin-spa/src/i18n/locales/en.js index cfc16419..3008e01b 100644 --- a/web/admin-spa/src/i18n/locales/en.js +++ b/web/admin-spa/src/i18n/locales/en.js @@ -489,6 +489,178 @@ export default { // Account type display claudeMax: 'Claude Max', claudePro: 'Claude Pro', - claudeFree: 'Claude Free' + claudeFree: 'Claude Free', + + // Platform display + openaiResponsesPlatform: 'OpenAI-Responses', + ccrPlatform: 'CCR' + }, + apiKeys: { + // Page title and description + title: 'API Keys Management', + description: 'Manage and monitor your API keys', + + // Tab navigation + activeTab: 'Active API Keys', + deletedTab: 'Deleted API Keys', + + // Toolbar and actions + refresh: 'Refresh', + refreshTooltip: 'Refresh API Keys list (Ctrl+click for force refresh)', + createNew: 'Create New Key', + bulkEdit: 'Edit Selected', + bulkDelete: 'Delete Selected', + + // Table headers + name: 'Name', + tags: 'Tags', + status: 'Status', + usageStats: 'Usage Statistics', + createdAt: 'Created At', + expiresAt: 'Expires At', + actions: 'Actions', + + // Filter options + timeRange: { + today: 'Today', + week: 'Last 7 Days', + month: 'This Month', + all: 'All Time' + }, + + // Status + active: 'Active', + disabled: 'Disabled', + expired: 'Expired', + expiringSoon: 'Expiring Soon', + neverExpire: 'Never Expire', + notActivated: 'Not Activated', + + // Usage statistics + dailyCost: 'Daily Cost', + totalCost: 'Total Cost', + dailyRequests: 'Daily Requests', + lastUsed: 'Last Used', + neverUsed: 'Never Used', + minutesAgo: '{minutes} minutes ago', + hoursAgo: '{hours} hours ago', + daysAgo: '{days} days ago', + justNow: 'Just now', + requests: 'requests', + + // Search and filter + searchPlaceholder: 'Search name...', + searchPlaceholderWithOwner: 'Search name or owner...', + allTags: 'All Tags', + noTags: 'No Tags', + + // Binding information + shared: 'Using Shared Pool', + dedicated: 'Dedicated', + consoleAccount: 'Console Account', + bindingWarning: '⚠️ Account not found', + + // Limits and quotas + dailyLimit: 'Daily Cost', + weeklyOpusLimit: 'Opus Weekly Cost', + remainingQuota: 'Remaining: ${amount}', + reset: 'Reset at {time}', + quotaProgress: 'Quota Progress', + + // Model statistics + modelStats: 'Model Usage Distribution', + modelStatsCount: '{count} models', + totalTokens: 'Total Tokens', + inputTokens: 'Input', + outputTokens: 'Output', + cacheCreate: 'Cache Create', + cacheRead: 'Cache Read', + totalRequests: 'Total Requests', + noModelData: 'No model usage data', + resetFilter: 'Refresh', + adjustTimeRange: 'Try adjusting the time range or click refresh to reload data', + + // Date filter + dateFilter: { + today: 'Today', + days7: '7 Days', + days30: '30 Days' + }, + + // Actions + viewDetails: 'View Detailed Statistics', + edit: 'Edit', + renew: 'Renew', + activate: 'Activate', + disable: 'Disable', + copy: 'Copy', + copyStatsLink: 'Copy Stats Page Link', + + // Pagination + totalRecords: 'Total {count} records', + pageSize: 'Show', + records: 'per page', + + // Empty states + noApiKeys: 'No API Keys', + noApiKeysHint: 'Click the button above to create your first API Key', + noDeletedKeys: 'No deleted API Keys', + noDeletedKeysHint: 'Deleted API Keys will appear here', + loading: 'Loading API Keys...', + loadingDeleted: 'Loading deleted API Keys...', + loadingModelStats: 'Loading model statistics...', + + // Deleted keys table + creator: 'Creator', + deletedBy: 'Deleted By', + deletedAt: 'Deleted At', + canRestore: 'Restore', + permanentDelete: 'Permanent Delete', + clearAllDeleted: 'Clear All Deleted', + + // User types + admin: 'Admin', + user: 'User', + unknown: 'Unknown', + system: 'System', + + // Confirmation dialogs + confirmDisable: 'Are you sure to disable API Key "{name}"? All requests using this key will return 401 errors after disabled.', + confirmDelete: 'Are you sure to delete this API Key? This action cannot be undone.', + confirmBatchDelete: 'Are you sure to delete selected {count} API Keys? This action cannot be undone.', + confirmRestore: 'Are you sure to restore this API Key? It can be used again after restoration.', + confirmPermanentDelete: 'Are you sure to permanently delete this API Key? This action cannot be undone and all related data will be permanently deleted.', + confirmClearAll: 'Are you sure to permanently delete all {count} deleted API Keys? This action cannot be undone and all related data will be permanently deleted.', + + // Success messages + keyActivated: 'API Key activated', + keyDisabled: 'API Key disabled', + keyDeleted: 'API Key deleted', + keyRestored: 'API Key successfully restored', + keyPermanentDeleted: 'API Key permanently deleted', + allDeletedCleared: 'All deleted API Keys cleared', + linkCopied: 'Stats page link copied', + expiryUpdated: 'Expiry time updated', + + // Error messages + selectKeysFirst: 'Please select API Keys to edit first', + loadFailed: 'Failed to load API Keys', + operationFailed: 'Operation failed', + copyFailed: 'Copy failed, please copy manually', + updateFailed: 'Update failed', + deleteFailed: 'Delete failed', + restoreFailed: 'Restore failed', + clearFailed: 'Clear failed', + + // Tooltips and helpers + editExpiry: 'Edit expiry time', + activationDays: 'Not activated ({days} days)', + boundTo: 'Bound to', + belongsToGroup: 'Belongs to group: {name}', + + // Batch operations + batchSuccess: 'Successfully processed {count} items', + batchPartialFail: '{failed} items failed to process', + batchAllFailed: 'All items failed to process' } } diff --git a/web/admin-spa/src/i18n/locales/zh-cn.js b/web/admin-spa/src/i18n/locales/zh-cn.js index cdf08981..5f1251a2 100644 --- a/web/admin-spa/src/i18n/locales/zh-cn.js +++ b/web/admin-spa/src/i18n/locales/zh-cn.js @@ -489,6 +489,178 @@ export default { // Account type display claudeMax: 'Claude Max', claudePro: 'Claude Pro', - claudeFree: 'Claude Free' + claudeFree: 'Claude Free', + + // Platform display + openaiResponsesPlatform: 'OpenAI-Responses', + ccrPlatform: 'CCR' + }, + apiKeys: { + // Page title and description + title: 'API Keys 管理', + description: '管理和监控您的 API 密钥', + + // Tab navigation + activeTab: '活跃 API Keys', + deletedTab: '已删除 API Keys', + + // Toolbar and actions + refresh: '刷新', + refreshTooltip: '刷新 API Keys 列表(Ctrl+点击强制刷新)', + createNew: '创建新 Key', + bulkEdit: '编辑选中', + bulkDelete: '删除选中', + + // Table headers + name: '名称', + tags: '标签', + status: '状态', + usageStats: '使用统计', + createdAt: '创建时间', + expiresAt: '过期时间', + actions: '操作', + + // Filter options + timeRange: { + today: '今日', + week: '最近7天', + month: '本月', + all: '全部时间' + }, + + // Status + active: '活跃', + disabled: '禁用', + expired: '已过期', + expiringSoon: '即将过期', + neverExpire: '永不过期', + notActivated: '未激活', + + // Usage statistics + dailyCost: '今日费用', + totalCost: '总费用', + dailyRequests: '今日请求', + lastUsed: '最后使用', + neverUsed: '从未使用', + minutesAgo: '{minutes} 分钟前', + hoursAgo: '{hours} 小时前', + daysAgo: '{days} 天前', + justNow: '刚刚', + requests: '次', + + // Search and filter + searchPlaceholder: '搜索名称...', + searchPlaceholderWithOwner: '搜索名称或所有者...', + allTags: '所有标签', + noTags: '无标签', + + // Binding information + shared: '使用共享池', + dedicated: '专属', + consoleAccount: 'Console账户', + bindingWarning: '⚠️ 账户不存在', + + // Limits and quotas + dailyLimit: '每日费用', + weeklyOpusLimit: 'Opus周费用', + remainingQuota: '剩余: ${amount}', + reset: '重置于 {time}', + quotaProgress: '额度进度', + + // Model statistics + modelStats: '模型使用分布', + modelStatsCount: '{count} 个模型', + totalTokens: '总Token', + inputTokens: '输入', + outputTokens: '输出', + cacheCreate: '缓存创建', + cacheRead: '缓存读取', + totalRequests: '总请求', + noModelData: '暂无模型使用数据', + resetFilter: '刷新', + adjustTimeRange: '尝试调整时间范围或点击刷新重新加载数据', + + // Date filter + dateFilter: { + today: '今日', + days7: '7天', + days30: '30天' + }, + + // Actions + viewDetails: '查看详细统计', + edit: '编辑', + renew: '续期', + activate: '激活', + disable: '禁用', + copy: '复制', + copyStatsLink: '复制统计页面链接', + + // Pagination + totalRecords: '共 {count} 条记录', + pageSize: '每页显示', + records: '条', + + // Empty states + noApiKeys: '暂无 API Keys', + noApiKeysHint: '点击上方按钮创建您的第一个 API Key', + noDeletedKeys: '暂无已删除的 API Keys', + noDeletedKeysHint: '已删除的 API Keys 会出现在这里', + loading: '正在加载 API Keys...', + loadingDeleted: '正在加载已删除的 API Keys...', + loadingModelStats: '加载模型统计...', + + // Deleted keys table + creator: '创建者', + deletedBy: '删除者', + deletedAt: '删除时��', + canRestore: '恢复', + permanentDelete: '彻底删除', + clearAllDeleted: '清空所有已删除', + + // User types + admin: '管理员', + user: '用户', + unknown: '未知', + system: '系统', + + // Confirmation dialogs + confirmDisable: '确定要禁用 API Key "{name}" 吗?禁用后所有使用此 Key 的请求将返回 401 错误。', + confirmDelete: '确定要删除这个 API Key 吗?此操作不可恢复。', + confirmBatchDelete: '确定要删除选中的 {count} 个 API Key 吗?此操作不可恢复。', + confirmRestore: '确定要恢复这个 API Key 吗?恢复后可以重新使用。', + confirmPermanentDelete: '确定要彻底删除这个 API Key 吗?此操作不可恢复,所有相关数据将被永久删除。', + confirmClearAll: '确定要彻底删除全部 {count} 个已删除的 API Keys 吗?此操作不可恢复,所有相关数据将被永久删除。', + + // Success messages + keyActivated: 'API Key 已激活', + keyDisabled: 'API Key 已禁用', + keyDeleted: 'API Key 已删除', + keyRestored: 'API Key 已成功恢复', + keyPermanentDeleted: 'API Key 已彻底删除', + allDeletedCleared: '已清空所有已删除的 API Keys', + linkCopied: '已复制统计页面链接', + expiryUpdated: '过期时间已更新', + + // Error messages + selectKeysFirst: '请先选择要编辑的 API Keys', + loadFailed: '加载 API Keys 失败', + operationFailed: '操作失败', + copyFailed: '复制失败,请手动复制', + updateFailed: '更新失败', + deleteFailed: '删除失败', + restoreFailed: '恢复失败', + clearFailed: '清空失败', + + // Tooltips and helpers + editExpiry: '编辑过期时间', + activationDays: '未激活 ({days}天)', + boundTo: '绑定到', + belongsToGroup: '所属分组: {name}', + + // Batch operations + batchSuccess: '成功处理 {count} 个项目', + batchPartialFail: '{failed} 个处理失败', + batchAllFailed: '所有项目处理失败' } } diff --git a/web/admin-spa/src/i18n/locales/zh-tw.js b/web/admin-spa/src/i18n/locales/zh-tw.js index f58fc472..3dcef4d2 100644 --- a/web/admin-spa/src/i18n/locales/zh-tw.js +++ b/web/admin-spa/src/i18n/locales/zh-tw.js @@ -489,6 +489,178 @@ export default { // Account type display claudeMax: 'Claude Max', claudePro: 'Claude Pro', - claudeFree: 'Claude Free' + claudeFree: 'Claude Free', + + // Platform display + openaiResponsesPlatform: 'OpenAI-Responses', + ccrPlatform: 'CCR' + }, + apiKeys: { + // Page title and description + title: 'API Keys 管理', + description: '管理和監控您的 API 密鑰', + + // Tab navigation + activeTab: '活躍 API Keys', + deletedTab: '已刪除 API Keys', + + // Toolbar and actions + refresh: '重新整理', + refreshTooltip: '重新整理 API Keys 清單(Ctrl+點擊強制重新整理)', + createNew: '建立新 Key', + bulkEdit: '編輯已選取', + bulkDelete: '刪除已選取', + + // Table headers + name: '名稱', + tags: '標籤', + status: '狀態', + usageStats: '使用統計', + createdAt: '建立時間', + expiresAt: '過期時間', + actions: '操作', + + // Filter options + timeRange: { + today: '今日', + week: '最近7天', + month: '本月', + all: '全部時間' + }, + + // Status + active: '活躍', + disabled: '停用', + expired: '已過期', + expiringSoon: '即將過期', + neverExpire: '永不過期', + notActivated: '未啟用', + + // Usage statistics + dailyCost: '今日費用', + totalCost: '總費用', + dailyRequests: '今日請求', + lastUsed: '最後使用', + neverUsed: '從未使用', + minutesAgo: '{minutes} 分鐘前', + hoursAgo: '{hours} 小時前', + daysAgo: '{days} 天前', + justNow: '剛剛', + requests: '次', + + // Search and filter + searchPlaceholder: '搜尋名稱...', + searchPlaceholderWithOwner: '搜尋名稱或擁有者...', + allTags: '所有標籤', + noTags: '無標籤', + + // Binding information + shared: '使用共享池', + dedicated: '專屬', + consoleAccount: 'Console賬戶', + bindingWarning: '⚠️ 賬戶不存在', + + // Limits and quotas + dailyLimit: '每日費用', + weeklyOpusLimit: 'Opus週費用', + remainingQuota: '剩餘: ${amount}', + reset: '重設於 {time}', + quotaProgress: '配額進度', + + // Model statistics + modelStats: '模型使用分佈', + modelStatsCount: '{count} 個模型', + totalTokens: '總Token', + inputTokens: '輸入', + outputTokens: '輸出', + cacheCreate: '快取建立', + cacheRead: '快取讀取', + totalRequests: '總請求', + noModelData: '暫無模型使用資料', + resetFilter: '重新整理', + adjustTimeRange: '嘗試調整時間範圍或點擊重新整理重新載入資料', + + // Date filter + dateFilter: { + today: '今日', + days7: '7天', + days30: '30天' + }, + + // Actions + viewDetails: '查看詳細統計', + edit: '編輯', + renew: '續期', + activate: '啟用', + disable: '停用', + copy: '複製', + copyStatsLink: '複製統計頁面連結', + + // Pagination + totalRecords: '共 {count} 條記錄', + pageSize: '每頁顯示', + records: '條', + + // Empty states + noApiKeys: '暫無 API Keys', + noApiKeysHint: '點擊上方按鈕建立您的第一個 API Key', + noDeletedKeys: '暫無已刪除的 API Keys', + noDeletedKeysHint: '已刪除的 API Keys 會出現在這裡', + loading: '正在載入 API Keys...', + loadingDeleted: '正在載入已刪除的 API Keys...', + loadingModelStats: '載入模型統計...', + + // Deleted keys table + creator: '建立者', + deletedBy: '刪除者', + deletedAt: '刪除時間', + canRestore: '恢復', + permanentDelete: '徹底刪除', + clearAllDeleted: '清空所有已刪除', + + // User types + admin: '管理員', + user: '用戶', + unknown: '未知', + system: '系統', + + // Confirmation dialogs + confirmDisable: '確定要停用 API Key "{name}" 嗎?停用後所有使用此 Key 的請求將返回 401 錯誤。', + confirmDelete: '確定要刪除這個 API Key 嗎?此操作不可恢復。', + confirmBatchDelete: '確定要刪除已選取的 {count} 個 API Key 嗎?此操作不可恢復。', + confirmRestore: '確定要恢復這個 API Key 嗎?恢復後可以重新使用。', + confirmPermanentDelete: '確定要徹底刪除這個 API Key 嗎?此操作不可恢復,所有相關資料將被永久刪除。', + confirmClearAll: '確定要徹底刪除全部 {count} 個已刪除的 API Keys 嗎?此操作不可恢復,所有相關資料將被永久刪除。', + + // Success messages + keyActivated: 'API Key 已啟用', + keyDisabled: 'API Key 已停用', + keyDeleted: 'API Key 已刪除', + keyRestored: 'API Key 已成功恢復', + keyPermanentDeleted: 'API Key 已徹底刪除', + allDeletedCleared: '已清空所有已刪除的 API Keys', + linkCopied: '已複製統計頁面連結', + expiryUpdated: '過期時間已更新', + + // Error messages + selectKeysFirst: '請先選擇要編輯的 API Keys', + loadFailed: '載入 API Keys 失敗', + operationFailed: '操作失敗', + copyFailed: '複製失敗,請手動複製', + updateFailed: '更新失敗', + deleteFailed: '刪除失敗', + restoreFailed: '恢復失敗', + clearFailed: '清空失敗', + + // Tooltips and helpers + editExpiry: '編輯過期時間', + activationDays: '未啟用 ({days}天)', + boundTo: '綁定到', + belongsToGroup: '所屬分組: {name}', + + // Batch operations + batchSuccess: '成功處理 {count} 個項目', + batchPartialFail: '{failed} 個處理失敗', + batchAllFailed: '所有項目處理失敗' } } diff --git a/web/admin-spa/src/views/ApiKeysView.vue b/web/admin-spa/src/views/ApiKeysView.vue index c6e462cb..c35be8fa 100644 --- a/web/admin-spa/src/views/ApiKeysView.vue +++ b/web/admin-spa/src/views/ApiKeysView.vue @@ -4,10 +4,10 @@

- API Keys 管理 + {{ t('apiKeys.title') }}

- 管理和监控您的 API 密钥 + {{ t('apiKeys.description') }}

@@ -23,7 +23,7 @@ ]" @click="activeTab = 'active'" > - 活跃 API Keys + {{ t('apiKeys.activeTab') }} - 已删除 API Keys + {{ t('apiKeys.deletedTab') }}
-
- +
+
@@ -64,33 +64,12 @@ class="absolute -inset-0.5 rounded-lg bg-gradient-to-r from-blue-500 to-purple-500 opacity-0 blur transition duration-300 group-hover:opacity-20" >
-
- - -
-
@@ -105,7 +84,7 @@ icon="fa-tags" icon-color="text-purple-500" :options="tagOptions" - placeholder="所有标签" + :placeholder="tagOptions.find(o => o.value === '')?.label || t('apiKeys.allTags')" @change="currentPage = 1" /> @@ -140,10 +119,7 @@
-
- -
- - - - - - @@ -193,7 +148,7 @@ class="absolute -inset-0.5 rounded-lg bg-gradient-to-r from-blue-500 to-indigo-500 opacity-0 blur transition duration-300 group-hover:opacity-20" >
- 编辑选中 ({{ selectedApiKeys.length }}) + {{ t('apiKeys.bulkEdit') }} ({{ selectedApiKeys.length }}) @@ -206,23 +161,23 @@ class="absolute -inset-0.5 rounded-lg bg-gradient-to-r from-red-500 to-pink-500 opacity-0 blur transition duration-300 group-hover:opacity-20" >
- 删除选中 ({{ selectedApiKeys.length }}) - - - - + + +
-

正在加载 API Keys...

+

{{ t('apiKeys.loading') }}

@@ -231,204 +186,241 @@ >
-

暂无 API Keys

-

点击上方按钮创建您的第一个 API Key

+

{{ t('apiKeys.noApiKeys') }}

+

{{ t('apiKeys.noApiKeysHint') }}

-