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

Unified Diff: appengine/swarming/ui/res/imp/botlist/bot-filters.html

Issue 2872573003: Add UI for botlist to only display Machine Provider bots (Closed)
Patch Set: Created 3 years, 7 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/ui/build/elements.html ('k') | appengine/swarming/ui/res/imp/botlist/bot-list-data.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/ui/res/imp/botlist/bot-filters.html
diff --git a/appengine/swarming/ui/res/imp/botlist/bot-filters.html b/appengine/swarming/ui/res/imp/botlist/bot-filters.html
index 3bdc6b009b231a4418b74741028375f09dc574bc..82028d427cf8c09805faf4c12d3e7655f3137ac2 100644
--- a/appengine/swarming/ui/res/imp/botlist/bot-filters.html
+++ b/appengine/swarming/ui/res/imp/botlist/bot-filters.html
@@ -28,12 +28,13 @@
// outputs
columns: Array<String>, the columns that should be displayed.
query_params: Object, The query params that will filter the query
- server-side. This can have dimensions:Array<String>, quarantined:String
- and is_dead: String. For example:
+ server-side. This can have dimensions:Array<String>, quarantined:String,
+ is_dead: String and is_mp: String. For example:
{
"dimensions": ["pool:Skia", "device_type:Sprout"],
"quarantined": "FALSE", // optional
"is_dead": "TRUE", // optional
+ "is_mp": "TRUE", // optional
}
For a full list of dimensions in the fleet, see the API call:
https://[swarming_url]/api/swarming/v1/bots/dimensions
@@ -190,7 +191,7 @@ the fleet.">
</template>
<script>
(function(){
- // See query-column-filter for more documentation on these properties.
+ // See SwarmingBehaviors.QueryColumnFilter for more documentation on these properties.
var filterMap = {
disk_space: function(bot, space) {
return true;
@@ -198,6 +199,14 @@ the fleet.">
id: function(bot, id) {
return true;
},
+ is_mp_bot: function(bot, match) {
+ if (match === "true") {
+ return !!bot.lease_id;
+ } else if (match === "false") {
+ return !bot.lease_id;
+ }
+ return true;
+ },
status: function(bot, status) {
if (status === "quarantined") {
return bot.quarantined;
@@ -274,14 +283,13 @@ the fleet.">
this._filters.forEach(function(f) {
var split = f.split(this.FILTER_SEP, 1)
var col = split[0];
+ var rest = f.substring(col.length + this.FILTER_SEP.length);
if (this.dimensions.indexOf(col) !== -1) {
- var rest = f.substring(col.length + this.FILTER_SEP.length);
if (swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(col) !== -1) {
rest = swarming.alias.unapply(rest);
}
dims.push(col + this.FILTER_SEP + rest)
} else if (col === "status") {
- var rest = f.substring(col.length + this.FILTER_SEP.length);
if (rest === "alive") {
params["is_dead"] = ["FALSE"];
params["quarantined"] = ["FALSE"];
@@ -290,6 +298,13 @@ the fleet.">
} else if (rest === "dead") {
params["is_dead"] = ["TRUE"];
}
+ } else if (col === "is_mp_bot") {
+ if (rest === "true") {
+ params["is_mp"] = ["TRUE"];
+ } else if (rest === "false") {
+ params["is_mp"] = ["FALSE"];
+ }
+ // else if -- may be malformed, don't do anything.
}
}.bind(this));
params["dimensions"] = dims;
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | appengine/swarming/ui/res/imp/botlist/bot-list-data.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698