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

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

Issue 2291323002: Introduce new bot-page UI (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@bot-page
Patch Set: Fix some query glitches Created 4 years, 4 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/botpage/bot-page-demo.html
diff --git a/appengine/swarming/elements/res/imp/botpage/bot-page-demo.html b/appengine/swarming/elements/res/imp/botpage/bot-page-demo.html
index bffc60cf4dd156ffa041d57651e37228637e38a8..8d1930007243259befa601681e6d65568804a4b6 100644
--- a/appengine/swarming/elements/res/imp/botpage/bot-page-demo.html
+++ b/appengine/swarming/elements/res/imp/botpage/bot-page-demo.html
@@ -39,8 +39,18 @@
}
sinon.log("User authenticated :) "+ request.requestHeaders.authorization);
sinon.log("Bot Request: "+sinon.format(request));
- // TODO(kjlubick)make this return a thing from the list
- request.respond(200, {"Content-Type":"application/json"}, JSON.stringify(arr[0]));
+ // If the user changes bot id, show them some of the other sample data.
+ var idx = request.url.indexOf("-00");
+ var item = 0;
+ if (idx !=-1) {
+ var name = request.url.substring(idx+1, idx+4);
+ item = parseInt(name) || 0;
+ name = Math.max(name - 1, 0);
+ name = Math.min(name, arr.length-1);
+ }
+
+
+ request.respond(200, {"Content-Type":"application/json"}, JSON.stringify(arr[name]));
}
}

Powered by Google App Engine
This is Rietveld 408576698