| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2016 The LUCI Authors. All rights reserved. | 2 Copyright 2016 The LUCI Authors. All rights reserved. |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
| 4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
| 5 | 5 |
| 6 This in an HTML Import-able file that contains the definition | 6 This in an HTML Import-able file that contains the definition |
| 7 of the following elements: | 7 of the following elements: |
| 8 | 8 |
| 9 <bot-page> | 9 <bot-page> |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 href$="[[_taskLink(_bot.task_id)]]"> | 188 href$="[[_taskLink(_bot.task_id)]]"> |
| 189 [[_task(_bot)]] | 189 [[_task(_bot)]] |
| 190 </a> | 190 </a> |
| 191 </td> | 191 </td> |
| 192 <td> | 192 <td> |
| 193 <!-- TODO(kjlubick) add the cancel button when swarming can | 193 <!-- TODO(kjlubick) add the cancel button when swarming can |
| 194 cancel running tasks --> | 194 cancel running tasks --> |
| 195 </td> | 195 </td> |
| 196 </tr> | 196 </tr> |
| 197 <tr> | 197 <tr> |
| 198 <td rowspan$="[[_numRows(_bot.dimensions)]]">Dimensions</td> | 198 <td rowspan$="[[_numRows(_bot.dimensions)]]"> |
| 199 <a href$="[[_siblingBotsLink(_bot.dimensions)]]" title="The li
st of bots that also matches these dimensions (except id)."> Dimensions</a> |
| 200 </td> |
| 199 </tr> | 201 </tr> |
| 200 <template | 202 <template |
| 201 is="dom-repeat" | 203 is="dom-repeat" |
| 202 items="[[_bot.dimensions]]" | 204 items="[[_bot.dimensions]]" |
| 203 as="dim"> | 205 as="dim"> |
| 204 <tr> | 206 <tr> |
| 205 <td>[[dim.key]]</td> | 207 <td>[[dim.key]]</td> |
| 206 <td>[[_concat(dim.value)]]</td> | 208 <td>[[_concat(dim.value)]]</td> |
| 207 </tr> | 209 </tr> |
| 208 </template> | 210 </template> |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 return ""; | 586 return ""; |
| 585 } | 587 } |
| 586 return str.substring(0, length); | 588 return str.substring(0, length); |
| 587 }, | 589 }, |
| 588 | 590 |
| 589 _shutdownBot: function() { | 591 _shutdownBot: function() { |
| 590 swarming.postWithToast("/api/swarming/v1/bot/"+this.bot_id+"/terminate", | 592 swarming.postWithToast("/api/swarming/v1/bot/"+this.bot_id+"/terminate", |
| 591 "Shutting down "+this.bot_id, this._auth_headers); | 593 "Shutting down "+this.bot_id, this._auth_headers); |
| 592 }, | 594 }, |
| 593 | 595 |
| 596 _siblingBotsLink(dimensions) { |
| 597 var cols = ["id", "os", "task", "status"]; |
| 598 if (!dimensions) { |
| 599 return this._botListLink([], cols); |
| 600 } |
| 601 |
| 602 dimensions = dimensions.filter(function(f){ |
| 603 return f.key !== "id"; |
| 604 }); |
| 605 |
| 606 dimensions.forEach(function(f) { |
| 607 if (cols.indexOf(f.key) === -1) { |
| 608 cols.push(f.key); |
| 609 } |
| 610 }.bind(this)); |
| 611 |
| 612 return this._botListLink(dimensions, cols); |
| 613 }, |
| 614 |
| 594 _task: function(bot) { | 615 _task: function(bot) { |
| 595 return (bot && bot.task_id) || "idle"; | 616 return (bot && bot.task_id) || "idle"; |
| 596 }, | 617 }, |
| 597 | 618 |
| 598 _taskClass: function(task) { | 619 _taskClass: function(task) { |
| 599 if (task && task.internal_failure) { | 620 if (task && task.internal_failure) { |
| 600 return "bot_died"; | 621 return "bot_died"; |
| 601 } | 622 } |
| 602 if (task && task.failure) { | 623 if (task && task.failure) { |
| 603 return "failed_task"; | 624 return "failed_task"; |
| 604 } | 625 } |
| 605 return ""; | 626 return ""; |
| 606 }, | 627 }, |
| 607 | 628 |
| 608 _toggleState: function() { | 629 _toggleState: function() { |
| 609 this.set("_show_state", !this._show_state); | 630 this.set("_show_state", !this._show_state); |
| 610 } | 631 } |
| 611 | 632 |
| 612 }); | 633 }); |
| 613 })(); | 634 })(); |
| 614 </script> | 635 </script> |
| 615 </dom-module> | 636 </dom-module> |
| OLD | NEW |