${i18n.t('ai_providers.claude_item_title')} #${index + 1}
-
${i18n.t('common.api_key')}: ${this.maskApiKey(config['api-key'])}
+
${i18n.t('common.api_key')}: ${maskedDisplay}
${config['base-url'] ? `
${i18n.t('common.base_url')}: ${this.escapeHtml(config['base-url'])}
` : ''}
${config['proxy-url'] ? `
${i18n.t('common.proxy_url')}: ${this.escapeHtml(config['proxy-url'])}
` : ''}
${this.renderHeaderBadges(config.headers)}
@@ -3326,7 +3340,7 @@ class CLIProxyManager {
-
@@ -3572,6 +3586,7 @@ class CLIProxyManager {
totalFailure += keyStats.failure;
});
+ const deleteArg = JSON.stringify(name).replace(/"/g, '"');
return `
@@ -3594,7 +3609,7 @@ class CLIProxyManager {
-
+
@@ -3865,14 +3880,16 @@ class CLIProxyManager {
this.updateFilterButtons(existingTypes);
container.innerHTML = visibleFiles.map(file => {
+ const rawFileName = typeof file.name === 'string' ? file.name : '';
+ const safeFileName = this.escapeHtml(rawFileName);
// 认证文件的统计匹配逻辑:
// 1. 首先尝试完整文件名匹配
// 2. 如果没有匹配,尝试脱敏文件名匹配(去掉扩展名后的脱敏版本)
- let fileStats = stats[file.name] || { success: 0, failure: 0 };
+ let fileStats = stats[rawFileName] || { success: 0, failure: 0 };
// 如果完整文件名没有统计,尝试基于文件名的脱敏版本匹配
if (fileStats.success === 0 && fileStats.failure === 0) {
- const nameWithoutExt = file.name.replace(/\.[^/.]+$/, ""); // 去掉扩展名
+ const nameWithoutExt = rawFileName.replace(/\.[^/.]+$/, ""); // 去掉扩展名
const possibleSources = [];
@@ -3959,7 +3976,7 @@ class CLIProxyManager {
虚拟认证文件
` : `
-
+
@@ -3972,9 +3989,9 @@ class CLIProxyManager {
`;
return `
-
+
-
${typeBadge}${file.name}
+
${typeBadge}${safeFileName}