From 0823e5d743acdb3400474ce2548fce72b36f593e Mon Sep 17 00:00:00 2001 From: Ilker Manap Date: Tue, 29 Sep 2026 09:24:56 +0200 Subject: [PATCH] Fit the pages to a phone, and drop an empty Fabrics heading On a phone every admin page was wider than the screen - its tables set the width - so the browser zoomed the whole page out until nothing on it could be read. Under 760px a table now scrolls sideways in its own box, charts stack, form rows fold, and the menus wrap; every page measured at 390px wide now fits. The cluster page drew a Fabrics heading and its note on a cluster with no fabric at all. Co-Authored-By: Claude Opus 5.5 (1M context) --- internal/web/static/base.css | 20 ++++++++++++++++++++ internal/web/templates/dashboard.html | 2 +- internal/web/web_test.go | 13 +++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/internal/web/static/base.css b/internal/web/static/base.css index f45555d..5bc4fcd 100644 --- a/internal/web/static/base.css +++ b/internal/web/static/base.css @@ -764,3 +764,23 @@ details.add-inline > summary::-webkit-details-marker { display: none; } details.add-inline[open] > summary { color: var(--muted); } details.add-inline form.add { margin-top: .3rem; } .fetch-note { margin-top: .3rem; font-size: .78rem; white-space: normal; } .fetch-note.bad { color: var(--bad); } + +/* --------------------------------------------------------------------- + A phone. A wide table scrolls sideways inside its own box rather than + widening the page, which made a phone zoom the whole page out until + nothing on it could be read. + --------------------------------------------------------------------- */ +@media (max-width: 760px) { + .wrap { padding: 1.25rem .9rem 3rem; } + table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; } + pre { max-width: 100%; overflow-x: auto; } + header nav, .nav { flex-wrap: wrap; row-gap: .35rem; } + .tiles .tile { flex: 1 1 45%; min-width: 0; } + .chart-row { grid-template-columns: 1fr !important; } + .field-row { flex-direction: column; } + .racks { grid-template-columns: 1fr; } + .rack-stats { gap: .6rem; } + .fm-bar { flex-direction: column; align-items: flex-start; } + .explore-search input[type=search] { flex-basis: 100%; } + form.add-to select { max-width: 9rem; } +} diff --git a/internal/web/templates/dashboard.html b/internal/web/templates/dashboard.html index cec9473..23d56b8 100644 --- a/internal/web/templates/dashboard.html +++ b/internal/web/templates/dashboard.html @@ -130,7 +130,7 @@ {{end}} {{end}} -{{if or .Summary.Fabrics .Fabrics}} +{{if or .Summary.Fabrics (and .Fabrics (or .Fabrics.Physical .Fabrics.Problems))}}

Fabrics

{{with .Fabrics}}{{if .Problems}}