summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/htdocs/luci-static/resources/view
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/view
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/view')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js16
1 files changed, 3 insertions, 13 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
index e5376d07c8..b88183d51f 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
@@ -13,16 +13,6 @@
var isReadonlyView = !L.hasViewPermission() || null;
-function strcmp(a, b) {
- if (a < b)
- return -1;
-
- if (a > b)
- return 1;
-
- return 0;
-}
-
function count_changes(section_id) {
var changes = ui.changes.changes, n = 0;
@@ -545,7 +535,7 @@ return view.extend({
var protocols = network.getProtocols();
protocols.sort(function(a, b) {
- return strcmp(a.getProtocol(), b.getProtocol());
+ return L.naturalCompare(a.getProtocol(), b.getProtocol());
});
o = s.taboption('general', form.DummyValue, '_ifacestat_modal', _('Status'));
@@ -1101,7 +1091,7 @@ return view.extend({
proto, name, device;
protocols.sort(function(a, b) {
- return a.getProtocol() > b.getProtocol();
+ return L.naturalCompare(a.getProtocol(), b.getProtocol());
});
s2.render = function() {
@@ -1263,7 +1253,7 @@ return view.extend({
s.cfgsections = function() {
var sections = uci.sections('network', 'device'),
- section_ids = sections.sort(function(a, b) { return strcmp(a.name, b.name) }).map(function(s) { return s['.name'] });
+ section_ids = sections.sort(function(a, b) { return L.naturalCompare(a.name, b.name) }).map(function(s) { return s['.name'] });
for (var i = 0; i < netDevs.length; i++) {
if (sections.filter(function(s) { return s.name == netDevs[i].getName() }).length)