| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 tasks.forEach(function(t) { | 160 tasks.forEach(function(t) { |
| 161 Object.keys(t.tagMap).forEach(function(k) { | 161 Object.keys(t.tagMap).forEach(function(k) { |
| 162 var v = t.tagMap[k]; | 162 var v = t.tagMap[k]; |
| 163 if (!map[k]) { | 163 if (!map[k]) { |
| 164 map[k] = {}; | 164 map[k] = {}; |
| 165 } | 165 } |
| 166 map[k][v] = true; | 166 map[k][v] = true; |
| 167 }); | 167 }); |
| 168 }); | 168 }); |
| 169 | 169 |
| 170 delete map["user"][""]; |
| 171 map["user"]["none"] = true; |
| 172 |
| 170 // Turn the Map<Object,Map<Boolean>> into a Map<Object,Array<String>> | 173 // Turn the Map<Object,Map<Boolean>> into a Map<Object,Array<String>> |
| 171 // with all of the aliases applied. | 174 // with all of the aliases applied. |
| 172 var pMap = {}; | 175 var pMap = {}; |
| 173 for (key in map) { | 176 for (key in map) { |
| 174 var values = Object.keys(map[key]); | 177 var values = Object.keys(map[key]); |
| 175 if (swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(key) === -1) { | 178 if (swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(key) === -1) { |
| 176 pMap[key] = values; | 179 pMap[key] = values; |
| 177 } else { | 180 } else { |
| 178 var aliased = []; | 181 var aliased = []; |
| 179 values.forEach(function(value){ | 182 values.forEach(function(value){ |
| 180 aliased.push(swarming.alias.apply(value, key)); | 183 aliased.push(swarming.alias.apply(value, key)); |
| 181 }); | 184 }); |
| 182 pMap[key] = aliased; | 185 pMap[key] = aliased; |
| 183 } | 186 } |
| 184 } | 187 } |
| 185 | 188 |
| 186 // Add some options that might not show up. | |
| 187 pMap["android_devices"].push("0"); | |
| 188 pMap["device_os"].push("none"); | |
| 189 pMap["device_type"].push("none"); | |
| 190 pMap["user"].push("none"); | |
| 191 | |
| 192 // Custom filter options | 189 // Custom filter options |
| 193 pMap["name"] = []; | 190 pMap["name"] = []; |
| 194 // Some of these are hard coded because the server expects something | 191 // Some of these are hard coded because the server expects something |
| 195 // like "DEDUPED" instead of the more human friendly | 192 // like "DEDUPED" instead of the more human friendly |
| 196 // "COMPLETED (DEDUPED)" | 193 // "COMPLETED (DEDUPED)" |
| 197 pMap["state"] = [this.PENDING, this.RUNNING, "PENDING_RUNNING", this.COM
PLETED, | 194 pMap["state"] = [this.PENDING, this.RUNNING, "PENDING_RUNNING", this.COM
PLETED, |
| 198 "COMPLETED_SUCCESS", "COMPLETED_FAILURE", this.EXPIRED, this.TIMED_O
UT, | 195 "COMPLETED_SUCCESS", "COMPLETED_FAILURE", this.EXPIRED, this.TIMED_O
UT, |
| 199 this.BOT_DIED, this.CANCELED, "DEDUPED", "ALL"]; | 196 this.BOT_DIED, this.CANCELED, "DEDUPED", "ALL"]; |
| 200 pMap["costs_usd"] = []; | 197 pMap["costs_usd"] = []; |
| 201 pMap["deduped_from"] = []; | 198 pMap["deduped_from"] = []; |
| 202 pMap["duration"] = []; | 199 pMap["duration"] = []; |
| 203 pMap["server_versions"] = []; | 200 pMap["server_versions"] = []; |
| 201 |
| 202 // TODO(kjlubick): Allow a person to sort on the task list by bot |
| 203 pMap["bot"] = []; |
| 204 TIMES.forEach(function(t) { | 204 TIMES.forEach(function(t) { |
| 205 pMap[t] = []; | 205 pMap[t] = []; |
| 206 }); | 206 }); |
| 207 | 207 |
| 208 return pMap; | 208 return pMap; |
| 209 }, | 209 }, |
| 210 | 210 |
| 211 _request: function() { | 211 _request: function() { |
| 212 // wait until the user has logged in and the filters have loaded before
requesting this to avoid double or even triple requests. | 212 // wait until the user has logged in and the filters have loaded before
requesting this to avoid double or even triple requests. |
| 213 if (!this.auth_headers || !this.query_params) { | 213 if (!this.auth_headers || !this.query_params) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 if (t.duration){ | 249 if (t.duration){ |
| 250 t.human_duration = this._humanDuration(t.duration); | 250 t.human_duration = this._humanDuration(t.duration); |
| 251 } | 251 } |
| 252 }.bind(this)); | 252 }.bind(this)); |
| 253 return this._list.items; | 253 return this._list.items; |
| 254 } | 254 } |
| 255 }); | 255 }); |
| 256 })(); | 256 })(); |
| 257 </script> | 257 </script> |
| 258 </dom-module> | 258 </dom-module> |
| OLD | NEW |