summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
Diffstat (limited to 'remoting')
-rw-r--r--remoting/webapp/host_list.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/remoting/webapp/host_list.js b/remoting/webapp/host_list.js
index 08865205..69f49a5 100644
--- a/remoting/webapp/host_list.js
+++ b/remoting/webapp/host_list.js
@@ -120,6 +120,19 @@ remoting.HostList.prototype.parseHostListResponse_ = function(xhr, onDone) {
/** @type {{data: {items: Array}}} */ JSON.parse(xhr.responseText);
if (parsed_response.data && parsed_response.data.items) {
this.hosts_ = parsed_response.data.items;
+ /**
+ * @param {remoting.Host} a
+ * @param {remoting.Host} b
+ */
+ var cmp = function(a, b) {
+ if (a.status < b.status) {
+ return 1;
+ } else if (b.status < a.status) {
+ return -1;
+ }
+ return 0;
+ };
+ this.hosts_ = /** @type {Array} */ this.hosts_.sort(cmp);
}
} else {
// Some other error.