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

Side by Side Diff: appengine/swarming/ui/res/imp/botpage/bot-page.html

Issue 2553563003: Link Swarming Tasklist and Botlist together (Closed)
Patch Set: rebase Created 4 years 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 unified diff | Download patch
OLDNEW
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
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>
jcgregorio 2016/12/06 18:51:54 nit. Complete sentences. ... (except id)."
kjlubick 2016/12/06 20:05:27 Done.
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
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){
jcgregorio 2016/12/06 18:51:55 Could drop this if the forEach below was:
kjlubick 2016/12/06 20:05:27 I also need to remove the dimension where key == "
603 return f.key !== "id";
604 });
605
606 console.log(dimensions);
jcgregorio 2016/12/06 18:51:54 stray log
kjlubick 2016/12/06 20:05:27 Removed.
607 dimensions.forEach(function(f) {
608 if (cols.indexOf(f.key) === -1) {
609 cols.push(f.key);
610 }
611 }.bind(this));
612
613 return this._botListLink(dimensions, cols);
614 },
615
594 _task: function(bot) { 616 _task: function(bot) {
595 return (bot && bot.task_id) || "idle"; 617 return (bot && bot.task_id) || "idle";
596 }, 618 },
597 619
598 _taskClass: function(task) { 620 _taskClass: function(task) {
599 if (task && task.internal_failure) { 621 if (task && task.internal_failure) {
600 return "bot_died"; 622 return "bot_died";
601 } 623 }
602 if (task && task.failure) { 624 if (task && task.failure) {
603 return "failed_task"; 625 return "failed_task";
604 } 626 }
605 return ""; 627 return "";
606 }, 628 },
607 629
608 _toggleState: function() { 630 _toggleState: function() {
609 this.set("_show_state", !this._show_state); 631 this.set("_show_state", !this._show_state);
610 } 632 }
611 633
612 }); 634 });
613 })(); 635 })();
614 </script> 636 </script>
615 </dom-module> 637 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698