summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/htdocs/luci-static/resources/tools
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-07-27 17:33:59 +0200
committerJo-Philipp Wich <jo@mein.io>2022-07-27 17:33:59 +0200
commit801d4513b25117de20706695dda715ff34c9355b (patch)
treec3ad2a99056437a2405d82094c9fb6c5051b7c3c /modules/luci-mod-network/htdocs/luci-static/resources/tools
parent37422e891a47f15659356ce75b6f6cce831e0041 (diff)
luci-mod-network: ensure consistent bridge port and network interface order
Ref: #5899 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-network/htdocs/luci-static/resources/tools')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js14
1 files changed, 2 insertions, 12 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
index 11d2162d11..c31015a564 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
@@ -780,6 +780,8 @@ return baseclass.extend({
return network.instantiateDevice(port)
}).filter(function(dev) {
return dev.getType() != 'wifi' || dev.isUp();
+ }).sort(function(a, b) {
+ return L.naturalCompare(a.getName(), b.getName());
});
this.children = this.children.filter(function(opt) { return !opt.option.match(/^port_/) });
@@ -893,18 +895,6 @@ return baseclass.extend({
for (var port_name in seen_ports)
ports.push(port_name);
- ports.sort(function(a, b) {
- var m1 = a.match(/^(.+?)([0-9]*)$/),
- m2 = b.match(/^(.+?)([0-9]*)$/);
-
- if (m1[1] < m2[1])
- return -1;
- else if (m1[1] > m2[1])
- return 1;
- else
- return +(m1[2] || 0) - +(m2[2] || 0);
- });
-
ss.updatePorts(ports);
},