feat: Implement admin settings UI, enhance admin authentication with password hashing, and add new streaming runtime logic for Claude and OpenAI adapters with extensive compatibility tests.

This commit is contained in:
CJACK
2026-02-19 02:45:38 +08:00
parent d21aedac83
commit 7307a5cc9a
64 changed files with 4078 additions and 967 deletions

View File

@@ -20,6 +20,10 @@
"vercel": {
"label": "Vercel Sync",
"desc": "Sync configuration to Vercel"
},
"settings": {
"label": "Settings",
"desc": "Edit runtime and security settings online"
}
},
"sidebar": {
@@ -192,6 +196,51 @@
"importComplete": "Import complete",
"importSummary": "Imported {keys} API keys and updated {accounts} accounts."
},
"settings": {
"loadFailed": "Failed to load settings.",
"save": "Save settings",
"saving": "Saving...",
"saveSuccess": "Settings saved and hot reloaded.",
"saveFailed": "Failed to save settings.",
"securityTitle": "Security",
"jwtExpireHours": "JWT expiry (hours)",
"newPassword": "New admin password",
"newPasswordPlaceholder": "Enter new password (min 4 chars)",
"updatePassword": "Update password",
"updating": "Updating...",
"passwordTooShort": "Password must be at least 4 characters.",
"passwordUpdated": "Password updated. Please sign in again.",
"passwordUpdateFailed": "Failed to update password.",
"runtimeTitle": "Concurrency & Queue",
"accountMaxInflight": "Per-account max inflight",
"accountMaxQueue": "Account max queue size",
"globalMaxInflight": "Global max inflight",
"behaviorTitle": "Behavior",
"toolcallMode": "Toolcall mode",
"earlyEmitConfidence": "Early emit confidence",
"responsesTTL": "Responses store TTL (seconds)",
"embeddingsProvider": "Embeddings provider",
"modelTitle": "Model mapping",
"claudeMapping": "Claude mapping (JSON)",
"modelAliases": "Model aliases (JSON)",
"backupTitle": "Backup & Restore",
"loadExport": "Load current export",
"importModeMerge": "Merge import (default)",
"importModeReplace": "Replace all import",
"importNow": "Import now",
"importing": "Importing...",
"importPlaceholder": "Paste config JSON to import",
"importEmpty": "Please input import JSON.",
"importInvalidJson": "Import JSON is invalid.",
"importFailed": "Import failed.",
"importSuccess": "Config imported (mode: {mode}).",
"exportFailed": "Export failed.",
"exportLoaded": "Current export loaded.",
"exportJson": "Export JSON",
"invalidJsonField": "{field} is not a valid JSON object.",
"defaultPasswordWarning": "You are using the default admin password \"admin\". Please change it.",
"vercelSyncHint": "Configuration changed. For Vercel deployments, sync manually in Vercel Sync and redeploy."
},
"login": {
"welcome": "Welcome back",
"subtitle": "Enter your admin key to continue",

View File

@@ -20,6 +20,10 @@
"vercel": {
"label": "Vercel 同步",
"desc": "同步配置到 Vercel"
},
"settings": {
"label": "设置中心",
"desc": "在线修改系统设置与配置"
}
},
"sidebar": {
@@ -192,6 +196,51 @@
"importComplete": "导入操作已完成",
"importSummary": "成功导入了 {keys} 个 API 密钥,并更新了 {accounts} 个账号。"
},
"settings": {
"loadFailed": "加载设置失败",
"save": "保存设置",
"saving": "保存中...",
"saveSuccess": "设置已保存并热更新生效",
"saveFailed": "保存设置失败",
"securityTitle": "安全设置",
"jwtExpireHours": "JWT 有效期(小时)",
"newPassword": "面板新密码",
"newPasswordPlaceholder": "输入新密码(至少 4 位)",
"updatePassword": "修改密码",
"updating": "更新中...",
"passwordTooShort": "新密码至少 4 位",
"passwordUpdated": "密码已更新,需重新登录",
"passwordUpdateFailed": "密码更新失败",
"runtimeTitle": "并发与队列",
"accountMaxInflight": "每账号并发上限",
"accountMaxQueue": "账号等待队列上限",
"globalMaxInflight": "全局并发上限",
"behaviorTitle": "行为设置",
"toolcallMode": "Toolcall 模式",
"earlyEmitConfidence": "早发置信度",
"responsesTTL": "Responses 缓存 TTL",
"embeddingsProvider": "Embeddings Provider",
"modelTitle": "模型映射",
"claudeMapping": "Claude 映射JSON",
"modelAliases": "模型别名JSON",
"backupTitle": "备份与恢复",
"loadExport": "加载当前导出",
"importModeMerge": "合并导入(默认)",
"importModeReplace": "全量覆盖导入",
"importNow": "立即导入",
"importing": "导入中...",
"importPlaceholder": "粘贴要导入的 JSON 配置",
"importEmpty": "请先输入导入 JSON",
"importInvalidJson": "导入 JSON 格式无效",
"importFailed": "导入失败",
"importSuccess": "配置导入成功(模式:{mode}",
"exportFailed": "导出失败",
"exportLoaded": "已加载当前配置导出",
"exportJson": "导出 JSON",
"invalidJsonField": "{field} 不是有效 JSON 对象",
"defaultPasswordWarning": "当前使用默认密码 admin请尽快在此修改。",
"vercelSyncHint": "当前配置已更新。Vercel 部署请到 Vercel 同步页面手动同步并重部署。"
},
"login": {
"welcome": "欢迎回来",
"subtitle": "请输入管理员密钥以继续",