From 98dcd665249684d676c7ffd9b659f3e411db5a18 Mon Sep 17 00:00:00 2001 From: remittor Date: Sun, 14 Dec 2025 12:41:32 +0300 Subject: [PATCH] luci: settings: Rename checkbox DISABLE_CUSTOM --- .../luci-static/resources/view/zapret/settings.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/luci-app-zapret/htdocs/luci-static/resources/view/zapret/settings.js b/luci-app-zapret/htdocs/luci-static/resources/view/zapret/settings.js index ba32679..0602ea0 100644 --- a/luci-app-zapret/htdocs/luci-static/resources/view/zapret/settings.js +++ b/luci-app-zapret/htdocs/luci-static/resources/view/zapret/settings.js @@ -363,9 +363,19 @@ return view.extend({ tabname = 'custom_d_tab'; s.tab(tabname, 'custom.d'); - o = s.taboption(tabname, form.Flag, 'DISABLE_CUSTOM', _('DISABLE_CUSTOM')); + o = s.taboption(tabname, form.Flag, 'DISABLE_CUSTOM', _('Use custom.d scripts')); o.rmempty = false; - o.default = 0; + o.default = '0'; + o.validate = function(section_id, value) { return true; }; + o.load = function(section_id) { + return uci.load(tools.appName).then(L.bind(function() { + var v = uci.get(tools.appName, section_id, 'DISABLE_CUSTOM'); + return (v === '1') ? '0' : '1'; + }, this)); + }; + o.write = function(section_id, value) { + return uci.set(tools.appName, section_id, 'DISABLE_CUSTOM', value === '1' ? '0' : '1'); + }; add_delim(s);