Files
core/internal/api/ui_assets.tmpl
Michael Chus 5f96ff2273 Add UI improvements: date formatting, breadcrumbs, clickable rows, and structured menu
- Format dates as YYYY-MM-DD with full timestamp on hover
- Add breadcrumb navigation with hospital icon (🏥) across all pages
- Restructure main menu with grouped dropdowns:
  * Hardware (Assets, Components)
  * Health (Tickets, Failures, Analytics)
  * Settings (Ingest)
- Make table rows clickable on Dashboard, Assets, and Components pages
- Add new Customers page with list view
- Improve dropdown menu stability with JS hover delay

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 08:46:07 +03:00

96 lines
3.2 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.AssetTag}}{{.Asset.AssetTag}}{{else}}—{{end}}</div>
<div><span>Project ID</span>{{.Asset.ProjectID}}</div>
<div><span>Location ID</span>{{if .Asset.LocationID}}{{.Asset.LocationID}}{{else}}—{{end}}</div>
</div>
</section>
<section class="card">
<h2>Current Components</h2>
{{if .Components}}
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>Vendor Serial</th>
<th>Vendor</th>
<th>Model</th>
<th>Lot</th>
<th>First Seen</th>
</tr>
</thead>
<tbody>
{{range .Components}}
<tr class="clickable" onclick="navigateToRow('/ui/components/{{.ID}}')">
<td><a href="/ui/components/{{.ID}}">{{.ID}}</a></td>
<td>{{.VendorSerial}}</td>
<td>{{if .Vendor}}{{.Vendor}}{{else}}—{{end}}</td>
<td>{{if .Model}}{{.Model}}{{else}}—{{end}}</td>
<td>{{if .LotID}}{{.LotID}}{{else}}—{{end}}</td>
<td title="{{formatTimePtrFull .FirstSeenAt}}">{{formatTimePtr .FirstSeenAt}}</td>
</tr>
{{end}}
</tbody>
</table>
{{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">{{.EventType}}</div>
</div>
<div>
<div class="detail">Asset {{if .AssetID}}{{.AssetID}}{{else}}—{{end}} · Component {{if .ComponentID}}{{.ComponentID}}{{else}}—{{end}}</div>
<div class="meta">Firmware {{if .FirmwareVersion}}{{.FirmwareVersion}}{{else}}—{{end}}</div>
</div>
</div>
{{end}}
</div>
{{else}}
<div class="meta">No timeline events.</div>
{{end}}
</section>
<section class="card">
<h2>Linked Tickets</h2>
{{if .Tickets}}
<div class="tickets">
{{range .Tickets}}
<div class="ticket">
<div class="title">{{.Title}}</div>
<div class="meta">{{.Source}} · {{.ExternalID}} · {{.Status}} · Opened <span title="{{formatTimePtrFull .OpenedAt}}">{{formatTimePtr .OpenedAt}}</span></div>
{{if .URL}}<div class="meta"><a href="{{.URL}}" target="_blank" rel="noreferrer">Ticket link</a></div>{{end}}
</div>
{{end}}
</div>
{{else}}
<div class="meta">No linked tickets.</div>
{{end}}
</section>
</main>
</body>
</html>
{{end}}