Убрана карточка приёмника, читаемые заголовки панелей
This commit is contained in:
+9
-12
@@ -27,6 +27,14 @@ Screen {
|
||||
width: 1fr;
|
||||
}
|
||||
|
||||
/* заголовок панели красится в цвет рамки, а $panel тусклый: без явного
|
||||
border-title-color подписи невыделенных плиток тонут в фоне */
|
||||
.panel, #plan, #log {
|
||||
border-title-color: $foreground;
|
||||
border-title-style: bold;
|
||||
border-subtitle-color: $text-muted;
|
||||
}
|
||||
|
||||
.panel {
|
||||
border: round $panel;
|
||||
background: $surface;
|
||||
@@ -35,6 +43,7 @@ Screen {
|
||||
|
||||
.panel:focus-within {
|
||||
border: round $primary;
|
||||
border-title-color: $primary;
|
||||
}
|
||||
|
||||
.panel > Input {
|
||||
@@ -52,13 +61,6 @@ Screen {
|
||||
scrollbar-size-vertical: 1;
|
||||
}
|
||||
|
||||
#target-card {
|
||||
height: auto;
|
||||
border: round $panel;
|
||||
background: $surface;
|
||||
padding: 0 1;
|
||||
}
|
||||
|
||||
#pane-dump {
|
||||
height: 1fr;
|
||||
}
|
||||
@@ -327,11 +329,6 @@ ModalScreen {
|
||||
width: 28;
|
||||
}
|
||||
|
||||
/* низкое окно: карточка приёмника — справочная, место нужнее спискам */
|
||||
.short #target-card {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.zoom-log.narrow #plan {
|
||||
height: 25%;
|
||||
min-height: 3;
|
||||
|
||||
@@ -698,7 +698,6 @@ class DashboardScreen(Screen):
|
||||
yield Static(id="db-error")
|
||||
yield DbList(id="tbl-db")
|
||||
with Vertical(id="col-right"):
|
||||
yield Static(id="target-card")
|
||||
with Vertical(id="pane-dump", classes="panel"):
|
||||
yield Input(placeholder="фильтр…", id="flt-dump", compact=True)
|
||||
yield Static(id="dump-note")
|
||||
@@ -725,24 +724,12 @@ class DashboardScreen(Screen):
|
||||
self.query_one("#pane-dump").border_title = f"Дампы · {core.dump_dir_of(self.cfg).name}"
|
||||
self.query_one("#plan").border_title = "План"
|
||||
self.query_one("#log").border_title = "Журнал"
|
||||
self._render_target_card()
|
||||
self.query_one("#op-progress", ProgressBar).display = False
|
||||
self.set_interval(0.08, self._drain) # батч строк: --verbose иначе топит цикл
|
||||
self.set_interval(0.1, self._tick)
|
||||
self.query_one("#flt-db", Input).focus()
|
||||
self.reload()
|
||||
|
||||
def _render_target_card(self) -> None:
|
||||
tgt = self.cfg["target"]
|
||||
mode = "DROP + CREATE" if tgt.get("recreate", True) else "накатить поверх"
|
||||
database = tgt.get("database") or "как на стенде"
|
||||
jobs = self.cfg.get("restore", {}).get("jobs", 4)
|
||||
card = self.query_one("#target-card", Static)
|
||||
card.border_title = "Приёмник"
|
||||
card.update(Content(f"режим {mode}\n"
|
||||
f"цель {database}\n"
|
||||
f"jobs {jobs} · keep_dumps {self.cfg.get('keep_dumps', 5)}"))
|
||||
|
||||
def on_resize(self) -> None:
|
||||
# media-queries в Textual нет, поэтому классы вешаются руками
|
||||
self.set_class(self.size.width < 100, "narrow")
|
||||
|
||||
@@ -906,11 +906,9 @@ def test_layout_adapts_to_small_console(cfg, monkeypatch):
|
||||
board = dash.query_one("#board").size.height
|
||||
bottom = dash.query_one("#bottom").size.height
|
||||
assert board + bottom <= 24 - 4 # шапка 2 + статус 1 + футер 1
|
||||
assert not dash.query_one("#target-card").display
|
||||
await pilot.resize_terminal(160, 50)
|
||||
await pilot.pause()
|
||||
assert not dash.has_class("narrow") and not dash.has_class("short")
|
||||
assert dash.query_one("#target-card").display
|
||||
asyncio.run(scenario())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user