Files
server-manager/gui/widgets/status_badge.py
chrome-storm-c442 a83a97c9d5 v1.5.0: network interface binding, SSH fixes, terminal, release script
- Add network interface selection per server (VPN/multi-NIC support)
- Fix "Install Everything" button hanging on error
- Add interactive SSH terminal with PTY (pyte + xterm-256color)
- Add release.py for automated versioning and changelog generation
- Add CLAUDE.md with project instructions
- Add screenshots and release binaries for v1.1–v1.4

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:06:41 -05:00

29 lines
824 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
}
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"])
symbol = "\u2014" if self._status == "disabled" else "\u25cf"
self.configure(text=symbol, text_color=color, font=("", 14))