Chromium Code Reviews| Index: appengine/swarming/elements/res/imp/botlist/bot-list.html |
| diff --git a/appengine/swarming/elements/res/imp/botlist/bot-list.html b/appengine/swarming/elements/res/imp/botlist/bot-list.html |
| index 14ae82a352c9366aa465d674c8ab5272fbcc2a88..75b73afa302ded5d361b49fd42eedd382349cd15 100644 |
| --- a/appengine/swarming/elements/res/imp/botlist/bot-list.html |
| +++ b/appengine/swarming/elements/res/imp/botlist/bot-list.html |
| @@ -234,23 +234,6 @@ |
| }; |
| var columnMap = { |
| - android_devices: function(bot) { |
| - var devs = this._attribute(bot, "android_devices", "0"); |
| - if (this._verbose) { |
| - return devs.join(" | ") + " devices available"; |
| - } |
| - // max() works on strings as long as they can be coerced to Number. |
| - return Math.max(...devs) + " devices available"; |
| - }, |
| - device_type: function(bot) { |
| - var dt = this._attribute(bot, "device_type", "none"); |
| - dt = dt[0]; |
| - var alias = this._androidAlias(dt); |
| - if (alias === "unknown") { |
| - return dt; |
| - } |
| - return this._applyAlias(dt, alias); |
| - }, |
| disk_space: function(bot) { |
| var aliased = []; |
| bot.disks.forEach(function(disk){ |
| @@ -262,38 +245,9 @@ |
| } |
| return aliased[0]; |
| }, |
| - gpu: function(bot){ |
| - var gpus = this._attribute(bot, "gpu", "none") |
| - var verbose = [] |
| - var named = []; |
| - // non-verbose mode has only the top level GPU info "e.g. NVidia" |
| - // which is found by looking for gpu ids w/o a colon. |
| - gpus.forEach(function(g){ |
| - var alias = this._gpuAlias(g); |
| - if (alias === "unknown") { |
| - verbose.push(g); |
| - if (g.indexOf(":") === -1) { |
| - named.push(g); |
| - } |
| - return; |
| - } |
| - verbose.push(this._applyAlias(g, alias)); |
| - if (g.indexOf(":") === -1) { |
| - named.push(this._applyAlias(g, alias)); |
| - } |
| - }.bind(this)) |
| - if (this._verbose) { |
| - return verbose.join(" | "); |
| - } |
| - return named.join(" | "); |
| - }, |
| id: function(bot) { |
| return bot.bot_id; |
| }, |
| - pool: function(bot) { |
| - var pool = this._attribute(bot, "pool"); |
| - return pool.join(" | "); |
| - }, |
| status: function(bot) { |
| // If a bot is both dead and quarantined, show the deadness over the |
| // quarentinedness. |
| @@ -302,7 +256,13 @@ |
| " ago"; |
| } |
| if (bot.quarantined) { |
| - return "Quarantined: " + this._attribute(bot, "quarantined"); |
| + var msg = this._state(bot, "quarantined")[0]; |
| + // Sometimes, the quarantined message is actually in "error". This |
| + // happens when the bot code has thrown an exception. |
| + if (msg === "unknown" || msg === "true" || msg === true) { |
| + msg = this._attribute(bot, "error"); |
| + } |
| + return "Quarantined: " + msg; |
| } |
| return "Alive"; |
| }, |
| @@ -352,8 +312,13 @@ |
| Polymer({ |
| is: 'bot-list', |
| - behaviors: [SwarmingBehaviors.BotListBehavior, |
| - SwarmingBehaviors.DynamicTableBehavior], |
| + |
| + // The order behaviors are applied in matters - later ones overwrite |
| + // attributes of earlier ones |
| + behaviors: [ |
| + SwarmingBehaviors.BotListBehavior, |
| + SwarmingBehaviors.DynamicTableBehavior, |
|
jcgregorio
2016/08/23 13:07:44
So we have SwarmingBehaviors.BotListBehavior which
kjlubick
2016/08/23 17:43:19
Done.
|
| + ], |
| properties: { |
| client_id: { |
| @@ -363,7 +328,13 @@ |
| // For dynamic table. |
| _columnMap: { |
| type: Object, |
| - value: columnMap, |
| + value: function() { |
| + var base = this._commonColumns(); |
| + for (var attr in columnMap) { |
| + base[attr] = columnMap[attr]; |
| + } |
| + return base; |
| + }, |
| }, |
| _headerMap: { |
| type: Object, |