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

Side by Side Diff: appengine/swarming/elements/res/imp/botpage/bot-page-demo.html

Issue 2381853003: Add bot-page summary with utilization stats (Closed) Base URL: git@github.com:luci/luci-py@page-everywhere
Patch Set: address spaces 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
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-page Demo</title> 10 <title>bot-page 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="../../../build/js/common-strings.js"></script>
16 <script src="/res/js/common.js"></script> 17 <script src="/res/js/common.js"></script>
17 <script src="/res/js/alias.js"></script> 18 <script src="/res/js/alias.js"></script>
18 <script src="../../../node_modules/sinon/pkg/sinon-1.17.5.js"></script> 19 <script src="../../../node_modules/sinon/pkg/sinon-1.17.5.js"></script>
19 <!-- Makes a var called bots. It's an array of things that could be returned- -> 20 <!-- Makes a var called bots. It's an array of things that could be returned- ->
20 <script type="text/javascript" src="bot-demo.json"></script> 21 <script type="text/javascript" src="bot-demo.json"></script>
21 <!-- Makes a var called events. It's an array of things that could be returne d--> 22 <!-- Makes a var called events. It's an array of things that could be returne d-->
22 <script type="text/javascript" src="bot-events-demo.json"></script> 23 <script type="text/javascript" src="bot-events-demo.json"></script>
23 <!-- Makes a var called tasks. It's an array of things that could be returned --> 24 <!-- Makes a var called tasks. It's an array of things that could be returned -->
24 <script type="text/javascript" src="bot-tasks-demo.json"></script> 25 <script type="text/javascript" src="bot-tasks-demo.json"></script>
25 26
26 <script type="text/javascript" charset="utf-8"> 27 <script type="text/javascript" charset="utf-8">
27 sinon.format = function(object) {return JSON.stringify(object);} 28 sinon.format = function(object) {return JSON.stringify(object);}
28 sinon.log = function(message) {console.log(message);}; 29 sinon.log = function(message) {console.log(message);};
29 var server = sinon.fakeServer.create(); 30 var server = sinon.fakeServer.create();
30 server.autoRespond = true; 31 server.autoRespond = true;
31 server.autoRespondAfter = 1000; 32 server.autoRespondAfter = 1000;
33 sk.now = function(){
34 // for stats, lock in "now" at Wed Sep 28 2016 16:23:04 GMT-0400 (EDT)
35 return 1475094184;
36 }
32 37
33 var genResponse = function(arr) { 38 var genResponse = function(arr) {
34 return function(request){ 39 return function(request){
35 if (!request.requestHeaders.authorization) { 40 if (!request.requestHeaders.authorization) {
36 sinon.log("You must be logged in (check your Oauth?)"); 41 sinon.log("You must be logged in (check your Oauth?)");
37 request.respond(403, {}, "You must be logged in (check your Oauth?)"); 42 request.respond(403, {}, "You must be logged in (check your Oauth?)");
38 return; 43 return;
39 } 44 }
40 sinon.log("User authenticated :) "+ request.requestHeaders.authorization ); 45 sinon.log("User authenticated :) "+ request.requestHeaders.authorization );
41 sinon.log("Bot Request: "+sinon.format(request)); 46 sinon.log("Bot Request: "+sinon.format(request));
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 </head> 115 </head>
111 <body> 116 <body>
112 117
113 <bot-page 118 <bot-page
114 bot_id="test-bot-001" 119 bot_id="test-bot-001"
115 client_id="20770472288-t5smpbpjptka4nd888fv0ctd23ftba2o.apps.googleusercontent .com"> 120 client_id="20770472288-t5smpbpjptka4nd888fv0ctd23ftba2o.apps.googleusercontent .com">
116 </bot-page> 121 </bot-page>
117 122
118 </body> 123 </body>
119 </html> 124 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698