Skip to content

Commit

Permalink
luci-mod-network: Add filter-rr to filter responses by record type name
Browse files Browse the repository at this point in the history
This follows openwrt/openwrt#14975

Signed-off-by: Paul Donald <[email protected]>
  • Loading branch information
systemcrash committed Oct 22, 2024
1 parent f88f903 commit 4254b02
Showing 1 changed file with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,36 @@ return view.extend({

};

const recordtypes = [
'ANY',
'A',
'AAAA',
'ALIAS',
'CAA',
'CERT',
'CNAME',
'DS',
'HINFO',
'HIP',
'HTTPS',
'KEY',
'LOC',
'MX',
'NAPTR',
'NS',
'OPENPGPKEY',
'PTR',
'RP',
'SIG',
'SOA',
'SRV',
'SSHFP',
'SVCB',
'TLSA',
'TXT',
'URI',
]

function customi18n(template, values) {
if (!values)
values = noi18nstrings;
Expand Down Expand Up @@ -648,6 +678,16 @@ return view.extend({
_('Remove IPv4 addresses from the results and only return IPv6 addresses.'));
o.optional = true;

o = s.taboption('filteropts', form.MultiValue, 'filter_rr',
_('Filter arbitrary RR'), _('Removes records of the specified type(s) from answers.'));
o.optional = true;
o.create = true;
o.multiple = true;
o.display_size = 5;
recordtypes.forEach(r => {
o.value(r);
});

s.taboption('filteropts', form.Flag, 'localise_queries',
_('Localise queries'),
customi18n(_('Limit response records (from {etc_hosts}) to those that fall within the subnet of the querying interface.') ) + '<br />' +
Expand Down

0 comments on commit 4254b02

Please sign in to comment.