dashboard/app: allow fragment links to namespaces

Now "#foo" link will point to namespace "foo".
This commit is contained in:
Dmitry Vyukov 2017-12-12 14:55:43 +01:00
parent 433029d5d4
commit 9d46048cb9
3 changed files with 8 additions and 6 deletions

View File

@ -73,6 +73,7 @@ type uiBugPage struct {
type uiBugGroup struct {
Now time.Time
Caption string
Namespace string
ShowNamespace bool
Bugs []*uiBug
}
@ -273,9 +274,10 @@ func fetchBugs(c context.Context) ([]*uiBugGroup, error) {
for ns, bugs := range groups {
sort.Sort(uiBugSorter(bugs))
res = append(res, &uiBugGroup{
Now: now,
Caption: fmt.Sprintf("%v (%v)", ns, len(bugs)),
Bugs: bugs,
Now: now,
Caption: fmt.Sprintf("%v (%v)", ns, len(bugs)),
Namespace: ns,
Bugs: bugs,
})
}
sort.Sort(uiBugGroupSorter(res))

View File

@ -22,7 +22,7 @@ Main page.
</script>
<br><br>
<table class="list_table">
<table class="list_table" id="managers">
<caption>Managers:</caption>
<tr>
<th>Name</th>
@ -57,7 +57,7 @@ Main page.
</table>
<br><br>
<table class="list_table">
<table class="list_table" id="jobs">
<caption>Recent jobs:</caption>
<tr>
<th>Created</th>

View File

@ -7,7 +7,7 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the
{{define "bug_list"}}
{{if .}}
{{if .Bugs}}
<table class="list_table">
<table class="list_table" id="{{$.Namespace}}">
<caption>{{$.Caption}}:</caption>
<tr>
{{if $.ShowNamespace}}<th>Kernel</th>{{end}}