diff --git a/package/lean/autocore/files/x86/index.htm b/package/lean/autocore/files/x86/index.htm index cd63bf02c..ee3161274 100644 --- a/package/lean/autocore/files/x86/index.htm +++ b/package/lean/autocore/files/x86/index.htm @@ -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);