Files
core/internal/api/ui_failures.tmpl

51 lines
1.7 KiB
Cheetah

{{define "failures"}}
<!DOCTYPE html>
<html lang="en">
{{template "head" .}}
<body>
{{template "topbar" .}}
{{template "breadcrumbs" .}}
<main class="container">
<section class="card">
<h2>Failure Events</h2>
{{if .Failures}}
<table class="table">
<thead>
<tr>
<th>Source</th>
<th>External</th>
<th>Component</th>
<th>Asset</th>
<th>Component Status</th>
<th>Asset Status</th>
<th>Type</th>
<th>Failure Time</th>
<th>Confidence</th>
</tr>
</thead>
<tbody>
{{range .Failures}}
<tr>
<td>{{.Source}}</td>
<td>{{.ExternalID}}</td>
<td><a href="/ui/components/{{.PartID}}">{{componentLabelByID .PartID $.ComponentLabelByID}}</a></td>
<td>{{if .MachineID}}<a href="/ui/assets/{{.MachineID}}">{{assetLabel .MachineID $.AssetLabelByID}}</a>{{else}}—{{end}}</td>
<td><span class="badge {{componentStatusClass (index $.ComponentStatusByID .PartID)}}">{{componentStatusText (index $.ComponentStatusByID .PartID)}}</span></td>
<td><span class="badge {{assetStatusClass (assetStatusByPtr .MachineID $.AssetStatusByID)}}">{{assetStatusText (assetStatusByPtr .MachineID $.AssetStatusByID)}}</span></td>
<td>{{.FailureType}}</td>
<td title="{{formatTimeFull .FailureTime}}">{{formatTime .FailureTime}}</td>
<td>{{formatFloatPtr .Confidence 2}}</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
<div class="meta">No failures ingested yet.</div>
{{end}}
</section>
</main>
</body>
</html>
{{end}}