summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-03-01 10:42:10 +0100
committerJo-Philipp Wich <jo@mein.io>2021-03-01 10:42:10 +0100
commit0ee422b4c0e266f0ece70fa60e0ebfa84851992e (patch)
treed05b6d3b583bab1ed4858c4f3e915495260dc260 /modules/luci-base/htdocs
parent77d6b2893524df3c3a9e3df7c974ed054e0171ab (diff)
luci-base: network.js: sort interface statuses by metric, then name
Fixes: #4693 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/network.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js
index 1f749c593c..1e24915f97 100644
--- a/modules/luci-base/htdocs/luci-static/resources/network.js
+++ b/modules/luci-base/htdocs/luci-static/resources/network.js
@@ -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));
},