diff --git a/static/style.css b/static/style.css index 6c2619c..e3a97eb 100644 --- a/static/style.css +++ b/static/style.css @@ -91,17 +91,14 @@ th, td { padding: 0.4em 0.7em; text-align: left; border-bottom: 1px solid var(-- th { background: var(--surface); font-weight: 600; } /* RACK LAYOUT */ -.rack-layout { display: flex; gap: 2em; margin: 1em 0; } -.rack-panel { flex: 1; } -.rack-panel h3 { margin-top: 0; } -.rack-slot { - display: flex; align-items: center; gap: 0.5em; - padding: 1px 0.4em; border-bottom: 1px solid #222; - font-size: 0.85em; -} -.rack-slot.occupied { background: var(--surface); } -.unit-num { color: var(--text-muted); width: 2em; text-align: right; font-size: 0.75em; flex-shrink: 0; } -.rack-device { display: flex; flex-direction: column; } +.rack-table { width: 100%; border-collapse: collapse; margin: 1em 0; } +.rack-table th { background: var(--surface); font-weight: 600; padding: 0.3em 0.6em; text-align: center; } +.rack-table td { padding: 0; border-bottom: 1px solid #222; vertical-align: top; } +.rack-table .unit-num { color: var(--text-muted); width: 2.5em; text-align: center; font-size: 0.75em; vertical-align: middle; } +.rack-table .rack-cell { width: 45%; padding: 2px 0.4em; } +.rack-table tr.device-start td { border-top: 2px solid #444; } +.rack-table tr.device-start td.rack-cell { background: var(--surface); } +.rack-device { display: flex; flex-direction: column; padding: 0.15em 0; } .rack-device strong { font-size: 0.9em; } .rack-device small { font-size: 0.75em; } diff --git a/templates/rack.html b/templates/rack.html index 84bc03d..7154b7e 100644 --- a/templates/rack.html +++ b/templates/rack.html @@ -20,37 +20,34 @@ -
| U | Front | U | Back |
|---|---|---|---|
| {{$fs.Unit}} | +
+ {{if $fs.IsStart}}
+
+ {{$fs.Device.Name}}
+ {{if $fs.Device.Model}}{{$fs.Device.Model.Manufacturer}} {{$fs.Device.Model.Name}} ({{$fs.Height}}U){{end}}
+ {{if $fs.Device.UsageDescription}}{{$fs.Device.UsageDescription}}{{end}}
{{end}}
-
-
- Back- {{range .BackSlots}} -
- {{.Unit}}
- {{if .IsStart}}
-
- {{.Device.Name}}
- {{if .Device.Model}}{{.Device.Model.Manufacturer}} {{.Device.Model.Name}} ({{.Height}}U){{end}}
-
- {{end}}
+ |
+ {{(index $.BackSlots $i).Unit}} | +
+ {{if (index $.BackSlots $i).IsStart}}
+
+ {{(index $.BackSlots $i).Device.Name}}
+ {{if (index $.BackSlots $i).Device.Model}}{{(index $.BackSlots $i).Device.Model.Manufacturer}} {{(index $.BackSlots $i).Device.Model.Name}} ({{(index $.BackSlots $i).Height}}U){{end}}
{{end}}
-
-
+ |
+