| 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 --> | 6 --> |
| 7 <!DOCTYPE html> | 7 <!DOCTYPE html> |
| 8 <html> | 8 <html> |
| 9 <head> | 9 <head> |
| 10 <title>bot-list Demo</title> | 10 <title>bot-list Demo</title> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 sinon.log("You must be logged in (check your Oauth?)"); | 28 sinon.log("You must be logged in (check your Oauth?)"); |
| 29 request.respond(403, {}, "You must be logged in (check your Oauth?)"); | 29 request.respond(403, {}, "You must be logged in (check your Oauth?)"); |
| 30 return; | 30 return; |
| 31 } | 31 } |
| 32 sinon.log("User authenticated :) "+ request.requestHeaders.authorization); | 32 sinon.log("User authenticated :) "+ request.requestHeaders.authorization); |
| 33 request.respond(200, {"Content-Type":"application/json"}, JSON.stringify(d
ata)); | 33 request.respond(200, {"Content-Type":"application/json"}, JSON.stringify(d
ata)); |
| 34 } | 34 } |
| 35 | 35 |
| 36 server.respondWith("GET", "/_ah/api/swarming/v1/bots/list", respond); | 36 server.respondWith("GET", "/_ah/api/swarming/v1/bots/list", respond); |
| 37 server.respondWith("GET", "/api/swarming/v1/bots/list", respond); | 37 server.respondWith("GET", "/api/swarming/v1/bots/list", respond); |
| 38 |
| 39 var mockFleetSummary = { |
| 40 "count": "2625", |
| 41 "busy": "531", |
| 42 "now": "2016-08-01T17:21:07.239940", |
| 43 "dead": "22", |
| 44 "quarantined": "15", |
| 45 "kind": "swarming#botsItem", |
| 46 "etag": "\"nhThK35uIVdvx1_Mr5DChu_DyBs/aO8fy5IdESDx-fy3If19oDKu0f0\"" |
| 47 }; |
| 48 |
| 49 server.respondWith("GET", "/_ah/api/swarming/v1/bots/count", JSON.stringify(
mockFleetSummary)); |
| 50 server.respondWith("GET", "/api/swarming/v1/bots/count", JSON.stringify(mock
FleetSummary)); |
| 38 </script> | 51 </script> |
| 39 | 52 |
| 40 <link rel="import" href="bot-list.html"> | 53 <link rel="import" href="bot-list.html"> |
| 41 </head> | 54 </head> |
| 42 <body> | 55 <body> |
| 43 | 56 |
| 44 <bot-list></bot-list> | 57 <bot-list></bot-list> |
| 45 | 58 |
| 46 </body> | 59 </body> |
| 47 </html> | 60 </html> |
| OLD | NEW |