- Add core/icons.py — centralized icon text helper with emoji/symbol support - Add Windows SSH command sanitization in ssh.py (Linux→Windows auto-translation) - Improve embedded RDP: launch tab connect/disconnect, fullscreen toggle - Refactor sidebar: cleaner server type badges - Update server_dialog: adaptive fields per server type - Add setup_openssh.bat tool - Update skill-ssh.md and CLAUDE.md docs for Windows SSH support - Cleanup old releases, add v1.8.48-v1.8.52 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
1004 B
Python
35 lines
1004 B
Python
"""
|
|
Status badge widget — colored circle indicator for online/offline.
|
|
"""
|
|
|
|
import customtkinter as ctk
|
|
|
|
COLORS = {
|
|
"online": "#22c55e", # green
|
|
"offline": "#ef4444", # red
|
|
"unknown": "#6b7280", # gray
|
|
"disabled": "#9ca3af", # light gray
|
|
"checking": "#f59e0b", # yellow
|
|
}
|
|
|
|
|
|
class StatusBadge(ctk.CTkLabel):
|
|
def __init__(self, master, status: str = "unknown", **kwargs):
|
|
super().__init__(master, text="", width=12, height=12, **kwargs)
|
|
self._status = status
|
|
self._update_color()
|
|
|
|
def set_status(self, status: str):
|
|
self._status = status
|
|
self._update_color()
|
|
|
|
def _update_color(self):
|
|
color = COLORS.get(self._status, COLORS["unknown"])
|
|
if self._status == "disabled":
|
|
symbol = "\u2014" # —
|
|
elif self._status == "checking":
|
|
symbol = "\u25d0" # ◐
|
|
else:
|
|
symbol = "\u25cf" # ●
|
|
self.configure(text=symbol, text_color=color, font=("", 14))
|