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

Unified Diff: appengine/swarming/elements/res/imp/tasklist/task-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
Index: appengine/swarming/elements/res/imp/tasklist/task-list-data.html
diff --git a/appengine/swarming/elements/res/imp/tasklist/task-list-data.html b/appengine/swarming/elements/res/imp/tasklist/task-list-data.html
index aceba1f3b9fb1d1932740f06502f0a75a9e962e7..4eeaee2dbfb0b88348994fd18fc60dd8bdfb0bd2 100644
--- a/appengine/swarming/elements/res/imp/tasklist/task-list-data.html
+++ b/appengine/swarming/elements/res/imp/tasklist/task-list-data.html
@@ -172,30 +172,12 @@
var values = Object.keys(map[key]);
if (swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(key) === -1) {
pMap[key] = values;
- } else if (key === "gpu") {
- var gpus = [];
- values.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 (key === "device_type") {
- var devs = [];
- values.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 = [];
+ values.forEach(function(value){
+ aliased.push(swarming.alias.apply(value, key));
+ });
+ pMap[key] = aliased;
}
}
« no previous file with comments | « appengine/swarming/elements/res/imp/tasklist/task-list.html ('k') | appengine/swarming/elements/res/js/alias.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698