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

Unified Diff: appengine/swarming/elements/res/imp/botlist/bot-list-data.html

Issue 2306103002: Add aliases to bot-page and refactor duplicated code (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@fix-buttons
Patch Set: rebase again 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
« no previous file with comments | « appengine/swarming/elements/package.json ('k') | appengine/swarming/elements/res/imp/botpage/bot-page.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/elements/res/imp/botlist/bot-list-data.html
diff --git a/appengine/swarming/elements/res/imp/botlist/bot-list-data.html b/appengine/swarming/elements/res/imp/botlist/bot-list-data.html
index 523e6f766616f7808517c8ccffa420c4d1511c5c..3219243dfaba58d68eb12a768333d77d4871e195 100644
--- a/appengine/swarming/elements/res/imp/botlist/bot-list-data.html
+++ b/appengine/swarming/elements/res/imp/botlist/bot-list-data.html
@@ -226,30 +226,12 @@
if (swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(d.key) === -1) {
// value is an array of all seen values for the dimension d.key
pMap[d.key] = d.value;
- } else if (d.key === "gpu") {
- var gpus = [];
- d.value.forEach(function(g){
- var alias = swarming.alias.gpu(g);
- if (alias !== "unknown") {
- gpus.push(swarming.alias.apply(g, alias));
- } else {
- gpus.push(g);
- }
- }.bind(this));
- pMap["gpu"] = gpus;
- } else if (d.key === "device_type") {
- var devs = [];
- d.value.forEach(function(dt){
- var alias = swarming.alias.android(dt);
- if (alias !== "unknown") {
- devs.push(swarming.alias.apply(dt, alias));
- } else {
- devs.push(dt);
- }
- }.bind(this));
- pMap["device_type"] = devs;
} else {
- console.log("Unknown alias type: ", d);
+ var aliased = [];
+ d.value.forEach(function(value){
+ aliased.push(swarming.alias.apply(value, d.key));
+ });
+ pMap[d.key] = aliased;
}
});
« no previous file with comments | « appengine/swarming/elements/package.json ('k') | appengine/swarming/elements/res/imp/botpage/bot-page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698