luci-base: network.js: sort interface statuses by metric, then name
Fixes: #4693
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 0ee422b4c0
)
This commit is contained in:
parent
0e5057cbbb
commit
ee07c30207
1 changed files with 12 additions and 0 deletions
|
@ -1437,6 +1437,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));
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue