diff --git a/app/server/public/css/style.css b/app/server/public/css/style.css index 3b0420f..e3939f6 100644 --- a/app/server/public/css/style.css +++ b/app/server/public/css/style.css @@ -83,6 +83,11 @@ body { padding: 8px 12px; background: #fff; border-bottom: 1px solid #e8e8ee; } .status-pill { font-size: 12px; color: #666; } +.stop-link { + background: none; border: none; cursor: pointer; + color: #c33; font-size: 12px; padding: 2px 6px; margin-left: 2px; +} +.stop-link:active { opacity: 0.6; } /* ---- 消息 ---- */ .messages { diff --git a/app/server/public/index.html b/app/server/public/index.html index c97b494..a8d6d2d 100644 --- a/app/server/public/index.html +++ b/app/server/public/index.html @@ -48,6 +48,7 @@
diff --git a/app/server/public/js/app.js b/app/server/public/js/app.js index 90b5a2a..c0859b7 100644 --- a/app/server/public/js/app.js +++ b/app/server/public/js/app.js @@ -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;