Chromium Code Reviews| Index: appengine/swarming/ui/res/imp/common/common-behavior.html |
| diff --git a/appengine/swarming/ui/res/imp/common/common-behavior.html b/appengine/swarming/ui/res/imp/common/common-behavior.html |
| index e3db4d5d0239ae4cf5e679da195d35590b8a50e2..8cab3e942e018b822b7fc9e6fffc816e1f2f58d1 100644 |
| --- a/appengine/swarming/ui/res/imp/common/common-behavior.html |
| +++ b/appengine/swarming/ui/res/imp/common/common-behavior.html |
| @@ -30,14 +30,26 @@ |
| }, |
| // Create a link to a bot list with the preloaded filters and columns. |
| - // filters should be an array of {key:String, value:String} and |
| + // filters should be an array of {key:String, value:String} or an array |
|
jcgregorio
2016/12/06 18:51:55
Document arg params like you did in task-list-data
kjlubick
2016/12/06 20:05:27
Done.
|
| + // of {key:String, value:Array<String>} or an array of Strings |
| + // of Strings, where the Strings are valid filters (e.g. "foo:bar") and |
|
stephana
2016/12/06 18:43:39
typo: "array of Strings of Strings"
kjlubick
2016/12/06 18:50:32
Done.
|
| // columns should be an array of Strings. |
| _botListLink: function(filters, columns) { |
| filters = filters || []; |
| columns = columns || []; |
| var fArr = []; |
| filters.forEach(function(f){ |
| - fArr.push(f.key + ":" + f.value); |
| + if (f.key && f.value) { |
| + if (Array.isArray(f.value)) { |
| + f.value.forEach(function(v) { |
| + fArr.push(f.key + ":" + v); |
| + }); |
| + } else { |
| + fArr.push(f.key + ":" + f.value); |
| + } |
| + } else { |
| + fArr.push(f); |
| + } |
| }); |
| var obj = { |
| f: fArr, |
| @@ -182,6 +194,28 @@ |
| return "/task?id=" + taskId; |
| }, |
| + // Create a link to a task list with the preloaded filters and columns. |
| + // filters should be an array of {key:String, value:String} or an array |
| + // of Strings, where the Strings are valid filters (e.g. "foo:bar") and |
| + // columns should be an array of Strings. |
| + _taskListLink: function(filters, columns) { |
| + filters = filters || []; |
| + columns = columns || []; |
| + var fArr = []; |
| + filters.forEach(function(f){ |
| + if (f.key && f.value) { |
| + fArr.push(f.key + ":" + f.value); |
| + } else { |
| + fArr.push(f); |
| + } |
| + }); |
| + var obj = { |
| + f: fArr, |
| + c: columns, |
| + } |
| + return "/tasklist?" + sk.query.fromParamSet(obj); |
| + }, |
| + |
| // _timeDiffApprox returns the approximate difference between now and |
| // the specified date. |
| _timeDiffApprox: function(date){ |