diff options
Diffstat (limited to 'modules/luci-mod-network')
-rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js | 14 |
1 files changed, 12 insertions, 2 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 18078cd9bd..e5376d07c8 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,6 +13,16 @@ 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; @@ -535,7 +545,7 @@ return view.extend({ var protocols = network.getProtocols(); protocols.sort(function(a, b) { - return a.getProtocol() > b.getProtocol(); + return strcmp(a.getProtocol(), b.getProtocol()); }); o = s.taboption('general', form.DummyValue, '_ifacestat_modal', _('Status')); @@ -1253,7 +1263,7 @@ return view.extend({ s.cfgsections = function() { var sections = uci.sections('network', 'device'), - section_ids = sections.sort(function(a, b) { return a.name > b.name }).map(function(s) { return s['.name'] }); + section_ids = sections.sort(function(a, b) { return strcmp(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) |