feat(timeline): fix chronology, status resolution, and component history UI
This commit is contained in:
@@ -15,11 +15,38 @@
|
||||
<div><span>Model</span>{{if .Component.Model}}{{.Component.Model}}{{else}}—{{end}}</div>
|
||||
<div><span>Status</span><span class="badge {{componentStatusClass .ComponentStatus}}">{{componentStatusText .ComponentStatus}}</span></div>
|
||||
<div><span>Asset</span>{{if .CurrentAssetID}}<a href="/ui/assets/{{.CurrentAssetID}}">{{.CurrentAssetLabel}}</a>{{else}}—{{end}}</div>
|
||||
<div><span>Firmware</span>{{if .ComponentFirmware}}{{.ComponentFirmware}}{{else}}—{{end}}</div>
|
||||
<div><span>First Seen</span><span title="{{formatTimePtrFull .Component.FirstSeenAt}}">{{formatTimePtr .Component.FirstSeenAt}}</span></div>
|
||||
<div><span>Created</span><span title="{{formatTimeFull .Component.CreatedAt}}">{{formatTime .Component.CreatedAt}}</span></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>Installation History</h2>
|
||||
{{if .InstallationHistory}}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Asset</th>
|
||||
<th>Installed At</th>
|
||||
<th>Removed At</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .InstallationHistory}}
|
||||
<tr>
|
||||
<td><a href="/ui/assets/{{.AssetID}}">{{.AssetLabel}}</a></td>
|
||||
<td>{{formatTimeFull .InstalledAt}}</td>
|
||||
<td>{{if .RemovedAt}}{{formatTimePtrFull .RemovedAt}}{{else}}—{{end}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{else}}
|
||||
<div class="meta">No installation history.</div>
|
||||
{{end}}
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>Timeline</h2>
|
||||
{{if .Events}}
|
||||
@@ -32,7 +59,12 @@
|
||||
</div>
|
||||
<div>
|
||||
<div class="detail">Asset {{assetLabel .MachineID $.AssetLabelByID}} · Component {{componentLabel .PartID $.ComponentLabelByID}}</div>
|
||||
<div class="meta">Firmware {{if .FirmwareVersion}}{{.FirmwareVersion}}{{else}}—{{end}}</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}}
|
||||
|
||||
Reference in New Issue
Block a user