Show system clock in top right corner of all screens

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
shuki
2026-03-06 06:35:51 +02:00
parent 5c1fa04657
commit f7c5836db0
14 changed files with 14 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ class BackupScreen(Screen):
BINDINGS = [("escape", "go_back", "Back")] BINDINGS = [("escape", "go_back", "Back")]
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
targets = list_conf_dir("targets.d") targets = list_conf_dir("targets.d")
remotes = list_conf_dir("remotes.d") remotes = list_conf_dir("remotes.d")
with Vertical(id="backup-screen"): with Vertical(id="backup-screen"):

View File

@@ -12,7 +12,7 @@ class LogsScreen(Screen):
BINDINGS = [("escape", "go_back", "Back")] BINDINGS = [("escape", "go_back", "Back")]
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
with Vertical(id="logs-screen"): with Vertical(id="logs-screen"):
yield Static("Logs", id="screen-title") yield Static("Logs", id="screen-title")
yield DataTable(id="logs-table") yield DataTable(id="logs-table")

View File

@@ -44,7 +44,7 @@ class MainMenuScreen(Screen):
BINDINGS = [("q", "quit_app", "Quit")] BINDINGS = [("q", "quit_app", "Quit")]
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
with Horizontal(id="main-layout"): with Horizontal(id="main-layout"):
yield Static(LOGO, id="logo", markup=True) yield Static(LOGO, id="logo", markup=True)
menu_items = [] menu_items = []

View File

@@ -24,7 +24,7 @@ class RemoteEditScreen(Screen):
self._is_new = not name self._is_new = not name
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
title = "Add Remote" if self._is_new else f"Edit Remote: {self._edit_name}" title = "Add Remote" if self._is_new else f"Edit Remote: {self._edit_name}"
remote = Remote() remote = Remote()
if not self._is_new: if not self._is_new:

View File

@@ -14,7 +14,7 @@ class RemotesScreen(Screen):
BINDINGS = [("escape", "go_back", "Back")] BINDINGS = [("escape", "go_back", "Back")]
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
with Vertical(id="remotes-screen"): with Vertical(id="remotes-screen"):
yield Static("Remotes", id="screen-title") yield Static("Remotes", id="screen-title")
yield DataTable(id="remotes-table") yield DataTable(id="remotes-table")

View File

@@ -14,7 +14,7 @@ class RestoreScreen(Screen):
BINDINGS = [("escape", "go_back", "Back")] BINDINGS = [("escape", "go_back", "Back")]
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
targets = list_conf_dir("targets.d") targets = list_conf_dir("targets.d")
remotes = list_conf_dir("remotes.d") remotes = list_conf_dir("remotes.d")
with Vertical(id="restore-screen"): with Vertical(id="restore-screen"):

View File

@@ -14,7 +14,7 @@ class RetentionScreen(Screen):
BINDINGS = [("escape", "go_back", "Back")] BINDINGS = [("escape", "go_back", "Back")]
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
targets = list_conf_dir("targets.d") targets = list_conf_dir("targets.d")
conf = parse_conf(CONFIG_DIR / "gniza.conf") conf = parse_conf(CONFIG_DIR / "gniza.conf")
current_count = conf.get("RETENTION_COUNT", "30") current_count = conf.get("RETENTION_COUNT", "30")

View File

@@ -17,7 +17,7 @@ class ScheduleScreen(Screen):
BINDINGS = [("escape", "go_back", "Back")] BINDINGS = [("escape", "go_back", "Back")]
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
with Vertical(id="schedule-screen"): with Vertical(id="schedule-screen"):
yield Static("Schedules", id="screen-title") yield Static("Schedules", id="screen-title")
yield DataTable(id="sched-table") yield DataTable(id="sched-table")

View File

@@ -38,7 +38,7 @@ class ScheduleEditScreen(Screen):
self._is_new = not name self._is_new = not name
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
title = "Add Schedule" if self._is_new else f"Edit Schedule: {self._edit_name}" title = "Add Schedule" if self._is_new else f"Edit Schedule: {self._edit_name}"
sched = Schedule() sched = Schedule()
if not self._is_new: if not self._is_new:

View File

@@ -12,7 +12,7 @@ class SettingsScreen(Screen):
BINDINGS = [("escape", "go_back", "Back")] BINDINGS = [("escape", "go_back", "Back")]
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
conf = parse_conf(CONFIG_DIR / "gniza.conf") conf = parse_conf(CONFIG_DIR / "gniza.conf")
settings = AppSettings.from_conf(conf) settings = AppSettings.from_conf(conf)
with Vertical(id="settings-screen"): with Vertical(id="settings-screen"):

View File

@@ -16,7 +16,7 @@ class SnapshotsScreen(Screen):
BINDINGS = [("escape", "go_back", "Back")] BINDINGS = [("escape", "go_back", "Back")]
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
targets = list_conf_dir("targets.d") targets = list_conf_dir("targets.d")
remotes = list_conf_dir("remotes.d") remotes = list_conf_dir("remotes.d")
with Vertical(id="snapshots-screen"): with Vertical(id="snapshots-screen"):

View File

@@ -21,7 +21,7 @@ class TargetEditScreen(Screen):
self._is_new = not name self._is_new = not name
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
title = "Add Target" if self._is_new else f"Edit Target: {self._edit_name}" title = "Add Target" if self._is_new else f"Edit Target: {self._edit_name}"
target = Target() target = Target()
if not self._is_new: if not self._is_new:

View File

@@ -12,7 +12,7 @@ class TargetsScreen(Screen):
BINDINGS = [("escape", "go_back", "Back")] BINDINGS = [("escape", "go_back", "Back")]
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
with Vertical(id="targets-screen"): with Vertical(id="targets-screen"):
yield Static("Targets", id="screen-title") yield Static("Targets", id="screen-title")
yield DataTable(id="targets-table") yield DataTable(id="targets-table")

View File

@@ -9,7 +9,7 @@ from tui.config import has_remotes, has_targets
class WizardScreen(Screen): class WizardScreen(Screen):
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Header() yield Header(show_clock=True)
with Center(): with Center():
with Vertical(id="wizard"): with Vertical(id="wizard"):
yield Static( yield Static(