Initial commit: ServerManager GUI application
CustomTkinter desktop app for managing remote servers. Features: SSH terminal, SFTP file transfer, key management, background status monitoring, server CRUD with dark theme. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
0
gui/widgets/__init__.py
Normal file
0
gui/widgets/__init__.py
Normal file
26
gui/widgets/status_badge.py
Normal file
26
gui/widgets/status_badge.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
Status badge widget — colored circle indicator for online/offline.
|
||||
"""
|
||||
|
||||
import customtkinter as ctk
|
||||
|
||||
COLORS = {
|
||||
"online": "#22c55e", # green
|
||||
"offline": "#ef4444", # red
|
||||
"unknown": "#6b7280", # 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"])
|
||||
self.configure(text="\u25cf", text_color=color, font=("", 14))
|
||||
Reference in New Issue
Block a user