mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 08:29:42 +02:00
feat: add Kill All button to monitor panel + center close modal
- Add Kill All button with confirmation dialog to monitor panel header - Button shows red X icon, confirms before killing all sessions - Center-align close session modal options for better UX Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1561,6 +1561,35 @@ class ClaudemanApp {
|
||||
}
|
||||
}
|
||||
|
||||
async killAllSessions() {
|
||||
const count = this.screenSessions?.length || 0;
|
||||
if (count === 0) {
|
||||
alert('No sessions to kill');
|
||||
return;
|
||||
}
|
||||
|
||||
const confirmed = confirm(`Kill all ${count} session(s)? This cannot be undone.`);
|
||||
if (!confirmed) return;
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/sessions', { method: 'DELETE' });
|
||||
const data = await res.json();
|
||||
if (data.success) {
|
||||
// Clear local state
|
||||
this.sessions.clear();
|
||||
this.screenSessions = [];
|
||||
this.activeSessionId = null;
|
||||
this.renderSessionTabs();
|
||||
this.renderScreenSessions();
|
||||
this.terminal.clear();
|
||||
this.terminal.reset();
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to kill all sessions:', err);
|
||||
alert('Failed to kill sessions: ' + err.message);
|
||||
}
|
||||
}
|
||||
|
||||
renderScreenSessions() {
|
||||
const body = document.getElementById('screenSessionsBody');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user