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

Side by Side Diff: appengine/swarming/elements/res/imp/index/swarming-index-demo.html

Issue 2372553003: Show bootstrap and server bot_code version (Closed) Base URL: git@github.com:luci/luci-py@bootstrap
Patch Set: rebase Created 4 years, 2 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
« no previous file with comments | « appengine/swarming/elements/res/imp/index/swarming-index.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 by the Apache v2.0 license that can be 3 # Use of this source code is governed by the Apache v2.0 license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 --> 5 -->
6 <!DOCTYPE html> 6 <!DOCTYPE html>
7 <html> 7 <html>
8 <head> 8 <head>
9 <title>Swarming index Demo</title> 9 <title>Swarming index Demo</title>
10 <meta charset="utf-8"> 10 <meta charset="utf-8">
11 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 11 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
12 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial- scale=1, user-scalable=yes"> 12 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial- scale=1, user-scalable=yes">
13 <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></scri pt> 13 <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></scri pt>
14 <script src="../../../node_modules/skia-common-js/common.js"></script> 14 <script src="../../../node_modules/skia-common-js/common.js"></script>
15 <script src="/res/js/common.js"></script> 15 <script src="/res/js/common.js"></script>
16 <script src="/res/js/alias.js"></script> 16 <script src="/res/js/alias.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 18
19 <script type="text/javascript" charset="utf-8"> 19 <script type="text/javascript" charset="utf-8">
20 sinon.format = function(object) {return JSON.stringify(object);} 20 sinon.format = function(object) {return JSON.stringify(object);}
21 sinon.log = function(message) {console.log(message);}; 21 sinon.log = function(message) {console.log(message);};
22 var server = sinon.fakeServer.create(); 22 var server = sinon.fakeServer.create();
23 server.autoRespondAfter = 1200; 23 server.autoRespondAfter = 1200;
24 server.autoRespond = true; 24 server.autoRespond = true;
25 25
26 var details = { 26 var details = {
27 server_version: "1234-deadbeef", 27 server_version: "1234-deadbeef",
28 bot_version: "abcdoeraymeyouandme",
28 }; 29 };
29 30
30 var respond = function(request){ 31 var respond = function(request){
31 if (!request.requestHeaders.authorization) { 32 if (!request.requestHeaders.authorization) {
32 sinon.log("You must be logged in (check your Oauth?)"); 33 sinon.log("You must be logged in (check your Oauth?)");
33 request.respond(403, {}, "You must be logged in (check your Oauth?)"); 34 request.respond(403, {}, "You must be logged in (check your Oauth?)");
34 return; 35 return;
35 } 36 }
36 sinon.log("User authenticated :) "+ request.requestHeaders.authorization); 37 sinon.log("User authenticated :) "+ request.requestHeaders.authorization);
37 request.respond(200, {"Content-Type":"application/json"}, JSON.stringify(d etails)); 38 request.respond(200, {"Content-Type":"application/json"}, JSON.stringify(d etails));
38 } 39 }
39 40
40 server.respondWith("GET", /^\/_ah\/api\/swarming\/v1\/server\/details/, res pond); 41 server.respondWith("GET", /^\/_ah\/api\/swarming\/v1\/server\/details/, res pond);
41 server.respondWith("GET", /^\/api\/swarming\/v1\/server\/details/, respond); 42 server.respondWith("GET", /^\/api\/swarming\/v1\/server\/details/, respond);
42 43
43 var permissions = { 44 var permissions = {
44 get_bootstrap_token: true 45 get_bootstrap_token: true
45 }; 46 };
46 server.respondWith("GET", /^\/_ah\/api\/swarming\/v1\/server\/permissions/, JSON.stringify(permissions)); 47 server.respondWith("GET", /^\/_ah\/api\/swarming\/v1\/server\/permissions/, JSON.stringify(permissions));
47 server.respondWith("GET", /^\/api\/swarming\/v1\/server\/permissions/, JSON. stringify(permissions)); 48 server.respondWith("GET", /^\/api\/swarming\/v1\/server\/permissions/, JSON. stringify(permissions));
49
50 var token = {
51 bootstrap_token: "8675309JennyDontChangeYourNumber8675309"
52 };
53 server.respondWith("POST", /^\/_ah\/api\/swarming\/v1\/server\/token/, JSON .stringify(token));
54 server.respondWith("POST", /^\/api\/swarming\/v1\/server\/token/, JSON.strin gify(token));
48 </script> 55 </script>
49 56
50 <link rel="import" href="swarming-index.html"> 57 <link rel="import" href="swarming-index.html">
51 </head> 58 </head>
52 <body> 59 <body>
53 60
54 <swarming-index 61 <swarming-index
55 client_id="20770472288-t5smpbpjptka4nd888fv0ctd23ftba2o.apps.googleusercontent .com"> 62 client_id="20770472288-t5smpbpjptka4nd888fv0ctd23ftba2o.apps.googleusercontent .com">
56 </swarming-index> 63 </swarming-index>
57 64
58 </body> 65 </body>
59 </html> 66 </html>
OLDNEW
« no previous file with comments | « appengine/swarming/elements/res/imp/index/swarming-index.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698