| 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 28 matching lines...) Expand all Loading... |
| 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 f: fArr, | 43 f: fArr, |
| 44 c: 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 // Create a link to a bot in Google Cloud Console. Cloud console will try |
| 50 // to find the bot in the last project the user was logged in as, which |
| 51 // is the best we can do atm. |
| 52 _cloudConsoleLink: function(zone, bot_id) { |
| 53 return `http://console.cloud.google.com/compute/instancesDetail/zones/${
zone}/instances/${bot_id}` |
| 54 }, |
| 55 |
| 49 // _getJsonAsync makes an XHR to a url, parses the response as JSON | 56 // _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 | 57 // 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 | 58 // 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. | 59 // 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 | 60 // request headers (e.g. authentication) and query params will be used if |
| 54 // provided. Query params is an object like {String:Array<String>}. On | 61 // provided. Query params is an object like {String:Array<String>}. On |
| 55 // error, bindTo will be set to false. It is not set to undefined | 62 // error, bindTo will be set to false. It is not set to undefined |
| 56 // because computed values in Polymer don't fire if a property is | 63 // because computed values in Polymer don't fire if a property is |
| 57 // undefined. Clients should check that bindTo is not falsey. | 64 // undefined. Clients should check that bindTo is not falsey. |
| 58 // To avoid multiple requests clobering one another, an object _jsonAsync | 65 // To avoid multiple requests clobering one another, an object _jsonAsync |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 151 } |
| 145 return this._humanDuration((second.getTime() - first.getTime())/1000); | 152 return this._humanDuration((second.getTime() - first.getTime())/1000); |
| 146 }, | 153 }, |
| 147 | 154 |
| 148 _truthy: function(a){ | 155 _truthy: function(a){ |
| 149 return !!a; | 156 return !!a; |
| 150 } | 157 } |
| 151 }; | 158 }; |
| 152 })(); | 159 })(); |
| 153 </script> | 160 </script> |
| OLD | NEW |