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

Unified Diff: appengine/swarming/ui/res/imp/common/swarming-app.html

Issue 2523433002: Add link to old ui back in (Closed)
Patch Set: Created 4 years, 1 month 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/ui/res/imp/common/swarming-app.html
diff --git a/appengine/swarming/ui/res/imp/common/swarming-app.html b/appengine/swarming/ui/res/imp/common/swarming-app.html
index 2bf693a9026bcf35bffb638947aa198032cccf5e..159427ccc28fca2df2dcf473c1fc271f970907eb 100644
--- a/appengine/swarming/ui/res/imp/common/swarming-app.html
+++ b/appengine/swarming/ui/res/imp/common/swarming-app.html
@@ -149,6 +149,7 @@
<a class="left" href="/botlist" hidden$="[[!wide_layout]]">Bot List</a>
<a class="left" href="/tasklist" hidden$="[[!wide_layout]]">Task List</a>
<div class="flex" hidden$="[[!wide_layout]]"></div>
+ <a class="small right" href$="[[_getOldURL()]]" hidden$="[[!wide_layout]]">Old UI</a>
<template is="dom-if" if="[[client_id]]">
<div class="small right">
Server:
@@ -243,6 +244,32 @@
},
+ _getOldURL: function() {
+ // TODO(kjlubick): Remove this on Jan 1, 2017, along with the rest
+ // of the stuff.
+ var path = window.location.pathname;
+ if (path === "/botlist") {
+ return "/oldui/restricted/bots";
+ }
+ if (path === "/tasklist") {
+ return "/oldui/user/tasks";
+ }
+ var idRegex = new RegExp("id=([^&]+)");
+ var match = idRegex.exec(window.location.search);
+ var id = "";
+ if (match && match.length > 1) {
+ id = match[1];
+ }
+ if (path === "/bot") {
+ return "/oldui/restricted/bot/" + id;
+ }
+ if (path === "/task") {
+ return "/oldui/user/task/"+id;
+ }
+
+ return "/oldui";
+ },
+
_load: function() {
this._getJsonAsync("permissions", "/api/swarming/v1/server/permissions",
"_busy1", this.auth_headers);
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | appengine/swarming/ui/res/imp/index/swarming-index-demo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698