diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-02-24 16:31:13 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2023-02-27 09:10:32 +0100 |
| commit | 153c64502e7320b56d43c6bfd8dcc79e6bc84208 (patch) | |
| tree | e7071113bcdb802bed2fb804af8147deff9daa04 /dashboard | |
| parent | d97ac51374b09274ae135c21253bea2dd4f3aa49 (diff) | |
dashboard: improve the bug subsystem page
Hide children with 0 bugs and show parent subsystems.
Diffstat (limited to 'dashboard')
| -rw-r--r-- | dashboard/app/main.go | 12 | ||||
| -rw-r--r-- | dashboard/app/subsystem_page.html | 7 |
2 files changed, 18 insertions, 1 deletions
diff --git a/dashboard/app/main.go b/dashboard/app/main.go index 4bf69e94b..e6d064c81 100644 --- a/dashboard/app/main.go +++ b/dashboard/app/main.go @@ -151,6 +151,7 @@ type uiSubsystemPage struct { Header *uiHeader Info *uiSubsystem Children []*uiSubsystem + Parents []*uiSubsystem Groups []*uiBugGroup } @@ -482,13 +483,22 @@ func handleSubsystemPage(c context.Context, w http.ResponseWriter, r *http.Reque } children := []*uiSubsystem{} for _, item := range service.Children(subsystem) { - children = append(children, createUISubsystem(hdr.Namespace, item, cached)) + uiChild := createUISubsystem(hdr.Namespace, item, cached) + if uiChild.Open.Count+uiChild.Fixed.Count == 0 { + continue + } + children = append(children, uiChild) + } + parents := []*uiSubsystem{} + for _, item := range subsystem.Parents { + parents = append(parents, createUISubsystem(hdr.Namespace, item, cached)) } sort.Slice(children, func(i, j int) bool { return children[i].Name < children[j].Name }) return serveTemplate(w, "subsystem_page.html", &uiSubsystemPage{ Header: hdr, Info: createUISubsystem(hdr.Namespace, subsystem, cached), Children: children, + Parents: parents, Groups: groups, }) } diff --git a/dashboard/app/subsystem_page.html b/dashboard/app/subsystem_page.html index d965f1d99..45ada7b45 100644 --- a/dashboard/app/subsystem_page.html +++ b/dashboard/app/subsystem_page.html @@ -21,6 +21,13 @@ The list of polled trees. <b>Maintainer(s):</b> {{.Info.Maintainers}}<br> {{end}} <b>Fixed bugs:</b> {{link .Info.Fixed.Link (printf "%d" .Info.Fixed.Count)}}<br> + {{if .Parents}} + <b>Parent subsystem(s):</b> + {{range .Parents}} + {{link .Open.Link .Name}} ({{.Open.Count}}) + {{end}} + <br> + {{end}} {{if .Children}} <b>Child subsystems:</b> {{range .Children}} |
