From 61aa77c4973dad8a2c275ce52a554889e9c31a01 Mon Sep 17 00:00:00 2001 From: Desmond Cheong Zhi Xi Date: Wed, 16 Jun 2021 19:24:11 +0800 Subject: dashboard/app: add last activity info to bug list Last activity information is only added to the bug list on the main page. This allows users to quickly scan the bug list to identify bugs that are receiving attention and those that are neglected. --- CONTRIBUTORS | 1 + dashboard/app/main.go | 6 ++++++ dashboard/app/templates.html | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index ac6f8695d..e22345915 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -92,3 +92,4 @@ Microsoft Corporation Mickaël Salaün ANSSI Vincent Dagonneau +Desmond Cheong Zhi Xi \ No newline at end of file diff --git a/dashboard/app/main.go b/dashboard/app/main.go index e531b808a..b7d2ed69f 100644 --- a/dashboard/app/main.go +++ b/dashboard/app/main.go @@ -136,6 +136,7 @@ type uiBugGroup struct { ShowStatus bool ShowIndex int Bugs []*uiBug + DispLastAct bool } type uiJobList struct { @@ -164,6 +165,7 @@ type uiBug struct { PatchedOn []string MissingOn []string NumManagers int + LastActivity time.Time } type uiCrash struct { @@ -230,6 +232,9 @@ func handleMain(c context.Context, w http.ResponseWriter, r *http.Request) error if err != nil { return err } + for _, group := range groups { + group.DispLastAct = true + } data := &uiMainPage{ Header: hdr, Decommissioned: config.Namespaces[hdr.Namespace].Decommissioned, @@ -846,6 +851,7 @@ func createUIBug(c context.Context, bug *Bug, state *ReportingState, managers [] ExternalLink: link, CreditEmail: creditEmail, NumManagers: len(managers), + LastActivity: bug.LastActivity, } updateBugBadness(c, uiBug) if len(bug.Commits) != 0 { diff --git a/dashboard/app/templates.html b/dashboard/app/templates.html index 7a26bb275..dc9e8869d 100644 --- a/dashboard/app/templates.html +++ b/dashboard/app/templates.html @@ -98,6 +98,9 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the Count Last Reported + {{if $.DispLastAct}} + Last activity + {{end}} {{if $.ShowPatch}} Closed Patch @@ -127,6 +130,9 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the {{formatLateness $.Now $b.ReportedTime}} {{end}} + {{if $.DispLastAct}} + {{formatLateness $.Now $b.LastActivity}} + {{end}} {{if $.ShowPatch}} {{formatLateness $.Now $b.ClosedTime}} {{template "fix_commits" $b.Commits}} -- cgit mrf-deployment