| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 }, | 106 }, |
| 107 _list: { | 107 _list: { |
| 108 type: Object, | 108 type: Object, |
| 109 }, | 109 }, |
| 110 _tags: { | 110 _tags: { |
| 111 type: Object, | 111 type: Object, |
| 112 }, | 112 }, |
| 113 }, | 113 }, |
| 114 | 114 |
| 115 signIn: function(){ | 115 signIn: function(){ |
| 116 this._getJsonAsync("_tags", "/_ah/api/swarming/v1/tasks/tags", | 116 this._getJsonAsync("_tags", "/api/swarming/v1/tasks/tags", |
| 117 "_busy2", this.auth_headers); | 117 "_busy2", this.auth_headers); |
| 118 this._getJsonAsync("_dimensions","/_ah/api/swarming/v1/bots/dimensions", | 118 this._getJsonAsync("_dimensions","/api/swarming/v1/bots/dimensions", |
| 119 "_busy3", this.auth_headers); | 119 "_busy3", this.auth_headers); |
| 120 | 120 |
| 121 this._request(); | 121 this._request(); |
| 122 }, | 122 }, |
| 123 | 123 |
| 124 _primaryArr: function(map) { | 124 _primaryArr: function(map) { |
| 125 var arr = Object.keys(map); | 125 var arr = Object.keys(map); |
| 126 arr.sort(); | 126 arr.sort(); |
| 127 return arr; | 127 return arr; |
| 128 }, | 128 }, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) { |
| 214 return; | 214 return; |
| 215 } | 215 } |
| 216 this._getJsonAsync("_list", "/_ah/api/swarming/v1/tasks/list", | 216 this._getJsonAsync("_list", "/api/swarming/v1/tasks/list", |
| 217 "_busy1", this.auth_headers, this.query_params); | 217 "_busy1", this.auth_headers, this.query_params); |
| 218 }, | 218 }, |
| 219 | 219 |
| 220 _tasks: function() { | 220 _tasks: function() { |
| 221 if (!this._list || !this._list.items) { | 221 if (!this._list || !this._list.items) { |
| 222 return []; | 222 return []; |
| 223 } | 223 } |
| 224 var now = new Date(); | 224 var now = new Date(); |
| 225 | 225 |
| 226 // Do any preprocessing here | 226 // Do any preprocessing here |
| (...skipping 22 matching lines...) Expand all 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 |