| 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 It contains the definition of the following Behaviors: | 6 It contains the definition of the following Behaviors: |
| 7 | 7 |
| 8 SwarmingBehaviors.CommonBehavior | 8 SwarmingBehaviors.CommonBehavior |
| 9 | 9 |
| 10 To use it, include | 10 To use it, include |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // filters should be an array of {key:String, value:String} and | 33 // filters should be an array of {key:String, value:String} and |
| 34 // columns should be an array of Strings. | 34 // columns should be an array of Strings. |
| 35 _botListLink: function(filters, columns) { | 35 _botListLink: function(filters, columns) { |
| 36 filters = filters || []; | 36 filters = filters || []; |
| 37 columns = columns || []; | 37 columns = columns || []; |
| 38 var fArr = []; | 38 var fArr = []; |
| 39 filters.forEach(function(f){ | 39 filters.forEach(function(f){ |
| 40 fArr.push(f.key + ":" + f.value); | 40 fArr.push(f.key + ":" + f.value); |
| 41 }); | 41 }); |
| 42 var obj = { | 42 var obj = { |
| 43 filters: fArr, | 43 f: fArr, |
| 44 columns: columns, | 44 c: columns, |
| 45 } | 45 } |
| 46 return "/newui/botlist?" + sk.query.fromParamSet(obj); | 46 return "/newui/botlist?" + sk.query.fromParamSet(obj); |
| 47 }, | 47 }, |
| 48 | 48 |
| 49 // _getJsonAsync makes an XHR to a url, parses the response as JSON | 49 // _getJsonAsync makes an XHR to a url, parses the response as JSON |
| 50 // and sticks the resulting object into the property with the name given | 50 // and sticks the resulting object into the property with the name given |
| 51 // by "bindTo". If busy is defined, the property with that name will be | 51 // by "bindTo". If busy is defined, the property with that name will be |
| 52 // set to true while the request is in flight and false afterwards. | 52 // set to true while the request is in flight and false afterwards. |
| 53 // request headers (e.g. authentication) and query params will be used if | 53 // request headers (e.g. authentication) and query params will be used if |
| 54 // provided. Query params is an object like {String:Array<String>}. On | 54 // provided. Query params is an object like {String:Array<String>}. On |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 return "eons"; | 132 return "eons"; |
| 133 } | 133 } |
| 134 if (!second) { | 134 if (!second) { |
| 135 second = new Date(); | 135 second = new Date(); |
| 136 } | 136 } |
| 137 return this._humanDuration((second.getTime() - first.getTime())/1000); | 137 return this._humanDuration((second.getTime() - first.getTime())/1000); |
| 138 }, | 138 }, |
| 139 }; | 139 }; |
| 140 })(); | 140 })(); |
| 141 </script> | 141 </script> |
| OLD | NEW |