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

Unified Diff: milo/appengine/frontend/templates/pages/builder.html

Issue 2931773004: Milo: Add machine pool info for buildbot builder view. (Closed)
Patch Set: Rebase Created 3 years, 6 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
Index: milo/appengine/frontend/templates/pages/builder.html
diff --git a/milo/appengine/frontend/templates/pages/builder.html b/milo/appengine/frontend/templates/pages/builder.html
index 6b4e5dd4845c21bb3d138e89ebfa88f80ade9735..91a5ef79b54e31a164a329aad9e77f09ff43133f 100644
--- a/milo/appengine/frontend/templates/pages/builder.html
+++ b/milo/appengine/frontend/templates/pages/builder.html
@@ -8,127 +8,184 @@
{{define "body"}}
<h1>Builder <a href="{{ pagedURL .Request -1 "EMPTY" }}">{{.Builder.Name}}</a></h1>
-{{ if .Builder.CurrentBuilds }}
- <h2>Current Builds ({{len .Builder.CurrentBuilds}}):</h2>
- <ul>
- {{ range .Builder.CurrentBuilds }}
- <li>{{ .Link | linkify }}
+<div class="prelude">
+ <div class="column">
+ {{ if .Builder.MachinePool }}
+ {{ with .Builder.MachinePool }}
+ <h2>Machine Pool:</h2>
+ <table>
+ <tr>
+ <td>Idle</td><td>{{ .Idle }}</td>
+ <td class="graph">
+ {{ if gt .Idle 0 }}
+ <div class="bar idle" style="width: {{ percent .Idle .Total }}%"></div>
+ {{ end }}
+ </td>
+ </tr><tr>
+ <td>Busy</td><td>{{ .Busy }}</td>
+ <td class="graph">
+ {{ if gt .Busy 0 }}
+ <div class="bar busy" style="width: {{ percent .Busy .Total }}%"></div>
+ {{ end }}
+ </td>
+ </tr><tr>
+ <td>Disconnected</td><td>{{ .Disconnected }}</td>
+ <td class="graph">
+ {{ if gt .Disconnected 0 }}
+ <div class="bar disconnected"
+ style="width: {{ percent .Disconnected .Total }}%"></div>
+ {{ end }}
+ </td>
+ </tr>
nodir 2017/06/13 02:38:40 copy pasta :( i don't have suggestions
Ryan Tseng 2017/06/13 23:10:33 Could define a template function, but that seems a
+ </table>
+ <details>
+ <summary>{{ .Total }} bots</summary>
+ <table class="info">
+ <tr><th>Name</th><th>Status</th></tr>
+ {{ range .Bots }}
+ <tr>
+ <td>{{ .Name | linkify }}</td>
+ <td class="status-{{ .Status.String }}">{{ .Status.String }}</td>
+ </tr>
+ {{ end }}
+ </table>
+ </details>
+ {{ end }}
+ {{ end }}
+ </div>
+
+ <div class="column">
+ {{ if .Builder.CurrentBuilds }}
+ <h2>Current Builds ({{len .Builder.CurrentBuilds}}):</h2>
+ <ul>
+ {{ range .Builder.CurrentBuilds }}
+ <li>{{ .Link | linkify }}
+ {{ $nb := len .Blame }}
+ {{ if lt $nb 4 }}
+ {{ range $i, $c := .Blame }}
+ {{ if gt $i 0 }},{{ end }}
nodir 2017/06/13 02:38:40 i believe this creates a space between an email an
Ryan Tseng 2017/06/13 23:10:33 Done.
+ {{ if .Changelist }}
+ {{ .Changelist | linkify }}
+ {{ if .AuthorEmail }}
+ by {{ .AuthorEmail }}
+ {{ end }}
+ {{ else }}
+ (<a href="{{ .CommitURL }}">{{ .AuthorEmail }}</a>)
nodir 2017/06/13 02:38:40 L69 suggests that AuthorEmail can be empty. Can it
Ryan Tseng 2017/06/13 23:10:33 Done.
+ {{ end }}
+ {{ end }}
+ {{ else }}
+ ({{ $nb }} changes)
+ {{ end }}
+ [Running for: {{ .ExecutionTime.Duration | humanDuration }}]
+ {{ range .Text }} {{ . }}{{ end }}
+ </li>
+ {{ end }}
+ </ul>
+ {{ else }}
+ <h2>No current builds</h2>
+ {{ end }}
+ </div>
+
+ <div class="column">
+ {{ if .Builder.PendingBuilds }}
+ <h2>Pending Build Requests ({{len .Builder.PendingBuilds}}):</h2>
+ <ul>
+ {{ range .Builder.PendingBuilds }}
+ <li><small>({{ .PendingTime.Started | localTime "" }}, waiting {{ .PendingTime.Duration | humanDuration }})</small>
+
{{ $nb := len .Blame }}
{{ if lt $nb 4 }}
{{ range $i, $c := .Blame }}
- {{ if gt $i 0 }},{{ end }}
- {{ if .Changelist }}
- {{ .Changelist | linkify }}
- {{ if .AuthorEmail }}
- by {{ .AuthorEmail }}
- {{ end }}
- {{ else }}
- (<a href="{{ .CommitURL }}">{{ .AuthorEmail }}</a>)
- {{ end }}
+ (<a href="{{ .CommitURL }}">{{ .AuthorEmail }}</a>)
+ {{ if ne $i (sub $nb 1) }},{{ end }}
{{ end }}
{{ else }}
({{ $nb }} changes)
{{ end }}
- [Running for: {{ .ExecutionTime.Duration | humanDuration }}]
- {{ range .Text }} {{ . }}{{ end }}
- </li>
- {{ end }}
- </ul>
-{{ else }}
- <h2>No current builds</h2>
-{{ end }}
-{{ if .Builder.PendingBuilds }}
- <h2>Pending Build Requests ({{len .Builder.PendingBuilds}}):</h2>
- <ul>
- {{ range .Builder.PendingBuilds }}
- <li><small>({{ .PendingTime.Started | localTime "" }}, waiting {{ .PendingTime.Duration | humanDuration }})</small>
-
- {{ $nb := len .Blame }}
- {{ if lt $nb 4 }}
- {{ range $i, $c := .Blame }}
- (<a href="{{ .CommitURL }}">{{ .AuthorEmail }}</a>)
- {{ if ne $i (sub $nb 1) }},{{ end }}
- {{ end }}
- {{ else }}
- ({{ $nb }} changes)
+ </li>
{{ end }}
-
- </li>
+ </ul>
+ {{ else }}
+ <h2>No Pending Build Requests</h2>
{{ end }}
- </ul>
-{{ else }}
- <h2>No Pending Build Requests</h2>
-{{ end }}
+ </div>
+</div>
-{{ if .Builder.FinishedBuilds }}
- <h2>Recent Builds:</h2>
+<div class="main">
+ {{ if .Builder.FinishedBuilds }}
+ <h2>Recent Builds:</h2>
- <table class="info">
- <tr>
- <th>Time</th>
- <th>Revision</th>
- <th>Result</th>
- <th>Build #</th>
- <th>Changes</th>
- <th>Info</th>
- </tr>
-
- {{ range .Builder.FinishedBuilds }}
+ <table class="info">
<tr>
- <td>{{ .ExecutionTime.Finished | localTime "" }}</td>
- <td class="revision">{{ .Revision }}</td>
- {{ if eq .Status.String "Success" }}
- <td class="status-Success">Success</td>
- {{ else if eq .Status.String "Failure" }}
- <td class="status-Failure">Failed</td>
- {{ else if eq .Status.String "InfraFailure" }}
- <td class="status-Exception">Infra Failure</td>
- {{ else if eq .Status.String "Exception" }}
- <td class="status-Exception">Exception</td>
- {{ else }}
- <td> {{ .Status.String }} </td>
- {{ end }}
- <td>{{ .Link | linkify }}</td>
- <td>
- {{ $nb := len .Blame }}
- {{ if lt $nb 4 }}
- {{ range $i, $c := .Blame }}
- {{ if gt $i 0 }},{{ end }}
- {{ if .Changelist }}
- {{ .Changelist | linkify }}
- {{ if .AuthorEmail }}
- by {{ .AuthorEmail }}
+ <th>Time</th>
+ <th>Revision</th>
+ <th>Result</th>
+ <th>Build #</th>
+ <th>Changes</th>
+ <th>Info</th>
+ </tr>
+
+ {{ range .Builder.FinishedBuilds }}
+ <tr>
+ <td>{{ .ExecutionTime.Finished | localTime "" }}</td>
+ <td class="revision">{{ .Revision }}</td>
+ {{ if eq .Status.String "Success" }}
+ <td class="status-Success">Success</td>
+ {{ else if eq .Status.String "Failure" }}
+ <td class="status-Failure">Failed</td>
+ {{ else if eq .Status.String "InfraFailure" }}
+ <td class="status-Exception">Infra Failure</td>
+ {{ else if eq .Status.String "Exception" }}
+ <td class="status-Exception">Exception</td>
+ {{ else }}
+ <td> {{ .Status.String }} </td>
+ {{ end }}
+ <td>{{ .Link | linkify }}</td>
+ <td>
+ {{ $nb := len .Blame }}
+ {{ if lt $nb 4 }}
+ {{ range $i, $c := .Blame }}
+ {{ if gt $i 0 }},{{ end }}
+ {{ if .Changelist }}
+ {{ .Changelist | linkify }}
+ {{ if .AuthorEmail }}
+ by {{ .AuthorEmail }}
+ {{ end }}
+ {{ else }}
+ (<a href="{{ .CommitURL }}">{{ .AuthorEmail }}</a>)
{{ end }}
- {{ else }}
- (<a href="{{ .CommitURL }}">{{ .AuthorEmail }}</a>)
{{ end }}
+ {{ else }}
+ ({{ $nb }} changes)
{{ end }}
nodir 2017/06/13 02:38:40 please reduce copy paste by using {{define "blamel
Ryan Tseng 2017/06/13 23:10:33 Done.
- {{ else }}
- ({{ $nb }} changes)
- {{ end }}
- </td>
- <td class="left">
- {{ range $i, $value := .Text }}
- {{ if gt $i 0 }}<br>{{ end }}
- {{ . }}
- {{ end }}
- </td>
- </tr>
- {{ end }}
- </table>
-{{ else }}
- <h2>No Recent Builds</h2>
-{{ end }}
+ </td>
+ <td class="left">
+ {{ range $i, $value := .Text }}
+ {{ if gt $i 0 }}<br>{{ end }}
+ {{ . }}
+ {{ end }}
+ </td>
+ </tr>
+ {{ end }}
+ </table>
+ {{ else }}
+ <h2>No Recent Builds</h2>
+ {{ end }}
+</div>
-{{ if .Builder.PrevCursor }}<a href="{{ pagedURL .Request 0 .Builder.PrevCursor }}">Prev</a>{{ end }}
-(Show:
-<a href="{{ pagedURL .Request -1 "" }}">default</a>
-<a href="{{ pagedURL .Request 25 "" }}">25</a>
-<a href="{{ pagedURL .Request 50 "" }}">50</a>
-<a href="{{ pagedURL .Request 100 "" }}">100</a>
-<a href="{{ pagedURL .Request 200 "" }}">200</a>
-)
-{{ if .Builder.NextCursor }}<a href="{{ pagedURL .Request 0 .Builder.NextCursor}}">Next</a>{{ end }}
+<div class="epiloge">
+ {{ if .Builder.PrevCursor }}<a href="{{ pagedURL .Request 0 .Builder.PrevCursor }}">Prev</a>{{ end }}
+ (Show:
+ <a href="{{ pagedURL .Request -1 "" }}">default</a>
+ <a href="{{ pagedURL .Request 25 "" }}">25</a>
+ <a href="{{ pagedURL .Request 50 "" }}">50</a>
+ <a href="{{ pagedURL .Request 100 "" }}">100</a>
+ <a href="{{ pagedURL .Request 200 "" }}">200</a>
+ )
+ {{ if .Builder.NextCursor }}
+ <a href="{{ pagedURL .Request 0 .Builder.NextCursor}}">Next</a>
+ {{ end }}
+</div>
{{end}}
« milo/appengine/common/funcs.go ('K') | « milo/appengine/frontend/static/buildbot/css/default.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698