Skip to content
Snippets Groups Projects
Commit 80515c08 authored by corvusmo's avatar corvusmo
Browse files

gluon-status-page: sort gateways alphabetically

Fixes #698
parent 271e8640
No related branches found
No related tags found
No related merge requests found
...@@ -22,18 +22,27 @@ define(["lib/helper"], function (Helper) { ...@@ -22,18 +22,27 @@ define(["lib/helper"], function (Helper) {
return el return el
} }
function mkRow(table, label, stream) { function mkRow(table, label, stream, sorted) {
var tr = document.createElement("tr")
var i = -1
if (sorted) {
for (i = 0; i < table.rows.length; i++) {
if (label < table.rows[i].firstChild.textContent)
break
}
}
var tr = table.insertRow(i)
var th = document.createElement("th") var th = document.createElement("th")
var td = streamElement("td", stream) var td = streamElement("td", stream)
th.textContent = label th.textContent = label
tr.appendChild(th) tr.appendChild(th)
tr.appendChild(td) tr.appendChild(td)
table.appendChild(tr)
tr.destroy = function () { tr.destroy = function () {
td.destroy() td.destroy()
table.removeChild(tr) table.tBodies[0].removeChild(tr)
} }
return tr return tr
...@@ -127,7 +136,7 @@ define(["lib/helper"], function (Helper) { ...@@ -127,7 +136,7 @@ define(["lib/helper"], function (Helper) {
stream.startWith(d) stream.startWith(d)
.map(peer.path) .map(peer.path)
.filter(function (d) { return d !== undefined }) .filter(function (d) { return d !== undefined })
.map(prettyPeer)) .map(prettyPeer), true)
}) })
} }
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment