- Python 3.12+ / Textual TUI with btop-style theme and 4 tabs (Dashboard, Logs, Services, Disks) - Paramiko SSH layer with ssh_config support, key fallback, keepalive and reconnect; async executor over a thread pool - Read-only collectors for system, storage, disks, network, logs and services; confirm dialog gates service restart/stop/start - Click CLI: dsmview ssh [-p PORT] [-i KEY] TARGET - Homebrew formula using virtualenv_install_with_resources - GitHub Actions release workflow: builds source tarball, regenerates Python resource blocks via homebrew-pypi-poet, pushes updated formula to janvete/homebrew-dsmview tap Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
24 lines
802 B
Python
24 lines
802 B
Python
from __future__ import annotations
|
|
|
|
from typing import Iterable
|
|
|
|
from textual.widgets import DataTable
|
|
|
|
from dsmview.collectors.services import ServiceInfo
|
|
from dsmview.ui import theme
|
|
|
|
|
|
class ServiceList(DataTable):
|
|
"""Tabular service overview backed by Textual's DataTable."""
|
|
|
|
def on_mount(self) -> None:
|
|
self.cursor_type = "row"
|
|
self.zebra_stripes = False
|
|
self.add_columns("SERVICE", "STATUS", "INFO")
|
|
|
|
def update_services(self, services: Iterable[ServiceInfo]) -> None:
|
|
self.clear()
|
|
for svc in services:
|
|
status_text = "[green]✅ running[/]" if svc.running else "[grey50]⛔ stopped[/]"
|
|
info = svc.status_text.splitlines()[0] if svc.status_text else ""
|
|
self.add_row(svc.name, status_text, info, key=svc.name)
|