From 20406cf1bbff3fcf4d3bb2109aca678787240f50 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 22 Jan 2024 15:23:50 +0800 Subject: [PATCH] chore(client): update title/description for rule set Signed-off-by: Tianling Shen --- .../resources/view/homeproxy/client.js | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/htdocs/luci-static/resources/view/homeproxy/client.js b/htdocs/luci-static/resources/view/homeproxy/client.js index 152f4f0e..6fed29be 100644 --- a/htdocs/luci-static/resources/view/homeproxy/client.js +++ b/htdocs/luci-static/resources/view/homeproxy/client.js @@ -479,8 +479,8 @@ return view.extend({ so.datatype = 'or(cidr, ipaddr)'; so.modalonly = true; - so = ss.option(form.Flag, 'source_ip_is_private', _('Source IP is Private'), - _('Match non-public source IP.')); + so = ss.option(form.Flag, 'source_ip_is_private', _('Private source IP'), + _('Match private source IP.')); so.default = so.disabled; so.rmempty = false; so.modalonly = true; @@ -490,8 +490,8 @@ return view.extend({ so.datatype = 'or(cidr, ipaddr)'; so.modalonly = true; - so = ss.option(form.Flag, 'ip_is_private', _('IP is Private'), - _('Match non-public IP.')); + so = ss.option(form.Flag, 'ip_is_private', _('Private IP'), + _('Match private IP.')); so.default = so.disabled; so.rmempty = false; so.modalonly = true; @@ -528,8 +528,8 @@ return view.extend({ _('Match user name.')); so.modalonly = true; - so = ss.option(form.MultiValue, 'rule_set', _('Ruleset'), - _('Match Rule Set.')); + so = ss.option(form.MultiValue, 'rule_set', _('Rule set'), + _('Match rule set.')); so.load = function(section_id) { delete this.keylist; delete this.vallist; @@ -544,8 +544,8 @@ return view.extend({ } so.modalonly = true; - so = ss.option(form.Flag, 'rule_set_ipcidr_match_source', _('Ruleset ipcidr match source'), - _('Make ipcidr in rule sets match the source IP.')); + so = ss.option(form.Flag, 'rule_set_ipcidr_match_source', _('Match source IP via rule set'), + _('Make IP CIDR in rule set used to match the source IP.')); so.default = so.disabled; so.rmempty = false; so.modalonly = true; @@ -825,8 +825,8 @@ return view.extend({ _('Match user name.')); so.modalonly = true; - so = ss.option(form.MultiValue, 'rule_set', _('Ruleset'), - _('Match Rule Set.')); + so = ss.option(form.MultiValue, 'rule_set', _('Rule set'), + _('Match rule set.')); so.load = function(section_id) { delete this.keylist; delete this.vallist; @@ -895,8 +895,8 @@ return view.extend({ /* DNS rules end */ /* Custom routing settings end */ - /* Rule Set settings start */ - s.tab('ruleset', _('Rule Set')); + /* Rule set settings start */ + s.tab('ruleset', _('Rule set')); o = s.taboption('ruleset', form.SectionValue, '_ruleset', form.GridSection, 'ruleset'); o.depends('routing_mode', 'custom'); @@ -905,7 +905,7 @@ return view.extend({ ss.rowcolors = true; ss.sortable = true; ss.nodescriptions = true; - ss.modaltitle = L.bind(hp.loadModalTitle, this, _('Ruleset'), _('Add a ruleset'), data[0]); + ss.modaltitle = L.bind(hp.loadModalTitle, this, _('Rule set'), _('Add a rule set'), data[0]); ss.sectiontitle = L.bind(hp.loadDefaultLabel, this, data[0]); ss.renderSectionAdd = L.bind(hp.renderSectionAdd, this, ss); @@ -938,9 +938,12 @@ return view.extend({ so.depends('type', 'local'); so.modalonly = true; - so = ss.option(form.Value, 'url', _('Ruleset URL')); + so = ss.option(form.Value, 'url', _('Rule set URL')); so.validate = function(section_id, value) { - if (section_id && value) { + if (section_id) { + if (!value) + return _('Expecting: %s').format(_('non-empty value')); + try { var url = new URL(value); if (!url.hostname) @@ -958,7 +961,7 @@ return view.extend({ so.modalonly = true; so = ss.option(form.ListValue, 'outbound', _('Outbound'), - _('Tag of the outbound to download rule-set.')); + _('Tag of the outbound to download rule set.')); so.load = function(section_id) { delete this.keylist; delete this.vallist; @@ -973,13 +976,12 @@ return view.extend({ } so.default = 'direct-out'; so.rmempty = false; - //so.editable = true; so.depends('type', 'remote'); so = ss.option(form.Value, 'update_interval', _('Update interval'), - _('Update interval of Rule Set.
1d will be used if empty.')); + _('Update interval of rule set.
1d will be used if empty.')); so.depends('type', 'remote'); - /* Rule Set settings end */ + /* Rule set settings end */ /* ACL settings start */ s.tab('control', _('Access Control'));