Show device model images + Back to Rack link
Device view now displays front/back model images above the port list. Added a 'Back to Rack' breadcrumb link when the device is rack-mounted.master
parent
6a14af2227
commit
7bcfa73c19
|
|
@ -175,6 +175,10 @@ th { background: var(--surface); font-weight: 600; }
|
||||||
/* DEVICE TOOLBAR */
|
/* DEVICE TOOLBAR */
|
||||||
.device-toolbar { display: flex; gap: 0.5em; align-items: center; margin-bottom: 0.5em; }
|
.device-toolbar { display: flex; gap: 0.5em; align-items: center; margin-bottom: 0.5em; }
|
||||||
|
|
||||||
|
/* DEVICE IMAGES */
|
||||||
|
.device-images { display: flex; gap: 1.5em; margin: 0.8em 0; }
|
||||||
|
.device-images img.device-img { max-width: 300px; max-height: 250px; border: 1px solid var(--border); border-radius: 4px; display: block; margin-top: 0.3em; }
|
||||||
|
|
||||||
/* BADGES */
|
/* BADGES */
|
||||||
.badge { display: inline-block; padding: 0.1em 0.4em; font-size: 0.75em; border-radius: 3px; background: var(--surface2); }
|
.badge { display: inline-block; padding: 0.1em 0.4em; font-size: 0.75em; border-radius: 3px; background: var(--surface2); }
|
||||||
.badge-network { background: #224444; color: var(--green); }
|
.badge-network { background: #224444; color: var(--green); }
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
<h1>{{.Device.Name}}</h1>
|
<h1>{{.Device.Name}}</h1>
|
||||||
{{if .Error}}<div class="alert alert-error">{{.Error}}</div>{{end}}
|
{{if .Error}}<div class="alert alert-error">{{.Error}}</div>{{end}}
|
||||||
|
|
||||||
|
{{if .Device.Rack}}
|
||||||
|
<p class="rack-backlink"><a href="/racks/{{.Device.Rack.ID}}">← Back to {{.Device.Rack.Name}}</a></p>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
<div class="device-meta">
|
<div class="device-meta">
|
||||||
{{if .Device.Model}}<p><strong>Model:</strong> {{.Device.Model.Manufacturer}} {{.Device.Model.Name}}</p>{{end}}
|
{{if .Device.Model}}<p><strong>Model:</strong> {{.Device.Model.Manufacturer}} {{.Device.Model.Name}}</p>{{end}}
|
||||||
{{if .Device.UsageDescription}}<p><strong>Usage:</strong> {{.Device.UsageDescription}}</p>{{end}}
|
{{if .Device.UsageDescription}}<p><strong>Usage:</strong> {{.Device.UsageDescription}}</p>{{end}}
|
||||||
|
|
@ -35,5 +39,25 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>Ports</h3>
|
<h3>Ports</h3>
|
||||||
|
{{if .Device.Model}}{{if or .Device.Model.FrontImage .Device.Model.BackImage}}
|
||||||
|
<div class="device-images">
|
||||||
|
{{if .Device.Model.FrontImage}}<div><strong>Front</strong><br><img src="/{{.Device.Model.FrontImage}}" alt="Front" class="device-img"></div>{{end}}
|
||||||
|
{{if .Device.Model.BackImage}}<div><strong>Back</strong><br><img src="/{{.Device.Model.BackImage}}" alt="Back" class="device-img"></div>{{end}}
|
||||||
|
</div>
|
||||||
|
{{end}}{{end}}
|
||||||
{{template "port_list" .}}
|
{{template "port_list" .}}
|
||||||
|
|
||||||
|
<details style="margin-top:1em">
|
||||||
|
<summary>Rename Ports</summary>
|
||||||
|
<form method="POST" action="/devices/{{.Device.ID}}/ports/rename">
|
||||||
|
{{range .Device.Ports}}
|
||||||
|
<div class="port-entry">
|
||||||
|
<input name="port_id" type="hidden" value="{{.ID}}">
|
||||||
|
<input name="port_name" value="{{.Name}}" style="width:16em">
|
||||||
|
<span class="muted" style="font-size:0.8em">{{.Side}}</span>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
<button type="submit">Update Ports</button>
|
||||||
|
</form>
|
||||||
|
</details>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue