feat(dashboard): 展示账号 cli_disabled 状态 - #155
Open
weselow wants to merge 2 commits into
Open
Conversation
上游 f6158f1 默认关闭 CLI(ENABLE_CLI=false)后新增 kind='cli_disabled', 面板只处理了 cli_unsupported / cli_pending,该状态会落到通用分支并显示 0 / 2000 次调用。 - STATUS_EMOJI 增加 cli_disabled: '⚫' - 合并 cli_unsupported / cli_disabled 两个视觉相同的分支为 isCliInactive() - getStatusTooltip 增加 cli_disabled 分支 - 三语新增 cliDisabledShort 与 status.cliDisabled - 顺带修正俄文 cliPending 语序(CLI инициализация -> Инициализация CLI) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
f6158f1 默认关闭 CLI 之后,
src/utils/cli-support.js新增了kind = 'cli_disabled'。面板只处理
cli_unsupported和cli_pending,新状态落入通用分支:卡片显示"CLI 今日:0 / 2000 次调用" 和归零的进度条。
看起来像"CLI 可用,只是没人调用",实际是服务端关掉了。
ENABLE_CLI现在默认关闭,所以没有显式设置该变量的部署,每个账号都会这样显示。
改动
STATUS_EMOJI增加cli_disabled: '⚫'cli_unsupported与cli_disabled视觉完全相同,两个模板分支合并为isCliInactive(),避免第三份几乎重复的模板
cliDisabledShort与status.cliDisabledcliPending语序:CLI инициализация→Инициализация CLItests/dashboard-cli-unsupported.test.js验证
node --test tests/*.test.js—— 38 项全部通过cd public && npm run build通过Русский перевод
Проблема
После f6158f1 (CLI выключен по умолчанию) в
src/utils/cli-support.jsпоявилосьсостояние
kind = 'cli_disabled'. Панель обрабатывает толькоcli_unsupportedи
cli_pending, поэтому новое состояние попадает в общую ветку: карточкапоказывает «CLI (сегодня): 0 / 2000 запросов» и полосу прогресса на нуле.
Читается как «CLI доступен, просто им не пользовались», хотя на деле его выключил
сервер. Раз
ENABLE_CLIтеперь выключен по умолчанию, так будет выглядеть каждыйаккаунт в любой установке, где переменную не задали явно.
Изменения
STATUS_EMOJIпополнен значкомcli_disabled: '⚫'«CLI отключён на сервере (ENABLE_CLI=false)»
cli_unsupportedиcli_disabledвыглядят одинаково, поэтому две ветки шаблонаобъединены в
isCliInactive()— иначе появился бы третий почти одинаковый кусокcliDisabledShortиstatus.cliDisabledcliPending:CLI инициализация→Инициализация CLItests/dashboard-cli-unsupported.test.jsобновлён и расширенПроверка
node --test tests/*.test.js— 38 из 38 проходятподписи и подсказки верны во всех трёх языках
cd public && npm run buildпроходит