Initial upload: DevDash CLI with TUI dashboard
Some checks failed
CI / test (push) Has been cancelled
Some checks failed
CI / test (push) Has been cancelled
This commit is contained in:
51
src/ui/components/panels.py
Normal file
51
src/ui/components/panels.py
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
from textual.containers import Container, Vertical
|
||||||
|
from textual.widgets import Static, Label
|
||||||
|
from typing import List, Dict, Any
|
||||||
|
|
||||||
|
|
||||||
|
class StatusPanel(Container):
|
||||||
|
def __init__(self, title: str = "", **kwargs):
|
||||||
|
super().__init__(**kwargs)
|
||||||
|
self.panel_title = title
|
||||||
|
|
||||||
|
def compose(self) -> ComposeResult:
|
||||||
|
yield Label(f"[{self.panel_title}]", classes="panel-title")
|
||||||
|
|
||||||
|
|
||||||
|
class GitStatusPanel(StatusPanel):
|
||||||
|
def __init__(self, **kwargs):
|
||||||
|
super().__init__("Git Status", **kwargs)
|
||||||
|
|
||||||
|
def update_status(self, status) -> None:
|
||||||
|
self.mount(Vertical(
|
||||||
|
Static(f"Branch: {status.branch}"),
|
||||||
|
Static(f"Commit: {status.commit[:7]}"),
|
||||||
|
Static(f"Staged: {status.staged}"),
|
||||||
|
Static(f"Unstaged: {status.unstaged}"),
|
||||||
|
Static(f"Untracked: {status.untracked}"),
|
||||||
|
id="git-status-content"
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
|
class CIStatusPanel(StatusPanel):
|
||||||
|
def __init__(self, **kwargs):
|
||||||
|
super().__init__("CI/CD", **kwargs)
|
||||||
|
|
||||||
|
def update_workflows(self, workflows: List[Dict[str, Any]]) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class PullRequestsPanel(StatusPanel):
|
||||||
|
def __init__(self, **kwargs):
|
||||||
|
super().__init__("Pull Requests", **kwargs)
|
||||||
|
|
||||||
|
def update_prs(self, prs: List[Dict[str, Any]]) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class IssuesPanel(StatusPanel):
|
||||||
|
def __init__(self, **kwargs):
|
||||||
|
super().__init__("Issues", **kwargs)
|
||||||
|
|
||||||
|
def update_issues(self, issues: List[Dict[str, Any]]) -> None:
|
||||||
|
pass
|
||||||
Reference in New Issue
Block a user