luci-base: network.js: sort interface statuses by metric, then name

Fixes: #4693
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2021-03-01 10:42:10 +01:00
parent 77d6b28935
commit 0ee422b4c0

View file

@ -1453,6 +1453,18 @@ Network = baseclass.extend(/** @lends LuCI.network.prototype */ {
}
}
rv.sort(function(a, b) {
if (a.metric != b.metric)
return (a.metric - b.metric);
if (a.interface < b.interface)
return -1;
else if (a.interface > b.interface)
return 1;
return 0;
});
return rv;
}, this));
},