恢复终止能力:状态胶囊旁新增小号「终止」链接(仅活跃中显示),点击调 /stop;updatePhaseUI 按状态显隐

This commit is contained in:
2026-08-31 14:14:45 +08:00
parent ecbe6f1825
commit 3a6ee033c5
3 changed files with 15 additions and 0 deletions
+9
View File
@@ -314,6 +314,8 @@ function updatePhaseUI(d) {
text = '活跃中' + (d && d.model_id ? ' · ' + d.model_id : '');
}
pill.textContent = text;
// 仅活跃中提供终止入口
$('stop-btn').classList.toggle('hidden', state.status !== 'active');
}
// ---------- 文件 ----------
@@ -411,6 +413,13 @@ const ui = {
$('files-panel').classList.toggle('hidden', !state.filePanelOpen);
if (state.filePanelOpen) loadFiles();
},
async stopSession() {
if (!state.sessionId) return;
try {
await req('POST', '/api/sessions/' + state.sessionId + '/stop');
toast('已发送终止指令');
} catch (e) { toast('终止失败:' + e.message); }
},
async uploadFiles(ev) {
const input = ev.target;
const files = input.files;