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

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

Issue 2296313002: Add server version to all pages (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
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 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 This in an HTML Import-able file that contains the definition 6 This in an HTML Import-able file that contains the definition
7 of the following elements: 7 of the following elements:
8 8
9 <swarming-index> 9 <swarming-index>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 background-color: #f5f5f5; 42 background-color: #f5f5f5;
43 border: 1px solid #ccc; 43 border: 1px solid #ccc;
44 border-radius: 4px; 44 border-radius: 4px;
45 } 45 }
46 </style> 46 </style>
47 47
48 <swarming-app 48 <swarming-app
49 client_id="[[client_id]]" 49 client_id="[[client_id]]"
50 auth_headers="{{auth_headers}}" 50 auth_headers="{{auth_headers}}"
51 permissions="{{_permissions}}" 51 permissions="{{_permissions}}"
52 server_version="{{_server_version}}"
52 name="Swarming Server" 53 name="Swarming Server"
53 busy="[[_busy]]"> 54 busy="[[_busy]]">
54 55
55 <h2>Service Status</h2> 56 <h2>Service Status</h2>
56 <div>Server Version: [[serverDetails.server_version]]</div> 57 <div>Server Version: [[_server_version.server_version]]</div>
57 <ul> 58 <ul>
58 <li> 59 <li>
59 <!-- TODO(kjlubick) convert these linked pages to Polymer--> 60 <!-- TODO(kjlubick) convert these linked pages to Polymer-->
60 <a href="/stats">Usage statistics</a> 61 <a href="/stats">Usage statistics</a>
61 </li> 62 </li>
62 <li> 63 <li>
63 <a href="/restricted/mapreduce/status">Map Reduce Jobs</a> 64 <a href="/restricted/mapreduce/status">Map Reduce Jobs</a>
64 </li> 65 </li>
65 <li> 66 <li>
66 <a href$="[[_makeInstancesUrl(serverDetails,_project_id)]]">View versi on's instances on Cloud Console</a> 67 <a href$="[[_makeInstancesUrl(_server_version,_project_id)]]">View ver sion's instances on Cloud Console</a>
67 </li> 68 </li>
68 <li> 69 <li>
69 <a><a href$="[[_makeErrorUrl(_project_id)]]">View server errors on Clo ud Console</a></a> 70 <a><a href$="[[_makeErrorUrl(_project_id)]]">View server errors on Clo ud Console</a></a>
70 </li> 71 </li>
71 <li> 72 <li>
72 <a><a href$="[[_makeLogUrl(_project_id)]]">View logs for HTTP 5xx on C loud Console</a></a> 73 <a><a href$="[[_makeLogUrl(_project_id)]]">View logs for HTTP 5xx on C loud Console</a></a>
73 </li> 74 </li>
74 </ul> 75 </ul>
75 76
76 <h2>Configuration</h2> 77 <h2>Configuration</h2>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 125
125 behaviors: [ 126 behaviors: [
126 SwarmingBehaviors.CommonBehavior, 127 SwarmingBehaviors.CommonBehavior,
127 ], 128 ],
128 129
129 properties: { 130 properties: {
130 client_id: { 131 client_id: {
131 type: String, 132 type: String,
132 }, 133 },
133 134
134 auth_headers: {
135 type: Object,
136 observer: "signIn",
137 },
138
139 serverDetails: {
140 type: Object,
141 },
142
143 _bootstrap_token: { 135 _bootstrap_token: {
144 type: String, 136 type: String,
145 // TODO(kjlubick): fetch this from an API 137 // TODO(kjlubick): fetch this from an API
146 value: "abc123", 138 value: "abc123",
147 }, 139 },
148 _busy: { 140 _busy: {
149 type: Boolean, 141 type: Boolean,
150 value: false, 142 value: false,
151 }, 143 },
152 _host_url: { 144 _host_url: {
153 type: String, 145 type: String,
154 value: function() { 146 value: function() {
155 return location.origin; 147 return location.origin;
156 }, 148 },
157 }, 149 },
158 _permissions: { 150 _permissions: {
159 type: Object, 151 type: Object,
160 }, 152 },
161 _project_id: { 153 _project_id: {
162 type: String, 154 type: String,
163 value: function() { 155 value: function() {
164 var idx = location.hostname.indexOf(".appspot.com"); 156 var idx = location.hostname.indexOf(".appspot.com");
165 return location.hostname.substring(0, idx); 157 return location.hostname.substring(0, idx);
166 }, 158 },
167 } 159 },
160 _server_version: {
161 type: Object,
162 },
168 }, 163 },
169 164
170 signIn: function(){
171 this._getJsonAsync("serverDetails", "/_ah/api/swarming/v1/server/details ",
172 "_busy", this.auth_headers);
173 },
174 165
175 _cannotBootstrap: function(permissions) { 166 _cannotBootstrap: function(permissions) {
176 return !(permissions && permissions.get_bootstrap_token); 167 return !(permissions && permissions.get_bootstrap_token);
177 }, 168 },
178 169
179 _makeInstancesUrl: function(details, project_id) { 170 _makeInstancesUrl: function(details, project_id) {
180 return "https://console.cloud.google.com/appengine/instances?project="+ 171 return "https://console.cloud.google.com/appengine/instances?project="+
181 project_id+"&versionId="+details.server_version; 172 project_id+"&versionId="+details.server_version;
182 }, 173 },
183 174
184 _makeErrorUrl: function(project_id) { 175 _makeErrorUrl: function(project_id) {
185 return "https://console.cloud.google.com/errors?project="+ 176 return "https://console.cloud.google.com/errors?project="+
186 project_id; 177 project_id;
187 }, 178 },
188 179
189 _makeLogUrl: function(project_id) { 180 _makeLogUrl: function(project_id) {
190 return "https://pantheon.corp.google.com/logs/viewer?filters=text:status :500..599&project="+ 181 return "https://pantheon.corp.google.com/logs/viewer?filters=text:status :500..599&project="+
191 project_id; 182 project_id;
192 }, 183 },
193 184
194 }); 185 });
195 </script> 186 </script>
196 </dom-module> 187 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698