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

Unified Diff: appengine/swarming/ui/res/imp/botlist/bot-list.html

Issue 2511443002: Autodisplay android_devices when appropriate (Closed)
Patch Set: Created 4 years, 1 month 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/botlist/bot-list.html
diff --git a/appengine/swarming/ui/res/imp/botlist/bot-list.html b/appengine/swarming/ui/res/imp/botlist/bot-list.html
index 831aa52548ca7b893b5432ae058986982133af7a..b209062dc15915417e311a6553d036a81d9bde24 100644
--- a/appengine/swarming/ui/res/imp/botlist/bot-list.html
+++ b/appengine/swarming/ui/res/imp/botlist/bot-list.html
@@ -254,6 +254,8 @@
// columnMap, and specialSort
var specialColumns = ["id", "task", "cloud_console_link", "mp_lease_id"];
+ var deviceColumns = ["battery_health", "battery_level", "battery_status", "battery_temperature", "battery_voltage", "device_temperature"];
+
var headerMap = {
// "id" and "task" are special, so they don't go here. They have their
// headers hard-coded above.
@@ -316,6 +318,9 @@
device_temperature: function(){
return "";
},
+ device_os: function(bot) {
+ return this._attribute(bot, "device_os", "none").join(" | ");
+ },
disk_space: function(bot) {
var aliased = [];
bot.disks.forEach(function(disk){
@@ -588,7 +593,10 @@
},
},
- observers:["_reload(_query_params,_auth_headers)"],
+ observers:[
+ "_reload(_query_params,_auth_headers)",
+ "_checkDeviceColumns(_columns.*)"
+ ],
_androidAliasDevice: function(device) {
if (device.notReady) {
@@ -623,6 +631,23 @@
return "View Bot";
},
+ _checkDeviceColumns: function() {
+ var shouldAdd = false;
+ for (var i = 0; i< this._columns.length; i++) {
+ var col = this._columns[i];
+ if (col === "android_devices") {
+ return;
+ }
+ if (deviceColumns.indexOf(col) !== -1) {
+ shouldAdd = true;
+ }
+ }
+ if (shouldAdd) {
+ this.push("_columns", "android_devices");
+ sk.errorMessage("Some of the columns selected require 'android_devices' to be displayed. It has been automatically added.", 4000);
+ }
+ },
+
_deviceColumn: function(col, device) {
var f = deviceColumnMap[col];
if (!f || !device) {
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | appengine/swarming/ui/res/imp/common/query-column-filter-behavior.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698