Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 {{define "title"}}Builder {{ .Builder.Name }}{{end}} | 1 {{define "title"}}Builder {{ .Builder.Name }}{{end}} |
| 2 | 2 |
| 3 {{define "head"}} | 3 {{define "head"}} |
| 4 <link id="favicon" rel="shortcut icon" | 4 <link id="favicon" rel="shortcut icon" |
| 5 type="image/png" href="/static/common/favicon/milo-32.png"> | 5 type="image/png" href="/static/common/favicon/milo-32.png"> |
| 6 {{end}} | 6 {{end}} |
| 7 | 7 |
| 8 {{define "body"}} | 8 {{define "body"}} |
| 9 <h1>Builder <a href="{{ pagedURL .Request -1 "EMPTY" }}">{{.Builder.Name}}</a></ h1> | 9 <h1>Builder <a href="{{ pagedURL .Request -1 "EMPTY" }}">{{.Builder.Name}}</a></ h1> |
| 10 | 10 |
| 11 {{ if .Builder.CurrentBuilds }} | 11 <div class="prelude"> |
| 12 <h2>Current Builds ({{len .Builder.CurrentBuilds}}):</h2> | 12 <div class="column"> |
| 13 <ul> | 13 {{ if .Builder.MachinePool }} |
| 14 {{ range .Builder.CurrentBuilds }} | 14 {{ with .Builder.MachinePool }} |
| 15 <li>{{ .Link | linkify }} | 15 <h2>Machine Pool:</h2> |
| 16 <table> | |
| 17 <tr> | |
| 18 <td>Idle</td><td>{{ .Idle }}</td> | |
| 19 <td class="graph"> | |
| 20 {{ if gt .Idle 0 }} | |
| 21 <div class="bar idle" style="width: {{ percent .Idle .Total }}%">< /div> | |
| 22 {{ end }} | |
| 23 </td> | |
| 24 </tr><tr> | |
| 25 <td>Busy</td><td>{{ .Busy }}</td> | |
| 26 <td class="graph"> | |
| 27 {{ if gt .Busy 0 }} | |
| 28 <div class="bar busy" style="width: {{ percent .Busy .Total }}%">< /div> | |
| 29 {{ end }} | |
| 30 </td> | |
| 31 </tr><tr> | |
| 32 <td>Disconnected</td><td>{{ .Disconnected }}</td> | |
| 33 <td class="graph"> | |
| 34 {{ if gt .Disconnected 0 }} | |
| 35 <div class="bar disconnected" | |
| 36 style="width: {{ percent .Disconnected .Total }}%"></div> | |
| 37 {{ end }} | |
| 38 </td> | |
| 39 </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
| |
| 40 </table> | |
| 41 <details> | |
| 42 <summary>{{ .Total }} bots</summary> | |
| 43 <table class="info"> | |
| 44 <tr><th>Name</th><th>Status</th></tr> | |
| 45 {{ range .Bots }} | |
| 46 <tr> | |
| 47 <td>{{ .Name | linkify }}</td> | |
| 48 <td class="status-{{ .Status.String }}">{{ .Status.String }}</td> | |
| 49 </tr> | |
| 50 {{ end }} | |
| 51 </table> | |
| 52 </details> | |
| 53 {{ end }} | |
| 54 {{ end }} | |
| 55 </div> | |
| 56 | |
| 57 <div class="column"> | |
| 58 {{ if .Builder.CurrentBuilds }} | |
| 59 <h2>Current Builds ({{len .Builder.CurrentBuilds}}):</h2> | |
| 60 <ul> | |
| 61 {{ range .Builder.CurrentBuilds }} | |
| 62 <li>{{ .Link | linkify }} | |
| 63 {{ $nb := len .Blame }} | |
| 64 {{ if lt $nb 4 }} | |
| 65 {{ range $i, $c := .Blame }} | |
| 66 {{ 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.
| |
| 67 {{ if .Changelist }} | |
| 68 {{ .Changelist | linkify }} | |
| 69 {{ if .AuthorEmail }} | |
| 70 by {{ .AuthorEmail }} | |
| 71 {{ end }} | |
| 72 {{ else }} | |
| 73 (<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.
| |
| 74 {{ end }} | |
| 75 {{ end }} | |
| 76 {{ else }} | |
| 77 ({{ $nb }} changes) | |
| 78 {{ end }} | |
| 79 [Running for: {{ .ExecutionTime.Duration | humanDuration }}] | |
| 80 {{ range .Text }} {{ . }}{{ end }} | |
| 81 </li> | |
| 82 {{ end }} | |
| 83 </ul> | |
| 84 {{ else }} | |
| 85 <h2>No current builds</h2> | |
| 86 {{ end }} | |
| 87 </div> | |
| 88 | |
| 89 <div class="column"> | |
| 90 {{ if .Builder.PendingBuilds }} | |
| 91 <h2>Pending Build Requests ({{len .Builder.PendingBuilds}}):</h2> | |
| 92 <ul> | |
| 93 {{ range .Builder.PendingBuilds }} | |
| 94 <li><small>({{ .PendingTime.Started | localTime "" }}, waiting {{ .Pending Time.Duration | humanDuration }})</small> | |
| 95 | |
| 16 {{ $nb := len .Blame }} | 96 {{ $nb := len .Blame }} |
| 17 {{ if lt $nb 4 }} | 97 {{ if lt $nb 4 }} |
| 18 {{ range $i, $c := .Blame }} | 98 {{ range $i, $c := .Blame }} |
| 19 {{ if gt $i 0 }},{{ end }} | 99 (<a href="{{ .CommitURL }}">{{ .AuthorEmail }}</a>) |
| 20 {{ if .Changelist }} | 100 {{ if ne $i (sub $nb 1) }},{{ end }} |
| 21 {{ .Changelist | linkify }} | |
| 22 {{ if .AuthorEmail }} | |
| 23 by {{ .AuthorEmail }} | |
| 24 {{ end }} | |
| 25 {{ else }} | |
| 26 (<a href="{{ .CommitURL }}">{{ .AuthorEmail }}</a>) | |
| 27 {{ end }} | |
| 28 {{ end }} | 101 {{ end }} |
| 29 {{ else }} | 102 {{ else }} |
| 30 ({{ $nb }} changes) | 103 ({{ $nb }} changes) |
| 31 {{ end }} | 104 {{ end }} |
| 32 [Running for: {{ .ExecutionTime.Duration | humanDuration }}] | 105 |
| 33 {{ range .Text }} {{ . }}{{ end }} | 106 </li> |
| 34 </li> | 107 {{ end }} |
| 108 </ul> | |
| 109 {{ else }} | |
| 110 <h2>No Pending Build Requests</h2> | |
| 35 {{ end }} | 111 {{ end }} |
| 36 </ul> | 112 </div> |
| 37 {{ else }} | 113 </div> |
| 38 <h2>No current builds</h2> | |
| 39 {{ end }} | |
| 40 | 114 |
| 41 {{ if .Builder.PendingBuilds }} | 115 <div class="main"> |
| 42 <h2>Pending Build Requests ({{len .Builder.PendingBuilds}}):</h2> | 116 {{ if .Builder.FinishedBuilds }} |
| 43 <ul> | 117 <h2>Recent Builds:</h2> |
| 44 {{ range .Builder.PendingBuilds }} | |
| 45 <li><small>({{ .PendingTime.Started | localTime "" }}, waiting {{ .PendingTi me.Duration | humanDuration }})</small> | |
| 46 | 118 |
| 47 {{ $nb := len .Blame }} | 119 <table class="info"> |
| 48 {{ if lt $nb 4 }} | 120 <tr> |
| 49 {{ range $i, $c := .Blame }} | 121 <th>Time</th> |
| 50 (<a href="{{ .CommitURL }}">{{ .AuthorEmail }}</a>) | 122 <th>Revision</th> |
| 51 {{ if ne $i (sub $nb 1) }},{{ end }} | 123 <th>Result</th> |
| 124 <th>Build #</th> | |
| 125 <th>Changes</th> | |
| 126 <th>Info</th> | |
| 127 </tr> | |
| 128 | |
| 129 {{ range .Builder.FinishedBuilds }} | |
| 130 <tr> | |
| 131 <td>{{ .ExecutionTime.Finished | localTime "" }}</td> | |
| 132 <td class="revision">{{ .Revision }}</td> | |
| 133 {{ if eq .Status.String "Success" }} | |
| 134 <td class="status-Success">Success</td> | |
| 135 {{ else if eq .Status.String "Failure" }} | |
| 136 <td class="status-Failure">Failed</td> | |
| 137 {{ else if eq .Status.String "InfraFailure" }} | |
| 138 <td class="status-Exception">Infra Failure</td> | |
| 139 {{ else if eq .Status.String "Exception" }} | |
| 140 <td class="status-Exception">Exception</td> | |
| 141 {{ else }} | |
| 142 <td> {{ .Status.String }} </td> | |
| 143 {{ end }} | |
| 144 <td>{{ .Link | linkify }}</td> | |
| 145 <td> | |
| 146 {{ $nb := len .Blame }} | |
| 147 {{ if lt $nb 4 }} | |
| 148 {{ range $i, $c := .Blame }} | |
| 149 {{ if gt $i 0 }},{{ end }} | |
| 150 {{ if .Changelist }} | |
| 151 {{ .Changelist | linkify }} | |
| 152 {{ if .AuthorEmail }} | |
| 153 by {{ .AuthorEmail }} | |
| 154 {{ end }} | |
| 155 {{ else }} | |
| 156 (<a href="{{ .CommitURL }}">{{ .AuthorEmail }}</a>) | |
| 157 {{ end }} | |
| 158 {{ end }} | |
| 159 {{ else }} | |
| 160 ({{ $nb }} changes) | |
| 161 {{ 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.
| |
| 162 </td> | |
| 163 <td class="left"> | |
| 164 {{ range $i, $value := .Text }} | |
| 165 {{ if gt $i 0 }}<br>{{ end }} | |
| 166 {{ . }} | |
| 167 {{ end }} | |
| 168 </td> | |
| 169 </tr> | |
| 52 {{ end }} | 170 {{ end }} |
| 53 {{ else }} | 171 </table> |
| 54 ({{ $nb }} changes) | 172 {{ else }} |
| 55 {{ end }} | 173 <h2>No Recent Builds</h2> |
| 174 {{ end }} | |
| 175 </div> | |
| 56 | 176 |
| 57 </li> | 177 <div class="epiloge"> |
| 178 {{ if .Builder.PrevCursor }}<a href="{{ pagedURL .Request 0 .Builder.PrevCurso r }}">Prev</a>{{ end }} | |
| 179 (Show: | |
| 180 <a href="{{ pagedURL .Request -1 "" }}">default</a> | |
| 181 <a href="{{ pagedURL .Request 25 "" }}">25</a> | |
| 182 <a href="{{ pagedURL .Request 50 "" }}">50</a> | |
| 183 <a href="{{ pagedURL .Request 100 "" }}">100</a> | |
| 184 <a href="{{ pagedURL .Request 200 "" }}">200</a> | |
| 185 ) | |
| 186 {{ if .Builder.NextCursor }} | |
| 187 <a href="{{ pagedURL .Request 0 .Builder.NextCursor}}">Next</a> | |
| 58 {{ end }} | 188 {{ end }} |
| 59 </ul> | 189 </div> |
| 60 {{ else }} | |
| 61 <h2>No Pending Build Requests</h2> | |
| 62 {{ end }} | |
| 63 | |
| 64 {{ if .Builder.FinishedBuilds }} | |
| 65 <h2>Recent Builds:</h2> | |
| 66 | |
| 67 <table class="info"> | |
| 68 <tr> | |
| 69 <th>Time</th> | |
| 70 <th>Revision</th> | |
| 71 <th>Result</th> | |
| 72 <th>Build #</th> | |
| 73 <th>Changes</th> | |
| 74 <th>Info</th> | |
| 75 </tr> | |
| 76 | |
| 77 {{ range .Builder.FinishedBuilds }} | |
| 78 <tr> | |
| 79 <td>{{ .ExecutionTime.Finished | localTime "" }}</td> | |
| 80 <td class="revision">{{ .Revision }}</td> | |
| 81 {{ if eq .Status.String "Success" }} | |
| 82 <td class="status-Success">Success</td> | |
| 83 {{ else if eq .Status.String "Failure" }} | |
| 84 <td class="status-Failure">Failed</td> | |
| 85 {{ else if eq .Status.String "InfraFailure" }} | |
| 86 <td class="status-Exception">Infra Failure</td> | |
| 87 {{ else if eq .Status.String "Exception" }} | |
| 88 <td class="status-Exception">Exception</td> | |
| 89 {{ else }} | |
| 90 <td> {{ .Status.String }} </td> | |
| 91 {{ end }} | |
| 92 <td>{{ .Link | linkify }}</td> | |
| 93 <td> | |
| 94 {{ $nb := len .Blame }} | |
| 95 {{ if lt $nb 4 }} | |
| 96 {{ range $i, $c := .Blame }} | |
| 97 {{ if gt $i 0 }},{{ end }} | |
| 98 {{ if .Changelist }} | |
| 99 {{ .Changelist | linkify }} | |
| 100 {{ if .AuthorEmail }} | |
| 101 by {{ .AuthorEmail }} | |
| 102 {{ end }} | |
| 103 {{ else }} | |
| 104 (<a href="{{ .CommitURL }}">{{ .AuthorEmail }}</a>) | |
| 105 {{ end }} | |
| 106 {{ end }} | |
| 107 {{ else }} | |
| 108 ({{ $nb }} changes) | |
| 109 {{ end }} | |
| 110 </td> | |
| 111 <td class="left"> | |
| 112 {{ range $i, $value := .Text }} | |
| 113 {{ if gt $i 0 }}<br>{{ end }} | |
| 114 {{ . }} | |
| 115 {{ end }} | |
| 116 </td> | |
| 117 </tr> | |
| 118 {{ end }} | |
| 119 </table> | |
| 120 {{ else }} | |
| 121 <h2>No Recent Builds</h2> | |
| 122 {{ end }} | |
| 123 | |
| 124 {{ if .Builder.PrevCursor }}<a href="{{ pagedURL .Request 0 .Builder.PrevCursor }}">Prev</a>{{ end }} | |
| 125 (Show: | |
| 126 <a href="{{ pagedURL .Request -1 "" }}">default</a> | |
| 127 <a href="{{ pagedURL .Request 25 "" }}">25</a> | |
| 128 <a href="{{ pagedURL .Request 50 "" }}">50</a> | |
| 129 <a href="{{ pagedURL .Request 100 "" }}">100</a> | |
| 130 <a href="{{ pagedURL .Request 200 "" }}">200</a> | |
| 131 ) | |
| 132 {{ if .Builder.NextCursor }}<a href="{{ pagedURL .Request 0 .Builder.NextCursor} }">Next</a>{{ end }} | |
| 133 | 190 |
| 134 {{end}} | 191 {{end}} |
| OLD | NEW |