From 38ab29229aae760e54ffa412ea2fc40b439dcee6 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 4 Sep 2020 13:59:54 +0200 Subject: luci-app-ddns: add tabs section The page was a bit confusing. By adding the tabs for information and global settings, the page looks clearer. Signed-off-by: Florian Eckert --- .../luci-static/resources/view/ddns/overview.js | 144 ++++++++++----------- 1 file changed, 68 insertions(+), 76 deletions(-) (limited to 'applications/luci-app-ddns/htdocs/luci-static/resources') diff --git a/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js b/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js index 3fd752beeb..711769fb67 100644 --- a/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js +++ b/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js @@ -154,12 +154,15 @@ return view.extend({ s = is; - o = s.option(form.DummyValue, '_version', _('Dynamic DNS Version')); + s.tab('info', _('Information')); + s.tab('global', _('Global Settings')); + + o = s.taboption('info', form.DummyValue, '_version', _('Dynamic DNS Version')); o.cfgvalue = function() { return status[this.option]; }; - o = s.option(form.DummyValue, '_enabled', _('State')); + o = s.taboption('info', form.DummyValue, '_enabled', _('State')); o.cfgvalue = function() { var res = status[this.option]; if (!res) { @@ -169,7 +172,7 @@ return view.extend({ return res ? _('DDNS Autostart enabled') : _('DDNS Autostart disabled') }; - o = s.option(form.DummyValue, '_toggle', ' '); + o = s.taboption('info', form.DummyValue, '_toggle', ' '); o.cfgvalue = function() { var action = status['_enabled'] ? 'stop' : 'start'; return E([], [ @@ -185,7 +188,7 @@ return view.extend({ }, _(action.toUpperCase() + ' DDns'))]); }; - o = s.option(form.DummyValue, '_restart', ' '); + o = s.taboption('info', form.DummyValue, '_restart', ' '); o.cfgvalue = function() { return E([], [ E('button', { @@ -199,7 +202,7 @@ return view.extend({ // DDns hints if (!env['has_ipv6']) { - o = s.option(form.DummyValue, '_no_ipv6'); + o = s.taboption('info', form.DummyValue, '_no_ipv6'); o.rawhtml = true; o.title = '' + _("IPv6 not supported") + ''; o.cfgvalue = function() { return _("IPv6 is currently not (fully) supported by this system") + "
" + @@ -208,7 +211,7 @@ return view.extend({ } if (!env['has_ssl']) { - o = s.option(form.DummyValue, '_no_https'); + o = s.taboption('info', form.DummyValue, '_no_https'); o.titleref = L.url("admin", "system", "opkg") o.rawhtml = true; o.title = '' + _("HTTPS not supported") + ''; @@ -220,7 +223,7 @@ return view.extend({ } if (!env['has_bindnet']) { - o = s.option(form.DummyValue, '_no_bind_network'); + o = s.taboption('info', form.DummyValue, '_no_bind_network'); o.titleref = L.url("admin", "system", "opkg") o.rawhtml = true; o.title = '' + _("Binding to a specific network not supported") + ''; @@ -234,7 +237,7 @@ return view.extend({ } if (!env['has_proxy']) { - o = s.option(form.DummyValue, '_no_proxy'); + o = s.taboption('info', form.DummyValue, '_no_proxy'); o.titleref = L.url("admin", "system", "opkg") o.rawhtml = true; o.title = '' + _("cURL without Proxy Support") + ''; @@ -246,7 +249,7 @@ return view.extend({ } if (!env['has_forceip']) { - o = s.option(form.DummyValue, '_no_force_ip'); + o = s.taboption('info', form.DummyValue, '_no_force_ip'); o.titleref = L.url("admin", "system", "opkg") o.rawhtml = true; o.title = '' + _("Force IP Version not supported") + ''; @@ -257,7 +260,7 @@ return view.extend({ } if (!env['has_bindhost']) { - o = s.option(form.DummyValue, '_no_dnstcp'); + o = s.taboption('info', form.DummyValue, '_no_dnstcp'); o.titleref = L.url("admin", "system", "opkg") o.rawhtml = true; o.title = '' + _("DNS requests via TCP not supported") + ''; @@ -268,7 +271,7 @@ return view.extend({ } if (!env['has_dnsserver']) { - o = s.option(form.DummyValue, '_no_dnsserver'); + o = s.taboption('info', form.DummyValue, '_no_dnsserver'); o.titleref = L.url("admin", "system", "opkg") o.rawhtml = true; o.title = '' + _("Using specific DNS Server not supported") + ''; @@ -280,7 +283,7 @@ return view.extend({ } if (env['has_ssl'] && !env['has_cacerts']) { - o = s.option(form.DummyValue, '_no_certs'); + o = s.taboption('info', form.DummyValue, '_no_certs'); o.titleref = L.url("admin", "system", "opkg") o.rawhtml = true; o.title = '' + _("No certificates found") + ''; @@ -290,6 +293,59 @@ return view.extend({ "by hand into /etc/ssl/certs default directory")}; } + // Advanced Configuration Section + + o = s.taboption('global', form.Flag, 'upd_privateip', _("Allow non-public IP's")); + o.description = _("Non-public and by default blocked IP's") + ':' + + '
IPv4: ' + + '0/8, 10/8, 100.64/10, 127/8, 169.254/16, 172.16/12, 192.168/16' + + '
IPv6: ' + + '::/32, f000::/4"'; + o.default = "0"; + o.optional = true; + + o = s.taboption('global', form.Value, 'ddns_dateformat', _('Date format')); + o.description = '' + + _("For supported codes look here") + + '
' + + _('Current setting: ') + '' + status['_curr_dateformat'] + ''; + o.default = "%F %R" + o.optional = true; + o.rmempty = true; + + o = s.taboption('global', form.Value, 'ddns_rundir', _('Status directory')); + o.description = _('Directory contains PID and other status information for each running section.'); + o.default = "/var/run/ddns"; + o.optional = true; + o.rmempty = true; + + o = s.taboption('global', form.Value, 'ddns_logdir', _('Log directory')); + o.description = _('Directory contains Log files for each running section.'); + o.default = "/var/log/ddns"; + o.optional = true; + o.rmempty = true; + o.validate = function(section_id, formvalue) { + if (formvalue.indexOf('../') !== -1) + return _('"../" not allowed in path for Security Reason.') + + return true; + } + + o = s.taboption('global', form.Value, 'ddns_loglines', _('Log length')); + o.description = _('Number of last lines stored in log files'); + o.datatype = 'min(1)'; + o.default = '250'; + + if (env['has_wget'] && env['has_curl']) { + + o = s.taboption('global', form.Flag, 'use_curl', _('Use cURL')); + o.description = _('If Wget and cURL package are installed, Wget is used for communication by default.'); + o.default = "0"; + o.optional = true; + o.rmempty = true; + + } + // DDns services s = m.section(form.GridSection, 'service', _('Services')); s.anonymous = true; @@ -949,70 +1005,6 @@ return view.extend({ ]); }, o, this) - - // Advanced Configuration Section - - s = m.section(form.NamedSection, 'global', 'ddns', _('Global Configuration')); - s.description = _('Configure here the details for all Dynamic DNS services including this LuCI application.') - + '
' - + _("It is NOT recommended for casual users to change settings on this page.") - + '
' - + '' - + _('For detailed information about parameter settings look here.') - + ''; - s.addremove = false; - - o = s.option(form.Flag, 'upd_privateip', _("Allow non-public IP's")); - o.description = _("Non-public and by default blocked IP's") + ':' - + '
IPv4: ' - + '0/8, 10/8, 100.64/10, 127/8, 169.254/16, 172.16/12, 192.168/16' - + '
IPv6: ' - + '::/32, f000::/4"'; - o.default = "0"; - o.optional = true; - - o = s.option(form.Value, 'ddns_dateformat', _('Date format')); - o.description = '' - + _("For supported codes look here") - + '
' + - _('Current setting: ') + '' + status['_curr_dateformat'] + ''; - o.default = "%F %R" - o.optional = true; - o.rmempty = true; - - o = s.option(form.Value, 'ddns_rundir', _('Status directory')); - o.description = _('Directory contains PID and other status information for each running section.'); - o.default = "/var/run/ddns"; - o.optional = true; - o.rmempty = true; - - o = s.option(form.Value, 'ddns_logdir', _('Log directory')); - o.description = _('Directory contains Log files for each running section.'); - o.default = "/var/log/ddns"; - o.optional = true; - o.rmempty = true; - o.validate = function(section_id, formvalue) { - if (formvalue.indexOf('../') !== -1) - return _('"../" not allowed in path for Security Reason.') - - return true; - } - - o = s.option(form.Value, 'ddns_loglines', _('Log length')); - o.description = _('Number of last lines stored in log files'); - o.datatype = 'min(1)'; - o.default = '250'; - - if (env['has_wget'] && env['has_curl']) { - - o = s.option(form.Flag, 'use_curl', _('Use cURL')); - o.description = _('If Wget and cURL package are installed, Wget is used for communication by default.'); - o.default = "0"; - o.optional = true; - o.rmempty = true; - - } - return m.render().then(L.bind(function(m, nodes) { poll.add(L.bind(function() { return Promise.all([ -- cgit v1.2.3