From 4e8554f5f05623aaee9b1202c68d5fbe84147840 Mon Sep 17 00:00:00 2001 From: Michael Chus Date: Sun, 22 Feb 2026 21:20:38 +0300 Subject: [PATCH] Add UI search page template --- internal/api/ui_search.tmpl | 121 ++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 internal/api/ui_search.tmpl diff --git a/internal/api/ui_search.tmpl b/internal/api/ui_search.tmpl new file mode 100644 index 0000000..76eceb0 --- /dev/null +++ b/internal/api/ui_search.tmpl @@ -0,0 +1,121 @@ +{{define "search"}} + + +{{template "head" .}} + + {{template "topbar" .}} + {{template "breadcrumbs" .}} + +
+
+

Global Search

+ {{if not .HasQuery}} +
Enter a query in the search box above. Search covers assets, components, and failure events.
+ {{else}} +
Query: {{.Query}} · Total matches: {{.TotalMatches}}
+ {{end}} +
+ + {{if .HasQuery}} +
+

Assets

+ {{if .Assets}} + + + + + + + + + + + + + {{range .Assets}} + + + + + + + + + {{end}} + +
StatusNameVendor SerialVendorModelID
{{assetStatusText (index $.AssetStatusByID .ID)}}{{.Name}}{{.VendorSerial}}{{if .Vendor}}{{.Vendor}}{{else}}—{{end}}{{if .Model}}{{.Model}}{{else}}—{{end}}{{.ID}}
+ {{template "pagination" .AssetsPager}} + {{else}} +
No asset matches.
+ {{end}} +
+ +
+

Components

+ {{if .Components}} + + + + + + + + + + + + + {{range .Components}} + + + + + + {{$asset := index $.ComponentAssetByID .ID}} + + + + {{end}} + +
StatusVendor SerialVendorModelAssetID
{{componentStatusText (index $.ComponentStatusByID .ID)}}{{.VendorSerial}}{{if .Vendor}}{{.Vendor}}{{else}}—{{end}}{{if .Model}}{{.Model}}{{else}}—{{end}}{{if $asset.ID}}{{$asset.Label}}{{else}}—{{end}}{{.ID}}
+ {{template "pagination" .ComponentsPager}} + {{else}} +
No component matches.
+ {{end}} +
+ +
+

Failure Events

+ {{if .Failures}} + + + + + + + + + + + + {{range .Failures}} + + + + + + + + {{end}} + +
TimeTypeAssetComponentExternal ID
{{formatTime .FailureTime}}{{.FailureType}}{{if .MachineID}}{{assetLabel .MachineID $.AssetLabelByID}}{{else}}—{{end}}{{componentLabelByID .PartID $.ComponentLabelByID}}{{.ExternalID}}
+ {{template "pagination" .FailuresPager}} + {{else}} +
No failure matches.
+ {{end}} +
+ {{end}} +
+ + +{{end}}