Update ashboard, dashboard (~2)

This commit is contained in:
Echo
2026-02-15 23:25:18 +00:00
parent 2eca94abaf
commit 22806c826b
2 changed files with 36 additions and 0 deletions

View File

@@ -84,6 +84,8 @@ class TaskBoardHandler(SimpleHTTPRequestHandler):
self.handle_eco_sessions_clear()
elif self.path == '/api/eco/git-commit':
self.handle_eco_git_commit()
elif self.path == '/api/eco/restart-taskboard':
self.handle_eco_restart_taskboard()
else:
self.send_error(404)
@@ -2403,6 +2405,18 @@ class TaskBoardHandler(SimpleHTTPRequestHandler):
except Exception as e:
self.send_json({'success': False, 'error': str(e)}, 500)
def handle_eco_restart_taskboard(self):
"""Restart the taskboard itself. Sends response then exits; systemd restarts."""
import threading
self.send_json({'success': True, 'message': 'Restarting taskboard in 1s...'})
def _exit():
import time
time.sleep(1)
os._exit(0)
threading.Thread(target=_exit, daemon=True).start()
def handle_eco_sessions_clear(self):
"""Clear active sessions (all or specific channel)."""
try: