| OLD | NEW |
| 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-app> | 9 <swarming-app> |
| 10 | 10 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 on-tap="_toggleMobileMenu" | 142 on-tap="_toggleMobileMenu" |
| 143 hidden$="[[wide_layout]]"> | 143 hidden$="[[wide_layout]]"> |
| 144 </paper-icon-button> | 144 </paper-icon-button> |
| 145 <div class="title left">[[name]]</div> | 145 <div class="title left">[[name]]</div> |
| 146 <paper-spinner-lite class="left" active="[[_or(busy,_busy1,_busy2)]]">
</paper-spinner-lite> | 146 <paper-spinner-lite class="left" active="[[_or(busy,_busy1,_busy2)]]">
</paper-spinner-lite> |
| 147 | 147 |
| 148 <a class="left" href="/" hidden$="[[!wide_layout]]">Home</a> | 148 <a class="left" href="/" hidden$="[[!wide_layout]]">Home</a> |
| 149 <a class="left" href="/botlist" hidden$="[[!wide_layout]]">Bot List</a
> | 149 <a class="left" href="/botlist" hidden$="[[!wide_layout]]">Bot List</a
> |
| 150 <a class="left" href="/tasklist" hidden$="[[!wide_layout]]">Task List<
/a> | 150 <a class="left" href="/tasklist" hidden$="[[!wide_layout]]">Task List<
/a> |
| 151 <div class="flex" hidden$="[[!wide_layout]]"></div> | 151 <div class="flex" hidden$="[[!wide_layout]]"></div> |
| 152 <a class="small right" href$="[[_getOldURL()]]" hidden$="[[!wide_layou
t]]">Old UI</a> |
| 152 <template is="dom-if" if="[[client_id]]"> | 153 <template is="dom-if" if="[[client_id]]"> |
| 153 <div class="small right"> | 154 <div class="small right"> |
| 154 Server: | 155 Server: |
| 155 <a href$="[[_versionLink(server_details)]]"> | 156 <a href$="[[_versionLink(server_details)]]"> |
| 156 [[server_details.server_version]] | 157 [[server_details.server_version]] |
| 157 </a> | 158 </a> |
| 158 </div> | 159 </div> |
| 159 <auth-signin | 160 <auth-signin |
| 160 class="right" | 161 class="right" |
| 161 client_id="[[client_id]]" | 162 client_id="[[client_id]]" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 type: Boolean, | 237 type: Boolean, |
| 237 value: false, | 238 value: false, |
| 238 }, | 239 }, |
| 239 _busy2: { | 240 _busy2: { |
| 240 type: Boolean, | 241 type: Boolean, |
| 241 value: false, | 242 value: false, |
| 242 } | 243 } |
| 243 | 244 |
| 244 }, | 245 }, |
| 245 | 246 |
| 247 _getOldURL: function() { |
| 248 // TODO(kjlubick): Remove this on Jan 1, 2017, along with the rest |
| 249 // of the stuff. |
| 250 var path = window.location.pathname; |
| 251 if (path === "/botlist") { |
| 252 return "/oldui/restricted/bots"; |
| 253 } |
| 254 if (path === "/tasklist") { |
| 255 return "/oldui/user/tasks"; |
| 256 } |
| 257 var idRegex = new RegExp("id=([^&]+)"); |
| 258 var match = idRegex.exec(window.location.search); |
| 259 var id = ""; |
| 260 if (match && match.length > 1) { |
| 261 id = match[1]; |
| 262 } |
| 263 if (path === "/bot") { |
| 264 return "/oldui/restricted/bot/" + id; |
| 265 } |
| 266 if (path === "/task") { |
| 267 return "/oldui/user/task/"+id; |
| 268 } |
| 269 |
| 270 return "/oldui"; |
| 271 }, |
| 272 |
| 246 _load: function() { | 273 _load: function() { |
| 247 this._getJsonAsync("permissions", "/api/swarming/v1/server/permissions", | 274 this._getJsonAsync("permissions", "/api/swarming/v1/server/permissions", |
| 248 "_busy1", this.auth_headers); | 275 "_busy1", this.auth_headers); |
| 249 this._getJsonAsync("server_details", "/api/swarming/v1/server/details", | 276 this._getJsonAsync("server_details", "/api/swarming/v1/server/details", |
| 250 "_busy2", this.auth_headers).catch(function(r){ | 277 "_busy2", this.auth_headers).catch(function(r){ |
| 251 sk.errorMessage("Http response: "+ (r.status || " ") + " " + r.respo
nse); | 278 sk.errorMessage("Http response: "+ (r.status || " ") + " " + r.respo
nse); |
| 252 }); | 279 }); |
| 253 }, | 280 }, |
| 254 | 281 |
| 255 _toggleMobileMenu: function() { | 282 _toggleMobileMenu: function() { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 border: none; | 390 border: none; |
| 364 line-height: 20px; | 391 line-height: 20px; |
| 365 vertical-align: middle; | 392 vertical-align: middle; |
| 366 } | 393 } |
| 367 | 394 |
| 368 select { | 395 select { |
| 369 overflow-y: auto; | 396 overflow-y: auto; |
| 370 } | 397 } |
| 371 </style> | 398 </style> |
| 372 </dom-module> | 399 </dom-module> |
| OLD | NEW |