From 24ad052d028d17fc837a333fe1b4171dea3e63d7 Mon Sep 17 00:00:00 2001 From: Wangnov Date: Tue, 9 Sep 2025 10:59:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90SettingsView=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=AE=8C=E6=95=B4=E5=9B=BD=E9=99=85=E5=8C=96=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 扩展三个语言文件,添加198个settings翻译键,支持中英繁三语言 - 完成SettingsView.vue所有1604行的系统化国际化处理: * 完整国际化HTML模板:页面标题、导航标签、品牌设置、Webhook设置等 * 完整国际化JavaScript功能:Toast消息、确认对话框、表单验证、错误处理 * 集成Vue i18n:添加useI18n composable,实现响应式翻译支持 * 转换静态函数为响应式翻译,支持语言切换时实时更新 - 主要功能模块全面国际化: * 品牌设置:网站名称、图标管理、管理入口配置完全国际化 * Webhook通知:7种平台类型、通知类型、高级设置完全国际化 * 模态框:复杂的平台添加/编辑表单完全国际化 * 响应式布局:桌面端表格和移动端卡片视图完全适配 * 错误处理:37个Toast消息、确认对话框、表单验证完全国际化 现在SettingsView完全支持多语言切换,与其他页面保持一致的国际化标准 --- web/admin-spa/src/i18n/locales/en.js | 203 +++++++++ web/admin-spa/src/i18n/locales/zh-cn.js | 203 +++++++++ web/admin-spa/src/i18n/locales/zh-tw.js | 203 +++++++++ web/admin-spa/src/views/SettingsView.vue | 500 +++++++---------------- 4 files changed, 747 insertions(+), 362 deletions(-) diff --git a/web/admin-spa/src/i18n/locales/en.js b/web/admin-spa/src/i18n/locales/en.js index 3008e01b..a5425e7e 100644 --- a/web/admin-spa/src/i18n/locales/en.js +++ b/web/admin-spa/src/i18n/locales/en.js @@ -662,5 +662,208 @@ export default { batchSuccess: 'Successfully processed {count} items', batchPartialFail: '{failed} items failed to process', batchAllFailed: 'All items failed to process' + }, + + // Settings + settings: { + title: 'System Settings', + description: 'Website customization and notification configuration', + loading: 'Loading settings...', + + // Navigation tabs + branding: 'Branding Settings', + webhook: 'Notification Settings', + + // Branding settings + siteName: 'Site Name', + siteNameDescription: 'Brand identity', + siteNamePlaceholder: 'Claude Relay Service', + siteNameHint: 'Will be displayed in browser title and page header', + + siteIcon: 'Site Icon', + siteIconDescription: 'Favicon', + currentIcon: 'Current icon', + uploadIcon: 'Upload Icon', + removeIcon: 'Remove', + iconFormats: 'Supports .ico, .png, .jpg, .svg formats, max 350KB', + iconPreview: 'Icon preview', + + adminEntry: 'Admin Entry', + adminEntryDescription: 'Login button display', + hideLoginButton: 'Hide login button', + showLoginButton: 'Show login button', + adminEntryHint: 'When hidden, users need to visit /admin/login directly', + + // Mobile card titles + siteNameCard: 'Site Name', + siteNameCardDesc: 'Customize your site brand name', + siteIconCard: 'Site Icon', + siteIconCardDesc: 'Upload custom icon or enter icon URL', + adminEntryCard: 'Admin Entry', + adminEntryCardDesc: 'Control login button visibility on homepage', + + // Action buttons + save: 'Save Settings', + saving: 'Saving...', + reset: 'Reset to Default', + lastUpdated: 'Last updated: {time}', + lastUpdatedMobile: 'Last updated: {time}', + + // Webhook settings + enableWebhook: 'Enable Webhook Notifications', + webhookDescription: 'When enabled, system will send notifications to configured platforms', + + // Notification types + notificationTypes: 'Notification Types', + accountAnomaly: 'Account Anomaly', + quotaWarning: 'Quota Warning', + systemError: 'System Error', + securityAlert: 'Security Alert', + accountAnomalyDesc: 'Account status anomalies, authentication failures, etc.', + quotaWarningDesc: 'API call quota insufficient warnings', + systemErrorDesc: 'System runtime errors and failures', + securityAlertDesc: 'Security-related alert notifications', + + // Notification platforms + notificationPlatforms: 'Notification Platforms', + addPlatform: 'Add Platform', + noPlatforms: 'No notification platforms configured, click "Add Platform" to add one', + enableSignature: 'Signature verification enabled', + testConnection: 'Test Connection', + edit: 'Edit', + delete: 'Delete', + + // Advanced settings + advancedSettings: 'Advanced Settings', + maxRetries: 'Max Retries', + retryDelay: 'Retry Delay (ms)', + timeout: 'Timeout (ms)', + + // Test notification + sendTestNotification: 'Send Test Notification', + + // Platform modal + addPlatformModal: 'Add Notification Platform', + editPlatformModal: 'Edit Notification Platform', + configurePlatform: 'Configure new Webhook notification channel', + updatePlatform: 'Configure and update Webhook notification channel', + + platformType: 'Platform Type', + platformName: 'Name', + platformNameOptional: '(Optional)', + platformNamePlaceholder: 'e.g.: Operations team, Dev test group', + + webhookUrl: 'Webhook URL', + webhookUrlRequired: '*', + webhookUrlPlaceholder: 'https://...', + editModeWarning: 'Platform type cannot be changed in edit mode', + + // Bark specific settings + deviceKey: 'Device Key', + deviceKeyPlaceholder: 'e.g.: aBcDeFgHiJkLmNoPqRsTuVwX', + deviceKeyHint: 'Check your push key in Bark App', + serverAddress: 'Server Address', + serverAddressOptional: '(Optional)', + serverAddressPlaceholder: 'Default: https://api.day.app/push', + notificationLevel: 'Notification Level', + notificationSound: 'Notification Sound', + notificationGroup: 'Notification Group', + notificationGroupOptional: '(Optional)', + notificationGroupPlaceholder: 'Default: claude-relay', + + // Notification level options + levelAuto: 'Auto (based on notification type)', + levelPassive: 'Passive', + levelActive: 'Default', + levelTimeSensitive: 'Time Sensitive', + levelCritical: 'Critical', + + // Sound options + soundAuto: 'Auto (based on notification type)', + soundDefault: 'Default', + soundAlarm: 'Alarm', + soundBell: 'Bell', + soundBirdsong: 'Birdsong', + soundElectronic: 'Electronic', + soundGlass: 'Glass', + soundHorn: 'Horn', + soundSilence: 'Silence', + + // Bark instructions + barkInstructions: [ + '1. Install Bark App on iPhone', + '2. Open the app to get your device key', + '3. Paste the key into the input box above' + ], + + // Signature settings + enableSignatureVerify: 'Enable Signature Verification', + signatureEnabled: 'Enabled', + signatureSecret: 'Signature Secret', + signatureSecretPlaceholder: 'SEC...', + + // Platform hints + wechatWorkHint: 'Get Webhook URL from WeChat Work group bot settings', + dingtalkHint: 'Get Webhook URL from DingTalk group bot settings', + feishuHint: 'Get Webhook URL from Feishu group bot settings', + slackHint: 'Get URL from Slack app Incoming Webhooks', + discordHint: 'Create Webhook in Discord server integration settings', + barkHint: 'Check your device key in Bark App', + customHint: 'Enter complete Webhook receiving URL', + + // Modal buttons + required: 'Required fields', + cancel: 'Cancel', + testing: 'Testing...', + saveChanges: 'Save Changes', + addPlatformBtn: 'Add Platform', + + // Success/error messages + loadSettingsFailed: 'Failed to load settings', + settingsSaved: 'Settings saved', + saveSettingsFailed: 'Failed to save settings', + oemSettingsSaved: 'OEM settings saved successfully', + oemSettingsSaveFailed: 'Failed to save OEM settings', + resetToDefault: 'Reset to default settings', + resetFailed: 'Reset failed', + confirmReset: 'Are you sure you want to reset to default settings?\n\nThis will clear all custom site name and icon settings.', + + webhookConfigSaved: 'Configuration saved', + webhookConfigSaveFailed: 'Failed to save configuration', + getWebhookConfigFailed: 'Failed to get webhook configuration', + + platformAdded: 'Platform added', + platformUpdated: 'Platform updated', + platformDeleted: 'Platform deleted', + platformDeleteFailed: 'Delete failed', + confirmDeletePlatform: 'Are you sure you want to delete this platform?', + operationFailed: 'Operation failed', + + testSuccess: 'Test successful, webhook connection normal', + testFailed: 'Test failed', + testNotificationSent: 'Test notification sent', + testNotificationFailed: 'Send failed', + + // Form validation messages + enterBarkDeviceKey: 'Please enter Bark device key', + enterWebhookUrl: 'Please enter Webhook URL', + enterValidWebhookUrl: 'Please enter valid Webhook URL', + enterWebhookUrlFirst: 'Please enter Webhook URL first', + enterBarkDeviceKeyFirst: 'Please enter Bark device key first', + + // File upload + fileReadFailed: 'File read failed', + iconLoadFailed: 'Icon failed to load', + + // Platform names + platforms: { + wechatWork: 'WeChat Work', + dingtalk: 'DingTalk', + feishu: 'Feishu', + slack: 'Slack', + discord: 'Discord', + bark: 'Bark', + custom: 'Custom' + } } } diff --git a/web/admin-spa/src/i18n/locales/zh-cn.js b/web/admin-spa/src/i18n/locales/zh-cn.js index 5f1251a2..f9c5e781 100644 --- a/web/admin-spa/src/i18n/locales/zh-cn.js +++ b/web/admin-spa/src/i18n/locales/zh-cn.js @@ -662,5 +662,208 @@ export default { batchSuccess: '成功处理 {count} 个项目', batchPartialFail: '{failed} 个处理失败', batchAllFailed: '所有项目处理失败' + }, + + // Settings 设置页面 + settings: { + title: '系统设置', + description: '网站定制和通知配置', + loading: '正在加载设置...', + + // 导航标签 + branding: '品牌设置', + webhook: '通知设置', + + // 品牌设置 + siteName: '网站名称', + siteNameDescription: '品牌标识', + siteNamePlaceholder: 'Claude Relay Service', + siteNameHint: '将显示在浏览器标题和页面头部', + + siteIcon: '网站图标', + siteIconDescription: 'Favicon', + currentIcon: '当前图标', + uploadIcon: '上传图标', + removeIcon: '删除', + iconFormats: '支持 .ico, .png, .jpg, .svg 格式,最大 350KB', + iconPreview: '图标预览', + + adminEntry: '管理入口', + adminEntryDescription: '登录按钮显示', + hideLoginButton: '隐藏登录按钮', + showLoginButton: '显示登录按钮', + adminEntryHint: '隐藏后,用户需要直接访问 /admin/login 页面登录', + + // 移动端卡片标题 + siteNameCard: '站点名称', + siteNameCardDesc: '自定义您的站点品牌名称', + siteIconCard: '站点图标', + siteIconCardDesc: '上传自定义图标或输入图标URL', + adminEntryCard: '管理入口', + adminEntryCardDesc: '控制登录按钮在首页的显示', + + // 操作按钮 + save: '保存设置', + saving: '保存中...', + reset: '重置为默认', + lastUpdated: '最后更新:{time}', + lastUpdatedMobile: '上次更新: {time}', + + // Webhook 设置 + enableWebhook: '启用 Webhook 通知', + webhookDescription: '开启后,系统将按配置发送通知到指定平台', + + // 通知类型 + notificationTypes: '通知类型', + accountAnomaly: '账号异常', + quotaWarning: '配额警告', + systemError: '系统错误', + securityAlert: '安全警报', + accountAnomalyDesc: '账号状态异常、认证失败等', + quotaWarningDesc: 'API调用配额不足警告', + systemErrorDesc: '系统运行错误和故障', + securityAlertDesc: '安全相关的警报通知', + + // 通知平台 + notificationPlatforms: '通知平台', + addPlatform: '添加平台', + noPlatforms: '暂无配置的通知平台,请点击"添加平台"按钮添加', + enableSignature: '已启用签名验证', + testConnection: '测试连接', + edit: '编辑', + delete: '删除', + + // 高级设置 + advancedSettings: '高级设置', + maxRetries: '最大重试次数', + retryDelay: '重试延迟 (毫秒)', + timeout: '超时时间 (毫秒)', + + // 测试通知 + sendTestNotification: '发送测试通知', + + // 平台模态框 + addPlatformModal: '添加通知平台', + editPlatformModal: '编辑通知平台', + configurePlatform: '配置新的Webhook通知渠道', + updatePlatform: '配置并更新Webhook通知渠道', + + platformType: '平台类型', + platformName: '名称', + platformNameOptional: '(可选)', + platformNamePlaceholder: '例如:运维群通知、开发测试群', + + webhookUrl: 'Webhook URL', + webhookUrlRequired: '*', + webhookUrlPlaceholder: 'https://...', + editModeWarning: '编辑模式下不能更改平台类型', + + // Bark 特有设置 + deviceKey: '设备密钥 (Device Key)', + deviceKeyPlaceholder: '例如:aBcDeFgHiJkLmNoPqRsTuVwX', + deviceKeyHint: '在Bark App中查看您的推送密钥', + serverAddress: '服务器地址', + serverAddressOptional: '(可选)', + serverAddressPlaceholder: '默认: https://api.day.app/push', + notificationLevel: '通知级别', + notificationSound: '通知声音', + notificationGroup: '通知分组', + notificationGroupOptional: '(可选)', + notificationGroupPlaceholder: '默认: claude-relay', + + // 通知级别选项 + levelAuto: '自动(根据通知类型)', + levelPassive: '被动', + levelActive: '默认', + levelTimeSensitive: '时效性', + levelCritical: '紧急', + + // 声音选项 + soundAuto: '自动(根据通知类型)', + soundDefault: '默认', + soundAlarm: '警报', + soundBell: '铃声', + soundBirdsong: '鸟鸣', + soundElectronic: '电子音', + soundGlass: '玻璃', + soundHorn: '喇叭', + soundSilence: '静音', + + // Bark 提示信息 + barkInstructions: [ + '1. 在iPhone上安装Bark App', + '2. 打开App获取您的设备密钥', + '3. 将密钥粘贴到上方输入框' + ], + + // 签名设置 + enableSignatureVerify: '启用签名验证', + signatureEnabled: '已启用', + signatureSecret: '签名密钥', + signatureSecretPlaceholder: 'SEC...', + + // 平台提示信息 + wechatWorkHint: '请在企业微信群机器人设置中获取Webhook地址', + dingtalkHint: '请在钉钉群机器人设置中获取Webhook地址', + feishuHint: '请在飞书群机器人设置中获取Webhook地址', + slackHint: '请在Slack应用的Incoming Webhooks中获取地址', + discordHint: '请在Discord服务器的集成设置中创建Webhook', + barkHint: '请在Bark App中查看您的设备密钥', + customHint: '请输入完整的Webhook接收地址', + + // 模态框按钮 + required: '必填项', + cancel: '取消', + testing: '测试中...', + saveChanges: '保存修改', + addPlatformBtn: '添加平台', + + // 成功/错误消息 + loadSettingsFailed: '加载设置失败', + settingsSaved: '设置已保存', + saveSettingsFailed: '保存设置失败', + oemSettingsSaved: 'OEM设置保存成功', + oemSettingsSaveFailed: '保存OEM设置失败', + resetToDefault: '已重置为默认设置', + resetFailed: '重置失败', + confirmReset: '确定要重置为默认设置吗?\n\n这将清除所有自定义的网站名称和图标设置。', + + webhookConfigSaved: '配置已保存', + webhookConfigSaveFailed: '保存配置失败', + getWebhookConfigFailed: '获取webhook配置失败', + + platformAdded: '平台已添加', + platformUpdated: '平台已更新', + platformDeleted: '平台已删除', + platformDeleteFailed: '删除失败', + confirmDeletePlatform: '确定要删除这个平台吗?', + operationFailed: '操作失败', + + testSuccess: '测试成功,webhook连接正常', + testFailed: '测试失败', + testNotificationSent: '测试通知已发送', + testNotificationFailed: '发送失败', + + // 表单验证消息 + enterBarkDeviceKey: '请输入Bark设备密钥', + enterWebhookUrl: '请输入Webhook URL', + enterValidWebhookUrl: '请输入有效的Webhook URL', + enterWebhookUrlFirst: '请先输入Webhook URL', + enterBarkDeviceKeyFirst: '请先输入Bark设备密钥', + + // 文件上传 + fileReadFailed: '文件读取失败', + iconLoadFailed: 'Icon failed to load', + + // 平台名称 + platforms: { + wechatWork: '企业微信', + dingtalk: '钉钉', + feishu: '飞书', + slack: 'Slack', + discord: 'Discord', + bark: 'Bark', + custom: '自定义' + } } } diff --git a/web/admin-spa/src/i18n/locales/zh-tw.js b/web/admin-spa/src/i18n/locales/zh-tw.js index 3dcef4d2..2a80c177 100644 --- a/web/admin-spa/src/i18n/locales/zh-tw.js +++ b/web/admin-spa/src/i18n/locales/zh-tw.js @@ -662,5 +662,208 @@ export default { batchSuccess: '成功處理 {count} 個項目', batchPartialFail: '{failed} 個處理失敗', batchAllFailed: '所有項目處理失敗' + }, + + // Settings 設置頁面 + settings: { + title: '系統設置', + description: '網站定制和通知配置', + loading: '正在載入設置...', + + // 導航標籤 + branding: '品牌設置', + webhook: '通知設置', + + // 品牌設置 + siteName: '網站名稱', + siteNameDescription: '品牌標識', + siteNamePlaceholder: 'Claude Relay Service', + siteNameHint: '將顯示在瀏覽器標題和頁面頭部', + + siteIcon: '網站圖標', + siteIconDescription: 'Favicon', + currentIcon: '當前圖標', + uploadIcon: '上傳圖標', + removeIcon: '刪除', + iconFormats: '支援 .ico, .png, .jpg, .svg 格式,最大 350KB', + iconPreview: '圖標預覽', + + adminEntry: '管理入口', + adminEntryDescription: '登入按鈕顯示', + hideLoginButton: '隱藏登入按鈕', + showLoginButton: '顯示登入按鈕', + adminEntryHint: '隱藏後,用戶需要直接訪問 /admin/login 頁面登入', + + // 移動端卡片標題 + siteNameCard: '站點名稱', + siteNameCardDesc: '自定義您的站點品牌名稱', + siteIconCard: '站點圖標', + siteIconCardDesc: '上傳自定義圖標或輸入圖標URL', + adminEntryCard: '管理入口', + adminEntryCardDesc: '控制登入按鈕在首頁的顯示', + + // 操作按鈕 + save: '保存設置', + saving: '保存中...', + reset: '重置為預設', + lastUpdated: '最後更新:{time}', + lastUpdatedMobile: '上次更新: {time}', + + // Webhook 設置 + enableWebhook: '啟用 Webhook 通知', + webhookDescription: '開啟後,系統將按配置發送通知到指定平台', + + // 通知類型 + notificationTypes: '通知類型', + accountAnomaly: '帳號異常', + quotaWarning: '配額警告', + systemError: '系統錯誤', + securityAlert: '安全警報', + accountAnomalyDesc: '帳號狀態異常、認證失敗等', + quotaWarningDesc: 'API調用配額不足警告', + systemErrorDesc: '系統運行錯誤和故障', + securityAlertDesc: '安全相關的警報通知', + + // 通知平台 + notificationPlatforms: '通知平台', + addPlatform: '新增平台', + noPlatforms: '暫無配置的通知平台,請點擊「新增平台」按鈕新增', + enableSignature: '已啟用簽名驗證', + testConnection: '測試連線', + edit: '編輯', + delete: '刪除', + + // 高級設置 + advancedSettings: '進階設置', + maxRetries: '最大重試次數', + retryDelay: '重試延遲 (毫秒)', + timeout: '逾時時間 (毫秒)', + + // 測試通知 + sendTestNotification: '發送測試通知', + + // 平台模態框 + addPlatformModal: '新增通知平台', + editPlatformModal: '編輯通知平台', + configurePlatform: '配置新的Webhook通知渠道', + updatePlatform: '配置並更新Webhook通知渠道', + + platformType: '平台類型', + platformName: '名稱', + platformNameOptional: '(可選)', + platformNamePlaceholder: '例如:運維群通知、開發測試群', + + webhookUrl: 'Webhook URL', + webhookUrlRequired: '*', + webhookUrlPlaceholder: 'https://...', + editModeWarning: '編輯模式下不能更改平台類型', + + // Bark 特有設置 + deviceKey: '設備密鑰 (Device Key)', + deviceKeyPlaceholder: '例如:aBcDeFgHiJkLmNoPqRsTuVwX', + deviceKeyHint: '在Bark App中查看您的推送密鑰', + serverAddress: '伺服器地址', + serverAddressOptional: '(可選)', + serverAddressPlaceholder: '預設: https://api.day.app/push', + notificationLevel: '通知級別', + notificationSound: '通知聲音', + notificationGroup: '通知分組', + notificationGroupOptional: '(可選)', + notificationGroupPlaceholder: '預設: claude-relay', + + // 通知級別選項 + levelAuto: '自動(根據通知類型)', + levelPassive: '被動', + levelActive: '預設', + levelTimeSensitive: '時效性', + levelCritical: '緊急', + + // 聲音選項 + soundAuto: '自動(根據通知類型)', + soundDefault: '預設', + soundAlarm: '警報', + soundBell: '鈴聲', + soundBirdsong: '鳥鳴', + soundElectronic: '電子音', + soundGlass: '玻璃', + soundHorn: '喇叭', + soundSilence: '靜音', + + // Bark 提示信息 + barkInstructions: [ + '1. 在iPhone上安裝Bark App', + '2. 打開App獲取您的設備密鑰', + '3. 將密鑰貼上到上方輸入框' + ], + + // 簽名設置 + enableSignatureVerify: '啟用簽名驗證', + signatureEnabled: '已啟用', + signatureSecret: '簽名密鑰', + signatureSecretPlaceholder: 'SEC...', + + // 平台提示信息 + wechatWorkHint: '請在企業微信群機器人設置中獲取Webhook地址', + dingtalkHint: '請在釘釘群機器人設置中獲取Webhook地址', + feishuHint: '請在飛書群機器人設置中獲取Webhook地址', + slackHint: '請在Slack應用的Incoming Webhooks中獲取地址', + discordHint: '請在Discord伺服器的整合設置中建立Webhook', + barkHint: '請在Bark App中查看您的設備密鑰', + customHint: '請輸入完整的Webhook接收地址', + + // 模態框按鈕 + required: '必填項', + cancel: '取消', + testing: '測試中...', + saveChanges: '保存修改', + addPlatformBtn: '新增平台', + + // 成功/錯誤消息 + loadSettingsFailed: '載入設置失敗', + settingsSaved: '設置已保存', + saveSettingsFailed: '保存設置失敗', + oemSettingsSaved: 'OEM設置保存成功', + oemSettingsSaveFailed: '保存OEM設置失敗', + resetToDefault: '已重置為預設設置', + resetFailed: '重置失敗', + confirmReset: '確定要重置為預設設置嗎?\n\n這將清除所有自定義的網站名稱和圖標設置。', + + webhookConfigSaved: '配置已保存', + webhookConfigSaveFailed: '保存配置失敗', + getWebhookConfigFailed: '獲取webhook配置失敗', + + platformAdded: '平台已新增', + platformUpdated: '平台已更新', + platformDeleted: '平台已刪除', + platformDeleteFailed: '刪除失敗', + confirmDeletePlatform: '確定要刪除這個平台嗎?', + operationFailed: '操作失敗', + + testSuccess: '測試成功,webhook連線正常', + testFailed: '測試失敗', + testNotificationSent: '測試通知已發送', + testNotificationFailed: '發送失敗', + + // 表單驗證消息 + enterBarkDeviceKey: '請輸入Bark設備密鑰', + enterWebhookUrl: '請輸入Webhook URL', + enterValidWebhookUrl: '請輸入有效的Webhook URL', + enterWebhookUrlFirst: '請先輸入Webhook URL', + enterBarkDeviceKeyFirst: '請先輸入Bark設備密鑰', + + // 檔案上傳 + fileReadFailed: '檔案讀取失敗', + iconLoadFailed: 'Icon failed to load', + + // 平台名稱 + platforms: { + wechatWork: '企業微信', + dingtalk: '釘釘', + feishu: '飛書', + slack: 'Slack', + discord: 'Discord', + bark: 'Bark', + custom: '自定義' + } } } diff --git a/web/admin-spa/src/views/SettingsView.vue b/web/admin-spa/src/views/SettingsView.vue index 4c6355c5..e53a8999 100644 --- a/web/admin-spa/src/views/SettingsView.vue +++ b/web/admin-spa/src/views/SettingsView.vue @@ -4,9 +4,9 @@

- 系统设置 + {{ t('settings.title') }}

-

网站定制和通知配置

+

{{ t('settings.description') }}

@@ -22,7 +22,7 @@ @click="activeSection = 'branding'" > - 品牌设置 + {{ t('settings.branding') }} @@ -42,7 +42,7 @@
-

正在加载设置...

+

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

@@ -64,9 +64,9 @@
- 网站名称 + {{ t('settings.siteName') }}
-
品牌标识
+
{{ t('settings.siteNameDescription') }}
@@ -75,11 +75,11 @@ v-model="oemSettings.siteName" class="form-input w-full max-w-md dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200" maxlength="100" - placeholder="Claude Relay Service" +:placeholder="t('settings.siteNamePlaceholder')" type="text" />

- 将显示在浏览器标题和页面头部 + {{ t('settings.siteNameHint') }}

@@ -95,9 +95,9 @@
- 网站图标 + {{ t('settings.siteIcon') }}
-
Favicon
+
{{ t('settings.siteIconDescription') }}
@@ -109,17 +109,17 @@ class="inline-flex items-center gap-3 rounded-lg bg-gray-50 p-3 dark:bg-gray-700" > 图标预览 - 当前图标 + {{ t('settings.currentIcon') }} @@ -137,10 +137,10 @@ @click="$refs.iconFileInput.click()" > - 上传图标 + {{ t('settings.uploadIcon') }} 支持 .ico, .png, .jpg, .svg 格式,最大 350KB{{ t('settings.iconFormats') }} @@ -158,9 +158,9 @@
- 管理入口 + {{ t('settings.adminEntry') }}
-
登录按钮显示
+
{{ t('settings.adminEntryDescription') }}
@@ -172,12 +172,12 @@ class="peer relative h-6 w-11 rounded-full bg-gray-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:border-gray-600 dark:bg-gray-700 dark:peer-focus:ring-blue-800" > {{ - hideAdminButton ? '隐藏登录按钮' : '显示登录按钮' + hideAdminButton ? t('settings.hideLoginButton') : t('settings.showLoginButton') }}

- 隐藏后,用户需要直接访问 /admin/login 页面登录 + {{ t('settings.adminEntryHint') }}

@@ -195,7 +195,7 @@ >
- {{ saving ? '保存中...' : '保存设置' }} + {{ saving ? t('settings.saving') : t('settings.save') }} @@ -213,7 +213,7 @@ class="text-sm text-gray-500 dark:text-gray-400" > - 最后更新:{{ formatDateTime(oemSettings.updatedAt) }} + {{ t('settings.lastUpdated', { time: formatDateTime(oemSettings.updatedAt) }) }} @@ -233,15 +233,15 @@
-

站点名称

-

自定义您的站点品牌名称

+

{{ t('settings.siteNameCard') }}

+

{{ t('settings.siteNameCardDesc') }}

@@ -255,9 +255,9 @@
-

站点图标

+

{{ t('settings.siteIconCard') }}

- 上传自定义图标或输入图标URL + {{ t('settings.siteIconCardDesc') }}

@@ -268,17 +268,17 @@ class="inline-flex items-center gap-3 rounded-lg bg-gray-50 p-3 dark:bg-gray-700" > 图标预览 - 当前图标 + {{ t('settings.currentIcon') }} @@ -296,10 +296,10 @@ @click="$refs.iconFileInputMobile.click()" > - 上传图标 + {{ t('settings.uploadIcon') }}

- 支持 .ico, .png, .jpg, .svg 格式,最大 350KB + {{ t('settings.iconFormats') }}

@@ -314,8 +314,8 @@
-

管理入口

-

控制登录按钮在首页的显示

+

{{ t('settings.adminEntryCard') }}

+

{{ t('settings.adminEntryCardDesc') }}

@@ -325,11 +325,11 @@ class="peer relative h-6 w-11 rounded-full bg-gray-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:border-gray-600 dark:bg-gray-700 dark:peer-focus:ring-blue-800" >
{{ - hideAdminButton ? '隐藏登录按钮' : '显示登录按钮' + hideAdminButton ? t('settings.hideLoginButton') : t('settings.showLoginButton') }}

- 隐藏后,用户需要直接访问 /admin/login 页面登录 + {{ t('settings.adminEntryHint') }}

@@ -345,7 +345,7 @@ >
- {{ saving ? '保存中...' : '保存设置' }} + {{ saving ? t('settings.saving') : t('settings.save') }}
- 上次更新: {{ formatDateTime(oemSettings.updatedAt) }} + {{ t('settings.lastUpdatedMobile', { time: formatDateTime(oemSettings.updatedAt) }) }}
@@ -377,9 +377,11 @@ >
-

启用通知

+

+ {{ t('settings.enableWebhook') }} +

- 开启后,系统将按配置发送通知到指定平台 + {{ t('settings.webhookDescription') }}