Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: appengine/swarming/elements/res/imp/tasklist/task-list-demo.html

Issue 2249143002: Make TaskList use Dynamic List (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: Address comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>task-list Demo</title>
11 <meta charset="utf-8"> 11 <meta charset="utf-8">
12 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 12 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
13 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial- scale=1, user-scalable=yes"> 13 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial- scale=1, user-scalable=yes">
14 <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></scri pt> 14 <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></scri pt>
15 <script src="../../../node_modules/skia-common-js/common.js"></script> 15 <script src="../../../node_modules/skia-common-js/common.js"></script>
16 <script src="/res/js/common.js"></script> 16 <script src="/res/js/common.js"></script>
17 <script src="../../../node_modules/sinon/pkg/sinon-1.17.5.js"></script> 17 <script src="../../../node_modules/sinon/pkg/sinon-1.17.5.js"></script>
18 <!-- Makes a var called data--> 18 <!-- Makes a var called list-->
19 <script type="text/javascript" src="bot-list-demo.json"></script> 19 <script type="text/javascript" src="task-list-demo.json"></script>
20 <!-- Makes a var called fleetData-->
21 <script type="text/javascript" src="bot-list-fleet-data-demo.json"></script>
22 20
23 <script type="text/javascript" charset="utf-8"> 21 <script type="text/javascript" charset="utf-8">
24 sinon.format = function(object) {return JSON.stringify(object);} 22 sinon.format = function(object) {return JSON.stringify(object);}
25 sinon.log = function(message) {console.log(message);}; 23 sinon.log = function(message) {console.log(message);};
26 var server = sinon.fakeServer.create(); 24 var server = sinon.fakeServer.create();
27 server.autoRespond = true; 25 server.autoRespond = true;
28 //server.autoRespondAfter = 2000; 26 //server.autoRespondAfter = 2000;
29 27
30 var respond = function(request){ 28 var respond = function(request){
31 if (!request.requestHeaders.authorization) { 29 if (!request.requestHeaders.authorization) {
32 sinon.log("You must be logged in (check your Oauth?)"); 30 sinon.log("You must be logged in (check your Oauth?)");
33 request.respond(403, {}, "You must be logged in (check your Oauth?)"); 31 request.respond(403, {}, "You must be logged in (check your Oauth?)");
34 return; 32 return;
35 } 33 }
36 sinon.log("User authenticated :) "+ request.requestHeaders.authorization); 34 sinon.log("User authenticated :) "+ request.requestHeaders.authorization);
37 sinon.log("List Request: "+sinon.format(request)); 35 sinon.log("List Request: "+sinon.format(request));
38 request.respond(200, {"Content-Type":"application/json"}, JSON.stringify(d ata)); 36 request.respond(200, {"Content-Type":"application/json"}, JSON.stringify(l ist));
39 } 37 }
40 38
41 server.respondWith("GET", /^\/api\/swarming\/v1\/bots\/list.*/, respond); 39 server.respondWith("GET", /^\/api\/swarming\/v1\/tasks\/list.*/, respond);
42 server.respondWith("GET", /^\/_ah\/api\/swarming\/v1\/bots\/list.*/, respond ); 40 server.respondWith("GET", /^\/_ah\/api\/swarming\/v1\/tasks\/list.*/, respon d);
43 41
44 var mockFleetSummary = {
45 "count": "2625",
46 "busy": "531",
47 "now": "2016-08-01T17:21:07.239940",
48 "dead": "22",
49 "quarantined": "15",
50 "kind": "swarming#botsItem",
51 "etag": "\"nhThK35uIVdvx1_Mr5DChu_DyBs/aO8fy5IdESDx-fy3If19oDKu0f0\""
52 };
53
54 server.respondWith("GET", /^\/_ah\/api\/swarming\/v1\/bots\/count/, JSON.str ingify(mockFleetSummary));
55 server.respondWith("GET", /^\/api\/swarming\/v1\/bots\/count/, JSON.stringif y(mockFleetSummary));
56
57 server.respondWith("GET", /^\/_ah\/api\/swarming\/v1\/bots\/dimensions/, JSO N.stringify(fleetData));
58 server.respondWith("GET", /^\/api\/swarming\/v1\/bots\/dimensions/, JSON.str ingify(fleetData));
59 </script> 42 </script>
60 43
61 <link rel="import" href="bot-list.html"> 44 <link rel="import" href="task-list.html">
62 </head> 45 </head>
63 <body> 46 <body>
64 47
65 <bot-list 48 <task-list
66 client_id="20770472288-t5smpbpjptka4nd888fv0ctd23ftba2o.apps.googleusercontent .com"> 49 client_id="20770472288-t5smpbpjptka4nd888fv0ctd23ftba2o.apps.googleusercontent .com">
67 </bot-list> 50 </task-list>
68 51
69 </body> 52 </body>
70 </html> 53 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698