95 lines
3.6 KiB
Cheetah
95 lines
3.6 KiB
Cheetah
{{define "asset"}}
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
{{template "head" .}}
|
|
<body>
|
|
{{template "topbar" .}}
|
|
{{template "breadcrumbs" .}}
|
|
|
|
<main class="container">
|
|
<section class="card">
|
|
<h2>Server Card</h2>
|
|
<div class="meta-grid">
|
|
<div><span>Vendor Serial</span>{{.Asset.VendorSerial}}</div>
|
|
<div><span>Vendor</span>{{if .Asset.Vendor}}{{.Asset.Vendor}}{{else}}—{{end}}</div>
|
|
<div><span>Model</span>{{if .Asset.Model}}{{.Asset.Model}}{{else}}—{{end}}</div>
|
|
<div><span>Asset Tag</span>{{if .Asset.MachineTag}}{{.Asset.MachineTag}}{{else}}—{{end}}</div>
|
|
<div><span>Status</span><span class="badge {{assetStatusClass .AssetStatus}}">{{assetStatusText .AssetStatus}}</span></div>
|
|
<div><span>Project</span>{{.ProjectName}}</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Current Components</h2>
|
|
{{if .HasFirmwareMismatch}}
|
|
<div class="meta"><span class="badge status-yellow">Firmware mismatch</span> Identical devices on this server have different firmware versions.</div>
|
|
{{end}}
|
|
{{if .ComponentGroups}}
|
|
{{range .ComponentGroups}}
|
|
<h3>{{.TypeTitle}}</h3>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Status</th>
|
|
<th>Location</th>
|
|
<th>Vendor Serial</th>
|
|
<th>Vendor</th>
|
|
<th>Model</th>
|
|
<th>Firmware</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .Rows}}
|
|
<tr class="clickable" onclick="navigateToRow('/ui/components/{{.Component.ID}}')">
|
|
<td><span class="badge {{componentStatusClass (index $.ComponentStatusByID .Component.ID)}}">{{componentStatusText (index $.ComponentStatusByID .Component.ID)}}</span></td>
|
|
<td>{{if .Location}}{{.Location}}{{else}}—{{end}}</td>
|
|
<td>{{.Component.VendorSerial}}</td>
|
|
<td>{{if .Component.Vendor}}{{.Component.Vendor}}{{else}}—{{end}}</td>
|
|
<td>{{if .Component.Model}}{{.Component.Model}}{{else}}—{{end}}</td>
|
|
<td>
|
|
{{if index $.ComponentFirmwareByID .Component.ID}}{{index $.ComponentFirmwareByID .Component.ID}}{{else}}—{{end}}
|
|
{{if index $.ComponentFirmwareMismatchByID .Component.ID}}
|
|
<span class="badge status-yellow">Mismatch</span>
|
|
{{end}}
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{end}}
|
|
{{else}}
|
|
<div class="meta">No active components.</div>
|
|
{{end}}
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Movement & Events</h2>
|
|
{{if .Events}}
|
|
<div class="timeline">
|
|
{{range .Events}}
|
|
<div class="event">
|
|
<div>
|
|
<div class="time" title="{{formatTimeFull .EventTime}}">{{formatTime .EventTime}}</div>
|
|
<div class="pill {{timelineEventClass .EventType}}">{{.EventType}}</div>
|
|
</div>
|
|
<div>
|
|
<div class="detail">Asset {{assetLabel .MachineID $.AssetLabelByID}} · Component {{componentLabel .PartID $.ComponentLabelByID}}</div>
|
|
<div class="meta">
|
|
Type {{eventComponentType .PartID $.EventComponentByID}} ·
|
|
Location {{eventComponentLocation .PartID $.EventComponentByID}} ·
|
|
Model {{eventComponentModel .PartID $.EventComponentByID}} ·
|
|
Firmware {{if .FirmwareVersion}}{{.FirmwareVersion}}{{else}}{{eventComponentFirmware .PartID $.EventComponentByID}}{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
<div class="meta">No timeline events.</div>
|
|
{{end}}
|
|
</section>
|
|
</main>
|
|
</body>
|
|
</html>
|
|
{{end}}
|