Linux GUI: add Clear Log + Restart Proxy buttons (parity with Windows)

This commit is contained in:
Roman | RyzenAdvanced
2026-05-25 19:25:01 +04:00
Unverified
parent 9796c56451
commit 37a542a78e
2 changed files with 34 additions and 10 deletions

Binary file not shown.

View File

@@ -1977,6 +1977,13 @@ class LauncherWin(Gtk.Window):
assist_btn.connect("clicked", lambda b: self._open_assistant()) assist_btn.connect("clicked", lambda b: self._open_assistant())
assist_btn.set_tooltip_text("Open AI coding assistant with streaming, tools, and session management") assist_btn.set_tooltip_text("Open AI coding assistant with streaming, tools, and session management")
bb.pack_start(assist_btn, False, False, 0) bb.pack_start(assist_btn, False, False, 0)
self._clear_log_btn = Gtk.Button(label="Clear Log")
self._clear_log_btn.connect("clicked", lambda b: self._buf.set_text(""))
bb.pack_start(self._clear_log_btn, False, False, 0)
self._restart_btn = Gtk.Button(label="Restart Proxy")
self._restart_btn.connect("clicked", lambda b: self._manual_restart_proxy())
self._restart_btn.set_sensitive(False)
bb.pack_start(self._restart_btn, False, False, 0)
self._kill_btn = Gtk.Button(label="Kill && Cleanup") self._kill_btn = Gtk.Button(label="Kill && Cleanup")
self._kill_btn.connect("clicked", lambda b: self._kill()) self._kill_btn.connect("clicked", lambda b: self._kill())
self._kill_btn.set_sensitive(False) self._kill_btn.set_sensitive(False)
@@ -2073,6 +2080,7 @@ class LauncherWin(Gtk.Window):
self._btn_codex_desktop.set_sensitive(not busy and has_desk) self._btn_codex_desktop.set_sensitive(not busy and has_desk)
self._btn_codex_cli.set_sensitive(not busy and has_cli) self._btn_codex_cli.set_sensitive(not busy and has_cli)
self._kill_btn.set_sensitive(busy) self._kill_btn.set_sensitive(busy)
self._restart_btn.set_sensitive(busy)
GLib.idle_add(_update) GLib.idle_add(_update)
def _rebuild_combo(self): def _rebuild_combo(self):
@@ -2206,16 +2214,32 @@ class LauncherWin(Gtk.Window):
GLib.idle_add(self.log, f"[AI Monitor] Alert: {action} (trigger: {trigger})") GLib.idle_add(self.log, f"[AI Monitor] Alert: {action} (trigger: {trigger})")
def _restart_proxy_from_watcher(self): def _restart_proxy_from_watcher(self):
try: try:
ep_name = load_endpoints().get("default") ep_name = load_endpoints().get("default")
if not ep_name: if not ep_name:
return return
for ep in load_endpoints().get("endpoints", []): for ep in load_endpoints().get("endpoints", []):
if ep.get("name") == ep_name: if ep.get("name") == ep_name:
self._start_proxy(ep) self._start_proxy(ep)
break break
except Exception as e: except Exception as e:
self.log(f"[AI Monitor] Proxy restart failed: {e}") self.log(f"[AI Monitor] Proxy restart failed: {e}")
def _manual_restart_proxy(self):
self._kill()
time.sleep(1)
try:
ep_name = load_endpoints().get("default")
if not ep_name:
self.log("No default endpoint set")
return
for ep in load_endpoints().get("endpoints", []):
if ep.get("name") == ep_name:
self._start_proxy(ep)
self.log("Proxy restarted")
break
except Exception as e:
self.log(f"Proxy restart failed: {e}")
def _open_usage(self): def _open_usage(self):
try: try: