luci-app-ddns: add uppercase helper for cacert fields.
authorPaul Donald <newtwen+github@gmail.com>
Thu, 5 Sep 2024 22:10:25 +0000 (00:10 +0200)
committerPaul Donald <newtwen+github@gmail.com>
Thu, 5 Sep 2024 22:10:38 +0000 (00:10 +0200)
Set 'ignore' to the script recognized value of 'IGNORE'.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js

index 4f70b601cd7ca683192f749716c072236b8729b7..1764c0173036b348e49594ee226e294f31bf53e4 100644 (file)
@@ -452,6 +452,10 @@ return view.extend({
                o = s.taboption('global', form.Value, 'cacert', _('CA Certs path'));
                o.description = _('CA certificates path that will be used to download services data. Set IGNORE to skip certificate validation.');
                o.placeholder = 'IGNORE';
+               o.write = function(section_id, value) {
+                       if(value == 'ignore')
+                               uci.set('ddns', section_id, 'cacert', value.toUpperCase());
+               };
 
                o = s.taboption('global', form.Value, 'services_url', _('Services URL Download'));
                o.description = _('Source URL for services file. Defaults to the master openwrt ddns package repo.');
@@ -783,6 +787,10 @@ return view.extend({
                                                o.placeholder = "/etc/ssl/certs";
                                                o.rmempty = false;
                                                o.optional = true;
+                                               o.write = function(section_id, value) {
+                                                       if(value == 'ignore')
+                                                               uci.set('ddns', section_id, 'cacert', value.toUpperCase());
+                                               };
                                        };