diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-02-15 15:02:14 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-02-17 19:02:11 +0100 |
| commit | 9e421cc9c50e1529ea5b3b036296df7eee9e32d9 (patch) | |
| tree | 7ecd969c4e73658ff95e22d09f8905088100761a | |
| parent | 223b2499f7165cb71d175701381739aaaee11b05 (diff) | |
dashboard/app: allow showing source coverage report
| -rw-r--r-- | dashboard/app/config.go | 3 | ||||
| -rw-r--r-- | dashboard/app/main.go | 2 | ||||
| -rw-r--r-- | dashboard/app/main.html | 5 |
3 files changed, 9 insertions, 1 deletions
diff --git a/dashboard/app/config.go b/dashboard/app/config.go index aab5492e2..135b4a592 100644 --- a/dashboard/app/config.go +++ b/dashboard/app/config.go @@ -40,6 +40,9 @@ type Config struct { AccessLevel AccessLevel // Name used in UI. DisplayTitle string + // URL of a source coverage report for this namespace + // (uploading/updating the report is out of scope of the system for now). + CoverLink string // Per-namespace clients that act only on a particular namespace. Clients map[string]string // A unique key for hashing, can be anything. diff --git a/dashboard/app/main.go b/dashboard/app/main.go index ae30970c5..0f29e44a0 100644 --- a/dashboard/app/main.go +++ b/dashboard/app/main.go @@ -71,6 +71,7 @@ type uiBugPage struct { type uiBugNamespace struct { Caption string + CoverLink string FixedLink string FixedCount int Groups []*uiBugGroup @@ -363,6 +364,7 @@ func fetchBugs(c context.Context, r *http.Request, onlyFixed string) ([]*uiBugNa } res = append(res, &uiBugNamespace{ Caption: config.Namespaces[ns].DisplayTitle, + CoverLink: config.Namespaces[ns].CoverLink, FixedCount: fixedCount, FixedLink: fixedLink, Groups: uiGroups, diff --git a/dashboard/app/main.html b/dashboard/app/main.html index b25cc5cd1..115b39c5c 100644 --- a/dashboard/app/main.html +++ b/dashboard/app/main.html @@ -113,7 +113,10 @@ Main page. {{range $ns := $.BugNamespaces}} <br> <h2 id="{{$ns.Caption}}">{{$ns.Caption}}</h2> - {{if $ns.FixedCount}} + {{if $ns.FixedLink}} + {{if $ns.CoverLink}} + <a href="{{$ns.CoverLink}}" target="_blank">source coverage</a> | + {{end}} <a href="{{$ns.FixedLink}}">fixed bugs ({{$ns.FixedCount}})</a> {{end}} {{range $group := $ns.Groups}} |
