mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 00:53:33 +00:00
fix(admin-spa): 完善账户管理代理信息显示功能
- 修复账户列表中代理信息显示,支持用户名密码部分隐藏 - 修复编辑账户时自动勾选代理设置并正确显示代理信息 - 改进代理密码输入框使用密码类型 - 将 admin-spa/dist 目录加入 .gitignore 并从版本控制中移除 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -130,8 +130,8 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">
|
||||
<div v-if="account.proxy" class="text-xs bg-blue-50 px-2 py-1 rounded">
|
||||
{{ account.proxy.type }}://{{ account.proxy.host }}:{{ account.proxy.port }}
|
||||
<div v-if="formatProxyDisplay(account.proxy)" class="text-xs bg-blue-50 px-2 py-1 rounded font-mono">
|
||||
{{ formatProxyDisplay(account.proxy) }}
|
||||
</div>
|
||||
<div v-else class="text-gray-400">无代理</div>
|
||||
</td>
|
||||
@@ -403,6 +403,24 @@ const loadApiKeys = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 格式化代理信息显示
|
||||
const formatProxyDisplay = (proxy) => {
|
||||
if (!proxy || !proxy.host || !proxy.port) return null
|
||||
|
||||
let display = `${proxy.type}://${proxy.host}:${proxy.port}`
|
||||
|
||||
// 如果有用户名密码,添加认证信息(部分隐藏)
|
||||
if (proxy.username) {
|
||||
const maskedUsername = proxy.username.length > 2
|
||||
? proxy.username[0] + '***' + proxy.username[proxy.username.length - 1]
|
||||
: '***'
|
||||
const maskedPassword = proxy.password ? '****' : ''
|
||||
display = `${proxy.type}://${maskedUsername}:${maskedPassword}@${proxy.host}:${proxy.port}`
|
||||
}
|
||||
|
||||
return display
|
||||
}
|
||||
|
||||
// 格式化会话窗口时间
|
||||
const formatSessionWindow = (windowStart, windowEnd) => {
|
||||
if (!windowStart || !windowEnd) return '--'
|
||||
|
||||
Reference in New Issue
Block a user