| OLD | NEW |
| (Empty) | |
| 1 {% extends "swarming/base.html" %} |
| 2 |
| 3 |
| 4 {% block headers %} |
| 5 <style> |
| 6 h1 { |
| 7 margin-top: 10px; |
| 8 margin-bottom: 10px; |
| 9 } |
| 10 |
| 11 table.layout_table { |
| 12 border-spacing: 0; |
| 13 font-family: monospace; |
| 14 } |
| 15 |
| 16 table.layout_table thead { |
| 17 background-color: #C0C0C0; |
| 18 font-weight:bold; |
| 19 } |
| 20 |
| 21 table.layout_table tbody tr:nth-child(even) { |
| 22 background-color: #eeeeee; |
| 23 } |
| 24 |
| 25 table.layout_table td:first-child { |
| 26 border-color: black; |
| 27 border-right: thin solid; |
| 28 padding-right: 1em; |
| 29 } |
| 30 |
| 31 table.layout_table td:nth-child(2) { |
| 32 padding-left: 1em; |
| 33 } |
| 34 |
| 35 table.layout_table td:nth-child(4) { |
| 36 border-color: black; |
| 37 border-right: thin solid; |
| 38 padding-right: 1em; |
| 39 } |
| 40 |
| 41 table.layout_table td:nth-child(5) { |
| 42 border-color: black; |
| 43 border-right: thin solid; |
| 44 padding-left: 1em; |
| 45 padding-right: 1em; |
| 46 } |
| 47 |
| 48 table.layout_table td:nth-child(6) { |
| 49 padding-left: 1em; |
| 50 padding-right: 0.5em; |
| 51 } |
| 52 |
| 53 table.alterning_background td:nth-child(3) { |
| 54 text-align: center; |
| 55 white-space: nowrap; |
| 56 } |
| 57 |
| 58 table.alterning_background td:nth-child(4) { |
| 59 text-align: right; |
| 60 white-space: nowrap; |
| 61 } |
| 62 |
| 63 table.alterning_background td:nth-child(5) { |
| 64 text-align: right; |
| 65 white-space: nowrap; |
| 66 } |
| 67 |
| 68 table.alterning_background td:nth-child(6) { |
| 69 white-space: nowrap; |
| 70 } |
| 71 |
| 72 table.alterning_background td:nth-child(7) { |
| 73 text-align: right; |
| 74 white-space: nowrap; |
| 75 } |
| 76 |
| 77 #limitRange { |
| 78 width: inherit; |
| 79 } |
| 80 </style> |
| 81 <script> |
| 82 function radio_value(field) { |
| 83 var radios = document.getElementsByName(field); |
| 84 for (var i = 0, length = radios.length; i < length; i++) { |
| 85 if (radios[i].checked) { |
| 86 return radios[i].value; |
| 87 } |
| 88 } |
| 89 } |
| 90 |
| 91 function get_limit() { |
| 92 return document.getElementById('limitText').value; |
| 93 } |
| 94 |
| 95 function update_limit_text(val) { |
| 96 document.getElementById('limitText').value = val; |
| 97 } |
| 98 |
| 99 function update_limit_range(val) { |
| 100 document.getElementById('limitRange').value = val; |
| 101 } |
| 102 |
| 103 function update_sort() { |
| 104 // This resets the cursor and filters. |
| 105 var sort = radio_value("sort"); |
| 106 var url = '/user/tasks?sort=' + sort + '&limit=' + get_limit(); |
| 107 document.location.href = url; |
| 108 } |
| 109 |
| 110 function update_filter() { |
| 111 // This resets the cursor, sort and task name. |
| 112 var task_tag = document.getElementById("task_tag").value; |
| 113 var url = '/user/tasks?state=' + encodeURIComponent(radio_value("state")) + |
| 114 '&limit=' + encodeURIComponent(get_limit()) + |
| 115 '&task_tag=' + encodeURIComponent(task_tag); |
| 116 document.location.href = url; |
| 117 } |
| 118 </script> |
| 119 {% endblock %} |
| 120 |
| 121 |
| 122 {% block body %} |
| 123 {% import 'swarming/bot_view.html' as bot_view %} |
| 124 |
| 125 <h1>Tasks</h1> |
| 126 <a href="/">Back to root</a> |
| 127 <br/> |
| 128 <h1>THIS UI WILL GO AWAY ON JAN 1, 2017. If it has something you need and the ne
w UI doesn't have it, file a bug ASAP. </h1> |
| 129 <a href="{{try_link}}">Try out the new task list UI</a> |
| 130 <p> |
| 131 <form id="filter" name="filter" method="GET"> |
| 132 <input type="range" id="limitRange" name="limit" value="{{limit}}" min=10 |
| 133 max=500 step=5 onchange="update_limit_text(this.value);" |
| 134 onmousemove="update_limit_text(this.value);" > |
| 135 <input type="text" id="limitText" value="{{limit}}" maxlength="3" |
| 136 onchange="update_limit_range(this.value);"> |
| 137 <input type="submit" value="Set limit"> |
| 138 <p> |
| 139 <table class=layout_table title="Select order and filter"> |
| 140 <thead> |
| 141 <tr> |
| 142 <td align=center>Sort</td> |
| 143 <td></td> |
| 144 <td>State (total last 24h)</td> |
| 145 <td></td> |
| 146 <td>Search by tag</td> |
| 147 </tr> |
| 148 </thead> |
| 149 <tbody> |
| 150 <tr> |
| 151 <td> |
| 152 {% for key, name, item_title in sort_choices %} |
| 153 <label title="{{item_title}}"> |
| 154 <input type="radio" name="sort" value="{{key}}" |
| 155 onchange="update_sort()" |
| 156 {% if sort == key %}checked{%endif%}> |
| 157 {{name}} |
| 158 </input> |
| 159 </label> |
| 160 <br> |
| 161 {% endfor %} |
| 162 </td> |
| 163 {% for state_column in state_choices %} |
| 164 <td> |
| 165 {% for key, name, item_title in state_column %} |
| 166 <label title="{{item_title}}"> |
| 167 <input type="radio" name="state" value="{{key}}" |
| 168 onchange="update_filter()" |
| 169 {% if state == key %}checked{%endif%}> |
| 170 {{name}} |
| 171 </input> |
| 172 </label> |
| 173 <br> |
| 174 {% endfor %} |
| 175 </td> |
| 176 {% endfor %} |
| 177 <td> |
| 178 <div title="Task tags uses whole tag search ONLY. Using it resets sort t
o 'Created' and the task state filter to 'All'."> |
| 179 Task tags<br> |
| 180 (whole tag only, 1 per line) |
| 181 <br> |
| 182 <textarea id="task_tag" name="task_tag" rows="3" cols="30">{{task_tag}
}</textarea> |
| 183 <br> |
| 184 <input type="submit" value="Search"> |
| 185 </div> |
| 186 </td> |
| 187 </tr> |
| 188 <tbody> |
| 189 </table> |
| 190 </form> |
| 191 <br> |
| 192 |
| 193 |
| 194 {% macro total_pending_star() %} |
| 195 {% if has_pending %}*{% endif %} |
| 196 {% endmacro %} |
| 197 |
| 198 |
| 199 {% macro total_running_star() %} |
| 200 {% if has_running %}*{% endif %} |
| 201 {% endmacro %} |
| 202 |
| 203 |
| 204 {% macro next_page_link() %} |
| 205 {% if cursor %} |
| 206 <p> |
| 207 {% if task_tag %} |
| 208 <a href="/oldui/user/tasks?limit={{limit}}&state={{state}}&task_tag={{task_tag
|urlencode}}&cursor={{cursor|urlencode}}">Next page</a> |
| 209 {% else %} |
| 210 <a href="/oldui/user/tasks?limit={{limit}}&state={{state}}&sort={{sort}}&curso
r={{cursor|urlencode}}">Next page</a> |
| 211 {% endif %} |
| 212 {% endif %} |
| 213 {% endmacro %} |
| 214 |
| 215 |
| 216 {% if tasks %} |
| 217 <table id="request-table" class="alterning_background" |
| 218 summary="This table lists all test requests"> |
| 219 <thead> |
| 220 <th>Name</th> |
| 221 <th>Status</th> |
| 222 <th>Requested</th> |
| 223 <th>Pending</th> |
| 224 <th>Duration</th> |
| 225 <th>$USD</th> |
| 226 <th>User</th> |
| 227 <th>Bot</th> |
| 228 <th>Priority</th> |
| 229 </thead> |
| 230 <tbody> |
| 231 {% for task in tasks %} |
| 232 <tr class="request {% if task.failure or task.internal_failure or task.i
s_exceptional %}failed_test{% endif%}"> |
| 233 <td> |
| 234 <a href="/oldui/user/task/{{task.task_id}}">{{task.name}}</a> |
| 235 </td> |
| 236 <td> |
| 237 {{task.to_string()|safe}} |
| 238 {% if task.request.has_access and task.can_be_canceled %} |
| 239 <form id="cancel_{{task.task_id}}" method="POST" |
| 240 action="/oldui/user/task/{{task.task_id}}/cancel" |
| 241 style="display:inline"> |
| 242 <input type="hidden" name="redirect_to" value="listing" /> |
| 243 <input type="hidden" name="xsrf_token" value="{{xsrf_token}}" /> |
| 244 <input type="submit" value="Cancel" style="display:inline"></inp
ut> |
| 245 </form> |
| 246 {% endif %} |
| 247 </td> |
| 248 <td>{{task.created_ts|succinctdatetimeformat}}</td> |
| 249 <td> |
| 250 {{bot_view.pending_star(task)}}{{task.pending_now(now)|timedeltaform
at}} |
| 251 </td> |
| 252 <td> |
| 253 {{bot_view.running_star(task)}} |
| 254 {% if task.deduped_from %} |
| 255 <span title="Duration of the original task. This task wasn't actua
lly run as it was deduped." |
| 256 style="color:green"> |
| 257 {{task.duration_now(now)|timedeltaformat}} |
| 258 </span> |
| 259 {% else %} |
| 260 {{task.duration_now(now)|timedeltaformat}} |
| 261 {% endif %} |
| 262 </td> |
| 263 <td> |
| 264 {% if task.cost_usd %} |
| 265 {{task.cost_usd|round(4) }} $ |
| 266 {% elif task.cost_saved_usd %} |
| 267 <span style="color:green">-{{task.cost_saved_usd|round(4) }} $</sp
an> |
| 268 {% else %} |
| 269 ‑‑ |
| 270 {% endif %} |
| 271 </td> |
| 272 <td> |
| 273 {% if task.user %} |
| 274 <a href="/oldui/user/tasks?task_tag=user:{{task.user}}&limit={{lim
it}}">{{task.user}}</a> |
| 275 {% else %} |
| 276 ‑‑ |
| 277 {% endif %} |
| 278 </td> |
| 279 <td>{{bot_view.bot_link(task.bot_id, is_privileged_user)}}</td> |
| 280 <td>{{task.request.priority}}</td> |
| 281 </tr> |
| 282 {% endfor %} |
| 283 {% if show_footer %} |
| 284 <tr> |
| 285 <td> </td> |
| 286 <td></td> |
| 287 <td></td> |
| 288 <td></td> |
| 289 <td></td> |
| 290 <td></td> |
| 291 <td></td> |
| 292 <td></td> |
| 293 </tr> |
| 294 {% endif %} |
| 295 </tbody> |
| 296 {% if show_footer %} |
| 297 <tfoot> |
| 298 <tr> |
| 299 <td>{{ next_page_link() }}</td> |
| 300 <td></td> |
| 301 <td><strong>Median</strong></td> |
| 302 <td> |
| 303 {{total_pending_star()}}{{pending_median|timedeltaformat}} |
| 304 </td> |
| 305 <td> |
| 306 {{total_running_star()}}{{duration_median|timedeltaformat}} |
| 307 </td> |
| 308 <td></td> |
| 309 <td></td> |
| 310 </tr> |
| 311 <tr> |
| 312 <td></td> |
| 313 <td><strong>Total: </strong>{{tasks|length}}</td> |
| 314 <td><strong>Average</strong></td> |
| 315 <td> |
| 316 {{total_pending_star()}}{{pending_average|timedeltaformat}} |
| 317 </td> |
| 318 <td> |
| 319 {{total_running_star()}}{{duration_average|timedeltaformat}} |
| 320 </td> |
| 321 <td></td> |
| 322 <td></td> |
| 323 <td></td> |
| 324 </tr> |
| 325 <tr> |
| 326 <td></td> |
| 327 <td></td> |
| 328 <td><strong>Sum</strong></td> |
| 329 <td> |
| 330 {{total_pending_star()}}{{pending_sum|timedeltaformat}} |
| 331 </td> |
| 332 <td> |
| 333 {{total_running_star()}}{{duration_sum|timedeltaformat}} |
| 334 </td> |
| 335 <td> |
| 336 {% if total_cost_usd %} |
| 337 {{total_cost_usd|round(4) }} $ |
| 338 {% else %} |
| 339 ‑‑ |
| 340 {% endif %} |
| 341 </td> |
| 342 <td></td> |
| 343 <td></td> |
| 344 </tr> |
| 345 <tr> |
| 346 <td></td> |
| 347 <td></td> |
| 348 <td><strong>Saved by deduping</strong></td> |
| 349 <td></td> |
| 350 <td> |
| 351 {{total_saved|timedeltaformat}} |
| 352 </td> |
| 353 <td> |
| 354 {% if total_cost_saved_usd %} |
| 355 <span style="color:green">{{total_cost_saved_usd|round(4) }} $</sp
an> |
| 356 {% else %} |
| 357 ‑‑ |
| 358 {% endif %} |
| 359 </td> |
| 360 <td> |
| 361 ({{'%1.1f' % total_saved_percent}}%) |
| 362 </td> |
| 363 <td></td> |
| 364 <td></td> |
| 365 </tr> |
| 366 </tfoot> |
| 367 {% else %} |
| 368 {{ next_page_link() }} |
| 369 {% endif %} |
| 370 </table> |
| 371 {% else %} |
| 372 No data to show for this selection. |
| 373 {% endif %} |
| 374 |
| 375 {% endblock %} |
| OLD | NEW |