mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
index.html: DHCP client list re-order
This commit is contained in:
parent
6482d2270c
commit
f5307dff2a
@ -188,6 +188,20 @@
|
||||
});
|
||||
}
|
||||
|
||||
var compare = function (prop) {
|
||||
return function (obj1, obj2) {
|
||||
var val1 = Number(obj1[prop].replaceAll(".",""));
|
||||
var val2 = Number(obj2[prop].replaceAll(".",""));
|
||||
if (val1 < val2) {
|
||||
return -1;
|
||||
} else if (val1 > val2) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
XHR.poll(1, '<%=REQUEST_URI%>', { status: 1 },
|
||||
function(x, info)
|
||||
{
|
||||
@ -381,6 +395,7 @@
|
||||
var ls = document.getElementById('lease_status_table');
|
||||
if (ls)
|
||||
{
|
||||
info.leases = info.leases.sort(compare("ipaddr"));
|
||||
/* clear all rows */
|
||||
while( ls.rows.length > 1 )
|
||||
ls.rows[0].parentNode.deleteRow(1);
|
||||
|
Loading…
Reference in New Issue
Block a user