feat(web): 项目配置面板补全——checks/自动放行/agentRules/预算/角色模型编辑
此前 checks、autoApprovePlan/Exec、agentRules、budgetUsd、models 只能经 API 改,
看板无编辑口。现扩展项目「配置」面板:
- 分项检查:lint / typecheck / build 三命令(拼成 checks JSON,全空=null)
- 硬闸/自动放行:autoApprovePlan / autoApproveExec 两个勾选
- 角色模型:executor/planner/reviewer/conflict 四个输入(填模型 id 字符串,
或 {"easy":..,"hard":..} JSON;留空=默认 opus-4.8;非法 JSON 提示报错)
- 项目 Agent 规范(agentRules)textarea
- 成本预算:budgetUsd + budgetPeriod(按天/月)
toggle-config 回填全部新字段;save-config 一并 PATCH。新增 zh/en i18n 标签 +
.cfg-subhead/.cfg-check 样式。web/ 静态、无需 rebuild。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -91,6 +91,59 @@
|
||||
<input id="cfgModel" type="text" data-i18n-ph="modelPh" placeholder="claude-opus-4-5(可空,留空用全局默认)" autocomplete="off">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="cfg-subhead" data-i18n="cfgChecks">分项检查(lint / typecheck / build)</div>
|
||||
<div class="form-row">
|
||||
<label class="grow"><span data-i18n="cfgLint">lint 命令</span>
|
||||
<input id="cfgLint" type="text" data-i18n-ph="cfgCmdPh" placeholder="留空=跳过此项" autocomplete="off">
|
||||
</label>
|
||||
<label class="grow"><span data-i18n="cfgTypecheck">typecheck 命令</span>
|
||||
<input id="cfgTypecheck" type="text" data-i18n-ph="cfgCmdPh" placeholder="留空=跳过此项" autocomplete="off">
|
||||
</label>
|
||||
<label class="grow"><span data-i18n="cfgBuild">build 命令</span>
|
||||
<input id="cfgBuild" type="text" data-i18n-ph="cfgCmdPh" placeholder="留空=跳过此项" autocomplete="off">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="cfg-subhead" data-i18n="cfgGates">硬闸 / 自动放行</div>
|
||||
<div class="form-row cfg-checks-row">
|
||||
<label class="cfg-check"><input id="cfgAutoPlan" type="checkbox"> <span data-i18n="cfgAutoPlan">自动放行 plan</span></label>
|
||||
<label class="cfg-check"><input id="cfgAutoExec" type="checkbox"> <span data-i18n="cfgAutoExec">自动放行 exec</span></label>
|
||||
</div>
|
||||
|
||||
<div class="cfg-subhead" data-i18n="cfgModels">角色模型(留空=默认 opus-4.8)</div>
|
||||
<div class="form-row">
|
||||
<label class="grow"><span data-i18n="cfgMdlExecutor">executor</span>
|
||||
<input id="cfgMdlExecutor" type="text" placeholder="claude-opus-4-8" autocomplete="off">
|
||||
</label>
|
||||
<label class="grow"><span data-i18n="cfgMdlPlanner">planner</span>
|
||||
<input id="cfgMdlPlanner" type="text" placeholder="claude-opus-4-8" autocomplete="off">
|
||||
</label>
|
||||
<label class="grow"><span data-i18n="cfgMdlReviewer">reviewer</span>
|
||||
<input id="cfgMdlReviewer" type="text" placeholder="claude-opus-4-8" autocomplete="off">
|
||||
</label>
|
||||
<label class="grow"><span data-i18n="cfgMdlConflict">conflict</span>
|
||||
<input id="cfgMdlConflict" type="text" placeholder="claude-opus-4-8" autocomplete="off">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label class="grow"><span data-i18n="cfgAgentRules">项目 Agent 规范</span>
|
||||
<textarea id="cfgAgentRules" rows="3" data-i18n-ph="cfgAgentRulesPh" placeholder="项目专属执行约定、风格、禁忌……(可空)" autocomplete="off"></textarea>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label class="narrow"><span data-i18n="cfgBudget">成本预算</span>
|
||||
<input id="cfgBudget" type="number" min="0" step="0.5" data-i18n-ph="cfgBudgetPh" placeholder="USD 上限(可空=不限)" autocomplete="off">
|
||||
</label>
|
||||
<label class="narrow"><span> </span>
|
||||
<select id="cfgBudgetPeriod">
|
||||
<option value="month" data-i18n="cfgBudgetMonth">按月</option>
|
||||
<option value="day" data-i18n="cfgBudgetDay">按天</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-row cfg-sync-row">
|
||||
<span id="syncMeta" class="sync-meta"></span>
|
||||
<button id="btnSync" class="btn btn-xs" data-action="sync-todo"><svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5" stroke="var(--icon-accent,#5fdd7d)"/></svg> <span data-i18n="sync">同步 todo</span></button>
|
||||
|
||||
Reference in New Issue
Block a user