From 9e2ebb3c174f1e168bc1fbadd5f02f2e25e314fc Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 22 Feb 2023 18:06:18 +0100 Subject: dashboard: cosmetic changes to the subsystems list 1) Add more space between the lines above the table. 2) Rename the "no subsystems" row and move it to the bottom. 3) Display the correct count of fixed unclassified bugs. --- dashboard/app/main.go | 24 +++++++++++++----------- dashboard/app/subsystems.html | 34 +++++++++++++++++++++------------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/dashboard/app/main.go b/dashboard/app/main.go index ad503c0ef..65c79fc9d 100644 --- a/dashboard/app/main.go +++ b/dashboard/app/main.go @@ -155,10 +155,11 @@ type uiSubsystemPage struct { } type uiSubsystemsPage struct { - Header *uiHeader - List []*uiSubsystem - NonEmpty bool - EmptyURL string + Header *uiHeader + List []*uiSubsystem + Unclassified *uiSubsystem + NonEmpty bool + EmptyURL string } type uiSubsystem struct { @@ -867,23 +868,24 @@ func handleSubsystemsList(c context.Context, w http.ResponseWriter, r *http.Requ } list = append(list, record) } - list = append(list, &uiSubsystem{ + unclassified := &uiSubsystem{ Name: "", Open: uiSubsystemStats{ Count: cached.NoSubsystem.Open, Link: html.AmendURL("/"+hdr.Namespace, "no_subsystem", "true"), }, Fixed: uiSubsystemStats{ - Count: cached.NoSubsystem.Open, + Count: cached.NoSubsystem.Fixed, Link: html.AmendURL("/"+hdr.Namespace+"/fixed", "no_subsystem", "true"), }, - }) + } sort.Slice(list, func(i, j int) bool { return list[i].Name < list[j].Name }) return serveTemplate(w, "subsystems.html", &uiSubsystemsPage{ - Header: hdr, - List: list, - NonEmpty: nonEmpty, - EmptyURL: html.AmendURL(getCurrentURL(c), "all", "true"), + Header: hdr, + List: list, + Unclassified: unclassified, + NonEmpty: nonEmpty, + EmptyURL: html.AmendURL(getCurrentURL(c), "all", "true"), }) } diff --git a/dashboard/app/subsystems.html b/dashboard/app/subsystems.html index 2b1fe0f57..efaf45c7f 100644 --- a/dashboard/app/subsystems.html +++ b/dashboard/app/subsystems.html @@ -14,30 +14,38 @@ The list of polled trees. {{template "header" .Header}}

The list of subsystems


- (*) Note that the numbers below do not represent the latest data. They are updated once an hour.
+ (*) Note that the numbers below do not represent the latest data. They are updated once an hour.

{{if .NonEmpty}} - Empty subsystems have been hidden from the list. {{link .EmptyURL "Show all"}}.
+ Empty subsystems have been hidden from the list. {{link .EmptyURL "Show all"}}.
{{end}} - - - - - - + + + + + + + + + {{range $item := .List}} - {{if $item.Name}} - - {{else}} - - {{end}} + {{end}} + + + + + + + + +
Subsystems list
NameList(s)Open bugsFixed
NameList(s)Open bugsFixed
{{link $item.Open.Link $item.Name}}{{link $item.Open.Link "no subsystem"}}{{link $item.Open.Link $item.Name}} {{$item.Lists}} {{link $item.Open.Link (printf "%d" $item.Open.Count)}} {{link $item.Fixed.Link (printf "%d" $item.Fixed.Count)}}
{{link .Unclassified.Open.Link "unclassified"}}-{{link .Unclassified.Open.Link (printf "%d" .Unclassified.Open.Count)}}{{link .Unclassified.Fixed.Link (printf "%d" .Unclassified.Fixed.Count)}}
-- cgit mrf-deployment