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) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-09-29 09:24:56 +02:00
1 parent b18c9c3378
commit 0823e5d743
3 files changed
+34 -1

No files matched your search

+20
View File
@@ -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; }
}
+1 -1
View File
@@ -130,7 +130,7 @@
</tr>{{end}}</table>
{{end}}
{{if or .Summary.Fabrics .Fabrics}}
{{if or .Summary.Fabrics (and .Fabrics (or .Fabrics.Physical .Fabrics.Problems))}}
<h2>Fabrics</h2>
{{with .Fabrics}}{{if .Problems}}
<ul class="fabric-problems">{{range .Problems}}
+13
View File
@@ -674,3 +674,16 @@ func TestTheClusterPageSaysWhatEachFabricPhysicallyIs(t *testing.T) {
}
}
}
func TestAClusterWithoutFabricsHasNoFabricsSection(t *testing.T) {
_, body := get(t, Dashboard(emptyFabrics{}, fakeUsage{}, "v1", time.Second, true, NavExtras{}, nil), "http://127.0.0.1:9090/", nil)
if strings.Contains(body, "<h2>Fabrics</h2>") {
t.Error("a heading over nothing")
}
}
// emptyFabrics is a source that can report fabrics, and has none.
type emptyFabrics struct{ fakeSource }
func (emptyFabrics) Summary() adminapi.Summary { return adminapi.Summary{} }
func (emptyFabrics) Fabrics() fabrics.Report { return fabrics.Report{} }