| 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-data> | 9 <bot-list-data> |
| 10 | 10 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 // pMap will have a list of columns to available values (primary key | 219 // pMap will have a list of columns to available values (primary key |
| 220 // to secondary values). This includes bot dimensions, but also | 220 // to secondary values). This includes bot dimensions, but also |
| 221 // includes state like disk_space, quarantined, busy, etc. | 221 // includes state like disk_space, quarantined, busy, etc. |
| 222 dimensions = dimensions.bots_dimensions; | 222 dimensions = dimensions.bots_dimensions; |
| 223 | 223 |
| 224 var pMap = {}; | 224 var pMap = {}; |
| 225 dimensions.forEach(function(d){ | 225 dimensions.forEach(function(d){ |
| 226 if (swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(d.key) === -1) { | 226 if (swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(d.key) === -1) { |
| 227 // value is an array of all seen values for the dimension d.key | 227 // value is an array of all seen values for the dimension d.key |
| 228 pMap[d.key] = d.value; | 228 pMap[d.key] = d.value; |
| 229 } else if (d.key === "gpu") { | |
| 230 var gpus = []; | |
| 231 d.value.forEach(function(g){ | |
| 232 var alias = swarming.alias.gpu(g); | |
| 233 if (alias !== "unknown") { | |
| 234 gpus.push(swarming.alias.apply(g, alias)); | |
| 235 } else { | |
| 236 gpus.push(g); | |
| 237 } | |
| 238 }.bind(this)); | |
| 239 pMap["gpu"] = gpus; | |
| 240 } else if (d.key === "device_type") { | |
| 241 var devs = []; | |
| 242 d.value.forEach(function(dt){ | |
| 243 var alias = swarming.alias.android(dt); | |
| 244 if (alias !== "unknown") { | |
| 245 devs.push(swarming.alias.apply(dt, alias)); | |
| 246 } else { | |
| 247 devs.push(dt); | |
| 248 } | |
| 249 }.bind(this)); | |
| 250 pMap["device_type"] = devs; | |
| 251 } else { | 229 } else { |
| 252 console.log("Unknown alias type: ", d); | 230 var aliased = []; |
| 231 d.value.forEach(function(value){ |
| 232 aliased.push(swarming.alias.apply(value, d.key)); |
| 233 }); |
| 234 pMap[d.key] = aliased; |
| 253 } | 235 } |
| 254 }); | 236 }); |
| 255 | 237 |
| 256 // Add some options that might not show up. | 238 // Add some options that might not show up. |
| 257 pMap["android_devices"].push("0"); | 239 pMap["android_devices"].push("0"); |
| 258 pMap["device_os"].push("none"); | 240 pMap["device_os"].push("none"); |
| 259 pMap["device_type"].push("none"); | 241 pMap["device_type"].push("none"); |
| 260 | 242 |
| 261 pMap["id"] = []; | 243 pMap["id"] = []; |
| 262 | 244 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 276 return; | 258 return; |
| 277 } | 259 } |
| 278 this._getJsonAsync("_list", "/_ah/api/swarming/v1/bots/list", | 260 this._getJsonAsync("_list", "/_ah/api/swarming/v1/bots/list", |
| 279 "_busy1", this.auth_headers, this.query_params); | 261 "_busy1", this.auth_headers, this.query_params); |
| 280 }, | 262 }, |
| 281 | 263 |
| 282 }); | 264 }); |
| 283 })(); | 265 })(); |
| 284 </script> | 266 </script> |
| 285 </dom-module> | 267 </dom-module> |
| OLD | NEW |