| 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-list> | 9 <bot-list> |
| 10 | 10 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 "device_type": "Device Type", | 227 "device_type": "Device Type", |
| 228 "disk_space": "Free Space (MB)", | 228 "disk_space": "Free Space (MB)", |
| 229 "gpu": "GPU", | 229 "gpu": "GPU", |
| 230 "os": "OS", | 230 "os": "OS", |
| 231 "pool": "Pool", | 231 "pool": "Pool", |
| 232 "status": "Status", | 232 "status": "Status", |
| 233 "xcode_version": "XCode Version", | 233 "xcode_version": "XCode Version", |
| 234 }; | 234 }; |
| 235 | 235 |
| 236 var columnMap = { | 236 var columnMap = { |
| 237 android_devices: function(bot) { |
| 238 var devs = this._attribute(bot, "android_devices", "0"); |
| 239 if (this._verbose) { |
| 240 return devs.join(" | ") + " devices available"; |
| 241 } |
| 242 // max() works on strings as long as they can be coerced to Number. |
| 243 return Math.max(...devs) + " devices available"; |
| 244 }, |
| 237 disk_space: function(bot) { | 245 disk_space: function(bot) { |
| 238 var aliased = []; | 246 var aliased = []; |
| 239 bot.disks.forEach(function(disk){ | 247 bot.disks.forEach(function(disk){ |
| 240 var alias = sk.human.bytes(disk.mb, swarming.MB); | 248 var alias = sk.human.bytes(disk.mb, swarming.MB); |
| 241 aliased.push(swarming.alias.apply(disk.mb, disk.id + " "+ alias)); | 249 aliased.push(swarming.alias.apply(disk.mb, disk.id + " "+ alias)); |
| 242 }.bind(this)); | 250 }.bind(this)); |
| 243 if (this._verbose) { | 251 if (this._verbose) { |
| 244 return aliased.join(" | "); | 252 return aliased.join(" | "); |
| 245 } | 253 } |
| 246 return aliased[0]; | 254 return aliased[0]; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 if (data && data.task_id) { | 401 if (data && data.task_id) { |
| 394 return "/user/task/" + data.task_id; | 402 return "/user/task/" + data.task_id; |
| 395 } | 403 } |
| 396 return undefined; | 404 return undefined; |
| 397 } | 405 } |
| 398 | 406 |
| 399 }); | 407 }); |
| 400 })(); | 408 })(); |
| 401 </script> | 409 </script> |
| 402 </dom-module> | 410 </dom-module> |
| OLD | NEW |