From d422606f993c3bf371635944ac49cc3779393d25 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Thu, 13 Nov 2025 09:22:14 +0800 Subject: [PATCH] feat(app.js, styles.css): add main flag for Gemini CLI auth files, update styles and filtering logic --- app.js | 28 ++++++++++++++++++++++++---- styles.css | 15 +++++++++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 3939d6f..a891dea 100644 --- a/app.js +++ b/app.js @@ -3845,7 +3845,22 @@ class CLIProxyManager { // 渲染认证文件列表 async renderAuthFiles(files, keyStats = null) { const container = document.getElementById('auth-files-list'); - const visibleFiles = Array.isArray(files) ? files.filter(file => file.disabled !== true) : []; + const isRuntimeOnlyFile = (file) => { + if (!file) return false; + const runtimeValue = file.runtime_only; + return runtimeValue === true || runtimeValue === 'true'; + }; + const shouldDisplayDisabledGeminiCli = (file) => { + if (!file) return false; + const provider = typeof file.provider === 'string' ? file.provider.toLowerCase() : ''; + const type = typeof file.type === 'string' ? file.type.toLowerCase() : ''; + const isGeminiCli = provider === 'gemini-cli' || type === 'gemini-cli'; + return isGeminiCli && !isRuntimeOnlyFile(file); + }; + const visibleFiles = Array.isArray(files) ? files.filter(file => { + if (!file) return false; + return shouldDisplayDisabledGeminiCli(file) || file.disabled !== true; + }) : []; this.cachedAuthFiles = visibleFiles.map(file => ({ ...file })); if (visibleFiles.length === 0) { @@ -3968,15 +3983,20 @@ class CLIProxyManager { } const typeBadge = `${i18n.t(typeDisplayKey)}`; - // 检查是否为 runtime-only 文件 - const isRuntimeOnly = file.runtime_only === true; + // Determine whether the entry is runtime-only + const isRuntimeOnly = isRuntimeOnlyFile(file); - // 生成操作按钮 HTML,runtime-only 文件显示虚拟标记 + const shouldShowMainFlag = shouldDisplayDisabledGeminiCli(file); + const mainFlagButton = shouldShowMainFlag ? ` + ` : ''; + + // Build action buttons; runtime-only entries display placeholder badge const actionsHtml = isRuntimeOnly ? `
虚拟认证文件
` : `
+ ${mainFlagButton} diff --git a/styles.css b/styles.css index b4fb72c..6c5e3bd 100644 --- a/styles.css +++ b/styles.css @@ -1248,6 +1248,21 @@ body { transform: translateY(-1px); } +.btn-small.btn-warning { + background: #ff9800; + color: #fff; + border-color: #ff9800; + cursor: default; +} + +.btn-small.btn-warning:disabled, +.btn-small.btn-warning[disabled] { + background: #fb8c00; + border-color: #fb8c00; + color: #fff; + opacity: 1; +} + .btn-small i { font-size: 13px; }