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

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

Issue 2375963003: Move bot-list and task-list to use pageable-data (Closed) Base URL: git@github.com:luci/luci-py@limit-tasks
Patch Set: rename Created 4 years, 2 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/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 46f621f188acac73f6be3a59eba3340179427681..3781d8b6ad5b7df71c74001e143a3d5268542743 100644
--- a/appengine/swarming/elements/res/imp/botlist/bot-list-data.html
+++ b/appengine/swarming/elements/res/imp/botlist/bot-list-data.html
@@ -19,16 +19,7 @@
// inputs
auth_headers: Object, the OAuth2 header to include in the request. This
should come from swarming-app.
- 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:
- {
- "dimensions": ["pool:Skia", "device_type:Sprout"],
- "quarantined": "FALSE", // optional
- "is_dead": "TRUE", // optional
- }
- For a full list of dimensions in the fleet, see the API call:
- https://[swarming_url]/_ah/api/swarming/v1/bots/dimensions
+
// outputs
bots: Array<Object>, all bots returned by the server. This is an Object
with at least the following structure:
@@ -104,20 +95,16 @@
type: Object,
observer: "signIn",
},
- query_params: {
- type: Object,
- observer: "_request",
- },
//outputs
bots: {
type: Array,
- computed: "_bots(_list)",
+ computed: "parseBots(_list)",
notify: true,
},
busy: {
type: Boolean,
- computed: "_or(_busy1,_busy2,_busy3)",
+ computed: "_or(_busy2,_busy1)",
notify: true,
},
dimensions: {
@@ -143,7 +130,7 @@
},
// private
- _busy1: {
+ _busy1: {
type: Boolean,
value: false
},
@@ -151,10 +138,6 @@
type: Boolean,
value: false
},
- _busy3: {
- type: Boolean,
- value: false
- },
_count: {
type: Object,
},
@@ -170,17 +153,15 @@
this._getJsonAsync("_count", "/_ah/api/swarming/v1/bots/count",
"_busy2", this.auth_headers);
this._getJsonAsync("_dimensions","/_ah/api/swarming/v1/bots/dimensions",
- "_busy3", this.auth_headers);
-
- this._request();
+ "_busy1", this.auth_headers);
},
- _bots: function(){
- if (!this._list || !this._list.items) {
+ parseBots: function(json){
+ if (!json || !json.items) {
return [];
}
// Do any preprocessing here
- this._list.items.forEach(function(bot){
+ json.items.forEach(function(bot){
// Parse the state, which is a JSON string. This contains a lot of
// interesting information like details about the devices attached.
bot.state = bot.state || "{}";
@@ -228,7 +209,7 @@
}
}.bind(this));
- return this._list.items;
+ return json.items;
},
_fleet: function() {
@@ -301,15 +282,6 @@
return pMap;
},
- _request: function() {
- // wait until the user has logged in and the filters have loaded before requesting this to avoid double or even triple requests.
- if (!this.auth_headers || !this.query_params) {
- return;
- }
- this._getJsonAsync("_list", "/_ah/api/swarming/v1/bots/list",
- "_busy1", this.auth_headers, this.query_params);
- },
-
});
})();
</script>

Powered by Google App Engine
This is Rietveld 408576698