Skip to content

Class peagen.tui.components.footer.DashboardFooter

peagen.tui.components.footer.DashboardFooter

Bases: Footer

clock class-attribute instance-attribute

clock = reactive('')

metrics class-attribute instance-attribute

metrics = reactive('')

page class-attribute instance-attribute

page = reactive('')

hint class-attribute instance-attribute

hint = "Tab: switch | S: sort | C: collapse | Esc: clear | N/P: page | J: jump | L: limit"

on_mount

on_mount()
Source code in peagen/tui/components/footer.py
20
21
def on_mount(self) -> None:
    self.set_interval(1.0, self.update_metrics)

set_page_info

set_page_info(current, total)

Update the current pagination display.

Source code in peagen/tui/components/footer.py
23
24
25
def set_page_info(self, current: int, total: int) -> None:
    """Update the current pagination display."""
    self.page = f"{current}/{total}" if total else f"{current}/?"

update_metrics

update_metrics()
Source code in peagen/tui/components/footer.py
27
28
29
30
31
32
def update_metrics(self) -> None:
    self.clock = datetime.now().strftime("%H:%M:%S")
    if psutil:
        self.metrics = f"CPU: {psutil.cpu_percent()}% | MEM: {psutil.virtual_memory().percent}%"
    else:  # pragma: no cover - missing psutil
        self.metrics = "CPU: n/a | MEM: n/a"

render

render()
Source code in peagen/tui/components/footer.py
34
35
36
def render(self) -> str:
    page_part = f"Page {self.page} | " if self.page else ""
    return f"{self.clock} | {self.metrics} | {page_part}{self.hint}"