From 44ff7f1c440dc4b5450f7f3c0b244bdf5ab43957 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sun, 1 Feb 2026 06:52:58 +0000 Subject: [PATCH] Initial upload: DevDash CLI with TUI dashboard --- src/ui/components/status.py | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/ui/components/status.py diff --git a/src/ui/components/status.py b/src/ui/components/status.py new file mode 100644 index 0000000..aa5bf92 --- /dev/null +++ b/src/ui/components/status.py @@ -0,0 +1,40 @@ +from textual.widgets import Static +from enum import Enum +from typing import Literal + + +class StatusType(str, Enum): + SUCCESS = "success" + FAILURE = "failure" + PENDING = "pending" + RUNNING = "running" + + +class StatusIndicator(Static): + def __init__( + self, + status: StatusType = StatusType.SUCCESS, + **kwargs + ): + super().__init__(**kwargs) + self.status = status + self.update_display() + + def update_display(self) -> None: + symbols = { + StatusType.SUCCESS: "[✓]", + StatusType.FAILURE: "[✗]", + StatusType.PENDING: "[?]", + StatusType.RUNNING: "[•]", + } + colors = { + StatusType.SUCCESS: "green", + StatusType.FAILURE: "red", + StatusType.PENDING: "yellow", + StatusType.RUNNING: "blue", + } + self.update(f"{symbols[self.status]} [{colors[self.status]}]{self.status.value}[/]") + + def set_status(self, status: StatusType) -> None: + self.status = status + self.update_display()