mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-03 03:10:50 +08:00
feat(auth-files): add AI Studio and Gemini CLI with filename masking
This commit is contained in:
18
app.js
18
app.js
@@ -3398,6 +3398,12 @@ class CLIProxyManager {
|
|||||||
possibleSources.push(maskedPersonalId);
|
possibleSources.push(maskedPersonalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 规则3:AI Studio 特殊处理 - 对完整文件名脱敏
|
||||||
|
if (nameWithoutExt.startsWith('aistudio-')) {
|
||||||
|
const maskedFullName = this.maskApiKey(nameWithoutExt);
|
||||||
|
possibleSources.push(maskedFullName);
|
||||||
|
}
|
||||||
|
|
||||||
// 查找第一个有统计数据的匹配
|
// 查找第一个有统计数据的匹配
|
||||||
for (const source of possibleSources) {
|
for (const source of possibleSources) {
|
||||||
if (stats[source] && (stats[source].success > 0 || stats[source].failure > 0)) {
|
if (stats[source] && (stats[source].success > 0 || stats[source].failure > 0)) {
|
||||||
@@ -3418,6 +3424,12 @@ class CLIProxyManager {
|
|||||||
case 'gemini':
|
case 'gemini':
|
||||||
typeDisplayKey = 'auth_files.type_gemini';
|
typeDisplayKey = 'auth_files.type_gemini';
|
||||||
break;
|
break;
|
||||||
|
case 'gemini-cli':
|
||||||
|
typeDisplayKey = 'auth_files.type_gemini-cli';
|
||||||
|
break;
|
||||||
|
case 'aistudio':
|
||||||
|
typeDisplayKey = 'auth_files.type_aistudio';
|
||||||
|
break;
|
||||||
case 'claude':
|
case 'claude':
|
||||||
typeDisplayKey = 'auth_files.type_claude';
|
typeDisplayKey = 'auth_files.type_claude';
|
||||||
break;
|
break;
|
||||||
@@ -3487,6 +3499,8 @@ class CLIProxyManager {
|
|||||||
{ type: 'all', labelKey: 'auth_files.filter_all' },
|
{ type: 'all', labelKey: 'auth_files.filter_all' },
|
||||||
{ type: 'qwen', labelKey: 'auth_files.filter_qwen' },
|
{ type: 'qwen', labelKey: 'auth_files.filter_qwen' },
|
||||||
{ type: 'gemini', labelKey: 'auth_files.filter_gemini' },
|
{ type: 'gemini', labelKey: 'auth_files.filter_gemini' },
|
||||||
|
{ type: 'gemini-cli', labelKey: 'auth_files.filter_gemini-cli' },
|
||||||
|
{ type: 'aistudio', labelKey: 'auth_files.filter_aistudio' },
|
||||||
{ type: 'claude', labelKey: 'auth_files.filter_claude' },
|
{ type: 'claude', labelKey: 'auth_files.filter_claude' },
|
||||||
{ type: 'codex', labelKey: 'auth_files.filter_codex' },
|
{ type: 'codex', labelKey: 'auth_files.filter_codex' },
|
||||||
{ type: 'iflow', labelKey: 'auth_files.filter_iflow' },
|
{ type: 'iflow', labelKey: 'auth_files.filter_iflow' },
|
||||||
@@ -4648,7 +4662,7 @@ class CLIProxyManager {
|
|||||||
try {
|
try {
|
||||||
const response = await this.makeRequest('/usage');
|
const response = await this.makeRequest('/usage');
|
||||||
const usage = response?.usage || null;
|
const usage = response?.usage || null;
|
||||||
|
|
||||||
if (!usage) {
|
if (!usage) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@@ -4665,7 +4679,7 @@ class CLIProxyManager {
|
|||||||
details.forEach(detail => {
|
details.forEach(detail => {
|
||||||
const source = detail.source;
|
const source = detail.source;
|
||||||
if (!source) return;
|
if (!source) return;
|
||||||
|
|
||||||
if (!sourceStats[source]) {
|
if (!sourceStats[source]) {
|
||||||
sourceStats[source] = {
|
sourceStats[source] = {
|
||||||
success: 0,
|
success: 0,
|
||||||
|
|||||||
8
i18n.js
8
i18n.js
@@ -225,6 +225,8 @@ const i18n = {
|
|||||||
'auth_files.filter_all': '全部',
|
'auth_files.filter_all': '全部',
|
||||||
'auth_files.filter_qwen': 'Qwen',
|
'auth_files.filter_qwen': 'Qwen',
|
||||||
'auth_files.filter_gemini': 'Gemini',
|
'auth_files.filter_gemini': 'Gemini',
|
||||||
|
'auth_files.filter_gemini-cli': 'GeminiCLI',
|
||||||
|
'auth_files.filter_aistudio': 'AIStudio',
|
||||||
'auth_files.filter_claude': 'Claude',
|
'auth_files.filter_claude': 'Claude',
|
||||||
'auth_files.filter_codex': 'Codex',
|
'auth_files.filter_codex': 'Codex',
|
||||||
'auth_files.filter_iflow': 'iFlow',
|
'auth_files.filter_iflow': 'iFlow',
|
||||||
@@ -232,6 +234,8 @@ const i18n = {
|
|||||||
'auth_files.filter_unknown': '其他',
|
'auth_files.filter_unknown': '其他',
|
||||||
'auth_files.type_qwen': 'Qwen',
|
'auth_files.type_qwen': 'Qwen',
|
||||||
'auth_files.type_gemini': 'Gemini',
|
'auth_files.type_gemini': 'Gemini',
|
||||||
|
'auth_files.type_gemini-cli': 'GeminiCLI',
|
||||||
|
'auth_files.type_aistudio': 'AIStudio',
|
||||||
'auth_files.type_claude': 'Claude',
|
'auth_files.type_claude': 'Claude',
|
||||||
'auth_files.type_codex': 'Codex',
|
'auth_files.type_codex': 'Codex',
|
||||||
'auth_files.type_iflow': 'iFlow',
|
'auth_files.type_iflow': 'iFlow',
|
||||||
@@ -667,6 +671,8 @@ const i18n = {
|
|||||||
'auth_files.filter_all': 'All',
|
'auth_files.filter_all': 'All',
|
||||||
'auth_files.filter_qwen': 'Qwen',
|
'auth_files.filter_qwen': 'Qwen',
|
||||||
'auth_files.filter_gemini': 'Gemini',
|
'auth_files.filter_gemini': 'Gemini',
|
||||||
|
'auth_files.filter_gemini-cli': 'GeminiCLI',
|
||||||
|
'auth_files.filter_aistudio': 'AIStudio',
|
||||||
'auth_files.filter_claude': 'Claude',
|
'auth_files.filter_claude': 'Claude',
|
||||||
'auth_files.filter_codex': 'Codex',
|
'auth_files.filter_codex': 'Codex',
|
||||||
'auth_files.filter_iflow': 'iFlow',
|
'auth_files.filter_iflow': 'iFlow',
|
||||||
@@ -674,6 +680,8 @@ const i18n = {
|
|||||||
'auth_files.filter_unknown': 'Other',
|
'auth_files.filter_unknown': 'Other',
|
||||||
'auth_files.type_qwen': 'Qwen',
|
'auth_files.type_qwen': 'Qwen',
|
||||||
'auth_files.type_gemini': 'Gemini',
|
'auth_files.type_gemini': 'Gemini',
|
||||||
|
'auth_files.type_gemini-cli': 'GeminiCLI',
|
||||||
|
'auth_files.type_aistudio': 'AIStudio',
|
||||||
'auth_files.type_claude': 'Claude',
|
'auth_files.type_claude': 'Claude',
|
||||||
'auth_files.type_codex': 'Codex',
|
'auth_files.type_codex': 'Codex',
|
||||||
'auth_files.type_iflow': 'iFlow',
|
'auth_files.type_iflow': 'iFlow',
|
||||||
|
|||||||
@@ -427,6 +427,8 @@
|
|||||||
<button class="filter-btn active" data-type="all" data-i18n-text="auth_files.filter_all">All</button>
|
<button class="filter-btn active" data-type="all" data-i18n-text="auth_files.filter_all">All</button>
|
||||||
<button class="filter-btn" data-type="qwen" data-i18n-text="auth_files.filter_qwen">Qwen</button>
|
<button class="filter-btn" data-type="qwen" data-i18n-text="auth_files.filter_qwen">Qwen</button>
|
||||||
<button class="filter-btn" data-type="gemini" data-i18n-text="auth_files.filter_gemini">Gemini</button>
|
<button class="filter-btn" data-type="gemini" data-i18n-text="auth_files.filter_gemini">Gemini</button>
|
||||||
|
<button class="filter-btn" data-type="gemini-cli" data-i18n-text="auth_files.filter_gemini-cli">GeminiCLI</button>
|
||||||
|
<button class="filter-btn" data-type="aistudio" data-i18n-text="auth_files.filter_aistudio">AIStudio</button>
|
||||||
<button class="filter-btn" data-type="claude" data-i18n-text="auth_files.filter_claude">Claude</button>
|
<button class="filter-btn" data-type="claude" data-i18n-text="auth_files.filter_claude">Claude</button>
|
||||||
<button class="filter-btn" data-type="codex" data-i18n-text="auth_files.filter_codex">Codex</button>
|
<button class="filter-btn" data-type="codex" data-i18n-text="auth_files.filter_codex">Codex</button>
|
||||||
<button class="filter-btn" data-type="iflow" data-i18n-text="auth_files.filter_iflow">iFlow</button>
|
<button class="filter-btn" data-type="iflow" data-i18n-text="auth_files.filter_iflow">iFlow</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user