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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: appengine/swarming/ui/res/imp/botpage/bot-page.html
diff --git a/appengine/swarming/ui/res/imp/botpage/bot-page.html b/appengine/swarming/ui/res/imp/botpage/bot-page.html
index 1017860ac01ffb3528a2e0a73f718fd6895f7f55..d3fbef7334927c4c899854ef721a8df1f9be8ad6 100644
--- a/appengine/swarming/ui/res/imp/botpage/bot-page.html
+++ b/appengine/swarming/ui/res/imp/botpage/bot-page.html
@@ -195,7 +195,9 @@
</td>
</tr>
<tr>
- <td rowspan$="[[_numRows(_bot.dimensions)]]">Dimensions</td>
+ <td rowspan$="[[_numRows(_bot.dimensions)]]">
+ <a href$="[[_siblingBotsLink(_bot.dimensions)]]" title="The list 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.
+ </td>
</tr>
<template
is="dom-repeat"
@@ -591,6 +593,26 @@
"Shutting down "+this.bot_id, this._auth_headers);
},
+ _siblingBotsLink(dimensions) {
+ var cols = ["id", "os", "task", "status"];
+ if (!dimensions) {
+ return this._botListLink([], cols);
+ }
+
+ 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 == "
+ return f.key !== "id";
+ });
+
+ console.log(dimensions);
jcgregorio 2016/12/06 18:51:54 stray log
kjlubick 2016/12/06 20:05:27 Removed.
+ dimensions.forEach(function(f) {
+ if (cols.indexOf(f.key) === -1) {
+ cols.push(f.key);
+ }
+ }.bind(this));
+
+ return this._botListLink(dimensions, cols);
+ },
+
_task: function(bot) {
return (bot && bot.task_id) || "idle";
},

Powered by Google App Engine
This is Rietveld 408576698