luci-app-ddns: order list of DDNS service providers
authorJo-Philipp Wich <jo@mein.io>
Fri, 28 Apr 2023 22:04:13 +0000 (00:04 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 28 Apr 2023 22:04:13 +0000 (00:04 +0200)
Fixes: #6200
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js

index 5baac07d1a80a2eb3bc6db2fc08e0df9e89f1db2..1f0b373b3a4532fcf34a4f1367580ffc896c9a07 100644 (file)
@@ -519,8 +519,7 @@ return view.extend({
                        service_name = s2.option(form.ListValue, 'service_name',
                                        String.format('%s', _("DDNS Service provider")));
                        service_name.value('-',"-- " + _("custom") + " --");
-                       for (var elem in _this.services)
-                               service_name.value(elem);
+                       Object.keys(_this.services).sort().forEach(name => service_name.value(name));
                        service_name.validate = function(section_id, value) {
                                if (value == '') return _("Select a service");
                                if (s2.service_supported == null) return _("Checking the service support...");
@@ -642,8 +641,7 @@ return view.extend({
                                        String.format('%s', _("DDNS Service provider")));
                                service_name.modalonly = true;
                                service_name.value('-',"-- " + _("custom") + " --");
-                               for (var elem in _this.services)
-                                       service_name.value(elem);
+                               Object.keys(_this.services).sort().forEach(name => service_name.value(name));
                                service_name.cfgvalue = function(section_id) {
                                        return uci.get('ddns', section_id, 'service_name') || '-';
                                };