Files
mesh-network-project/desktop_app/ui/screens/pair_screen.py
2026-03-07 14:34:25 +11:00

32 lines
1.3 KiB
Python

from textual.screen import Screen
from textual.containers import VerticalScroll, Vertical
from textual.widgets import Static, Button, LoadingIndicator, DataTable
from textualeffects.widgets import EffectLabel
class PairScreen(Screen):
CSS_PATH = "../assets/pair_screen.tcss"
def compose(self):
with Vertical(id="middle") as center_window:
center_window.border_title = "Pair a Node"
with open("ui/assets/banner.txt", "r") as f:
yield EffectLabel(f.read(), effect="Print")
yield Static("Make sure your mesh network node is powered and ready to pair. When you're ready, click the \"Pair\" button to connect to the mesh!")
table = DataTable()
table.add_columns("[b]Address", "RSSI")
yield table
table.add_row("hi", "[green]󰢾[/] -34 dBm")
table.add_row("hi", "[green]󰢾[/] -52 dBm")
table.add_row("hi", "[yellow]󰢽[/] -64 dBm")
table.add_row("hi", "[red]󰢼[/] -98 dBm")
table.add_row("hi", "[red]󰢼[/] -101 dBm")
yield LoadingIndicator()
yield Button("Select a node to pair", disabled=True, variant="success", id="pair-btn")