From c782f36b86d3c2aa357a7292f17bdad3322e46ad Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 13 Nov 2026 21:01:51 +0100 Subject: feat(vm): one column, a running VM as tall as the tab A single running VM is the whole tab, without the card look; with more they stack as tab-tall cards and the tab scrolls. Shut-off VMs are short cards below, without screen or trends. Co-Authored-By: Claude Opus 5.5 --- static/deck.css | 12 +++++++++--- static/modules/vm.js | 7 +++++-- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'static') diff --git a/static/deck.css b/static/deck.css index 9f44eb1..e218f33 100644 --- a/static/deck.css +++ b/static/deck.css @@ -813,16 +813,22 @@ select { animation: border-rotate 3s linear infinite; } -/* VMs tab: a tile per VM, its screen on top, a big power button below. +/* VMs tab: one column. A running VM is a tile as tall as the tab, its + screen filling what the rest leaves; with one running it drops the card + look and is the whole tab, with more they stack as cards and the tab + scrolls. A shut-off VM is a short card below them, no screen or trends. Hold buttons fill red over --hold (hold.js). Controls are 56px or more. */ -.vm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; padding: 4px 2px; } +.vm-grid { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px; } +.vm-tile.on { order: -1; height: calc(100dvh - 120px); } +.vm-tile:not(.on) .vm-screen, .vm-tile:not(.on) .vm-trends { display: none; } +.vm-grid.solo .vm-tile.on { background: none; border-color: transparent; padding: 0; } .vm-grid[hidden], .vm-off[hidden], .vm-err[hidden], .vm-snapacts[hidden], .vm-screen img[hidden] { display: none; } .vm-grid.empty::before { content: "No VMs defined."; color: var(--udt-subtext0); } .vm-tile, .vm-sheet { display: flex; flex-direction: column; gap: 10px; } .vm-tile { padding: 12px; border-radius: 16px; background: var(--udt-surface0); border: 2px solid transparent; } .vm-tile.on { border-color: var(--udt-border-1); } .vm-tile.busy, .vm-sheet.busy { opacity: .6; pointer-events: none; } -.vm-screen { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; background: var(--udt-crust); +.vm-screen { position: relative; flex: 1; min-height: 0; border-radius: 10px; background: var(--udt-crust); display: grid; place-items: center; overflow: hidden; } .vm-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; } .vm-glyph { font-size: 4rem; color: var(--udt-surface2); } diff --git a/static/modules/vm.js b/static/modules/vm.js index df68a07..b6c1a92 100644 --- a/static/modules/vm.js +++ b/static/modules/vm.js @@ -18,8 +18,10 @@ import { offline } from "../offline.js"; import { hold } from "../hold.js"; import { area, line, push } from "../dashboard.js"; -// One tile per VM: its screen, a big power button (tap for the gentle -// action, hold to force it off), SSH, and CPU/RAM trends. A tap on the tile +// One tile per VM, in one column (deck.css: a running one as tall as the +// tab, the whole tab when it is the only one): its screen, a big power +// button (tap for the gentle action, hold to force it off), SSH, and +// CPU/RAM trends. A tap on the tile // opens a sheet with every action and the snapshot timeline. Buttons are // Nerd Font glyphs; destructive ones fire only on a press and hold. const G = { @@ -300,5 +302,6 @@ export default { if (!seen.has(name)) { v.tile.remove(); v.sheet.remove(); views.delete(name); } } grid.classList.toggle("empty", !st.vms.length); + grid.classList.toggle("solo", st.vms.filter((vm) => vm.state === "running").length === 1); }, }; -- cgit v1.2.3