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

Unified Diff: appengine/swarming/elements/res/imp/index/swarming-index.html

Issue 2372553003: Show bootstrap and server bot_code version (Closed) Base URL: git@github.com:luci/luci-py@bootstrap
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: appengine/swarming/elements/res/imp/index/swarming-index.html
diff --git a/appengine/swarming/elements/res/imp/index/swarming-index.html b/appengine/swarming/elements/res/imp/index/swarming-index.html
index 5370895b7cf84cf0cfa655f116104a0187087b0c..c9e050967ced70e0b208d5ca5edb5d36f5bbd2ac 100644
--- a/appengine/swarming/elements/res/imp/index/swarming-index.html
+++ b/appengine/swarming/elements/res/imp/index/swarming-index.html
@@ -47,7 +47,7 @@
<swarming-app
client_id="[[client_id]]"
- auth_headers="{{auth_headers}}"
+ auth_headers="{{_auth_headers}}"
permissions="{{_permissions}}"
server_version="{{_server_version}}"
name="Swarming Server"
@@ -55,6 +55,7 @@
<h2>Service Status</h2>
<div>Server Version: [[_server_version.server_version]]</div>
+ <div>Bot Version: [[_server_version.bot_version]]</div>
<ul>
<li>
<!-- TODO(kjlubick) convert these linked pages to Polymer-->
@@ -132,10 +133,13 @@
type: String,
},
+
+ _auth_headers: {
+ type: String,
+ },
_bootstrap_token: {
type: String,
- // TODO(kjlubick): fetch this from an API
- value: "abc123",
+ value: "...",
},
_busy: {
type: Boolean,
@@ -162,11 +166,25 @@
},
},
+ observers: ["_fetchBootstrap(_permissions,_auth_headers)"],
+
_cannotBootstrap: function(permissions) {
return !(permissions && permissions.get_bootstrap_token);
},
+ _fetchBootstrap: function(permissions, auth_headers) {
+ if (!auth_headers || !permissions || this._cannotBootstrap(permissions)) {
+ return;
+ }
+ var p = sk.request("POST", "/_ah/api/swarming/v1/server/token", undefined, auth_headers);
stephana 2016/09/26 20:04:11 Shouldn't this also deal with the case when the PO
kjlubick 2016/09/27 12:09:31 Done.
+ this.set("_busy", true);
+ p.then(JSON.parse).then(function(t){
+ this.set("_bootstrap_token", t.bootstrap_token);
+ this.set("_busy", false);
+ }.bind(this))
+ },
+
_makeInstancesUrl: function(details, project_id) {
return "https://console.cloud.google.com/appengine/instances?project="+
project_id+"&versionId="+details.server_version;

Powered by Google App Engine
This is Rietveld 408576698