Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: milo/frontend/middleware.go

Issue 2978293002: [milo] Add an (uncached) method to get console rows. (Closed)
Patch Set: make manifestkey its own type Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « milo/frontend/appengine/templates/pages/console.html ('k') | milo/frontend/view_console.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/frontend/middleware.go
diff --git a/milo/frontend/middleware.go b/milo/frontend/middleware.go
index b728c2296285f8e33e1cd47a5a8894d3740525a3..0e3e037c1f860e25a5c4ecf97e80d21e9de71c2d 100644
--- a/milo/frontend/middleware.go
+++ b/milo/frontend/middleware.go
@@ -42,7 +42,6 @@ var funcMap = template.FuncMap{
"shortHash": shortHash,
"startswith": strings.HasPrefix,
"sub": sub,
- "consoleHeader": consoleHeader,
"pagedURL": pagedURL,
"formatTime": formatTime,
"percent": percent,
@@ -62,54 +61,6 @@ func localTime(ifZero string, t time.Time) template.HTML {
t.Format(time.RFC850)))
}
-func consoleHeader(brs []resp.BuilderRef) template.HTML {
- // First, split things into nice rows and find the max depth.
- cat := make([][]string, len(brs))
- depth := 0
- for i, b := range brs {
- cat[i] = b.Category
- if len(cat[i]) > depth {
- depth = len(cat[i])
- }
- }
-
- result := ""
- for row := 0; row < depth; row++ {
- result += "<tr><th></th>"
- // "" is the first node, " " is an empty node.
- current := ""
- colspan := 0
- for _, br := range cat {
- colspan++
- var s string
- if row >= len(br) {
- s = " "
- } else {
- s = br[row]
- }
- if s != current || current == " " {
- if current != "" || current == " " {
- result += fmt.Sprintf(`<th colspan="%d">%s</th>`, colspan, current)
- colspan = 0
- }
- current = s
- }
- }
- if colspan != 0 {
- result += fmt.Sprintf(`<th colspan="%d">%s</th>`, colspan, current)
- }
- result += "</tr>"
- }
-
- // Last row: The actual builder shortnames.
- result += "<tr><th></th>"
- for _, br := range brs {
- result += fmt.Sprintf("<th>%s</th>", br.ShortName)
- }
- result += "</tr>"
- return template.HTML(result)
-}
-
// humanDuration translates d into a human readable string of x units y units,
// where x and y could be in days, hours, minutes, or seconds, whichever is the
// largest.
« no previous file with comments | « milo/frontend/appengine/templates/pages/console.html ('k') | milo/frontend/view_console.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698