sort local devices by name
This commit is contained in:
parent
f08b8292fa
commit
3d8e398987
1 changed files with 7 additions and 1 deletions
|
|
@ -2827,8 +2827,14 @@
|
||||||
let html = ['<table>'];
|
let html = ['<table>'];
|
||||||
html.push(`<thead><tr><th>device</th><th>type</th><th>status</th><th></th></tr></thead>`);
|
html.push(`<thead><tr><th>device</th><th>type</th><th>status</th><th></th></tr></thead>`);
|
||||||
html.push(`<tbody>`);
|
html.push(`<tbody>`);
|
||||||
|
let recs = [];
|
||||||
for (let k in data) {
|
for (let k in data) {
|
||||||
let r = data[k].stat;
|
recs.push(data[k].stat);
|
||||||
|
}
|
||||||
|
recs.sort((a,b) => {
|
||||||
|
return a.device.name < b.device.name ? -1 : 1;
|
||||||
|
});
|
||||||
|
for (let r of recs) {
|
||||||
bind.push({uuid: r.device.uuid, host: r.device.addr[0], port: r.device.port});
|
bind.push({uuid: r.device.uuid, host: r.device.addr[0], port: r.device.port});
|
||||||
html.push(`<tr>`);
|
html.push(`<tr>`);
|
||||||
html.push(`<td>${r.device.name}</td>`);
|
html.push(`<td>${r.device.name}</td>`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue