Merge pull request #2880 from tano-systems/pr/fix-for-2878
luci-app-firewall: format protocol family for forwards and rules
This commit is contained in:
commit
776e6d5409
3 changed files with 13 additions and 2 deletions
|
@ -211,6 +211,15 @@ return L.Class.extend({
|
|||
return rv;
|
||||
},
|
||||
|
||||
fmt_family: function(family) {
|
||||
if (family == 'ipv4')
|
||||
return _('IPv4');
|
||||
else if (family == 'ipv6')
|
||||
return _('IPv6');
|
||||
else
|
||||
return _('IPv4 and IPv6');
|
||||
},
|
||||
|
||||
fmt_proto: function(x, icmp_types) {
|
||||
var rv = E([]), l = L.toArray(x);
|
||||
|
||||
|
|
|
@ -42,7 +42,8 @@ function fmt(fmt /*, ...*/) {
|
|||
}
|
||||
|
||||
function forward_proto_txt(s) {
|
||||
return fmt('%s-%s', _('IPv4'),
|
||||
return fmt('%s-%s',
|
||||
fwtool.fmt_family(uci.get('firewall', s, 'family')),
|
||||
fwtool.fmt_proto(uci.get('firewall', s, 'proto'),
|
||||
uci.get('firewall', s, 'icmp_type')) || 'TCP+UDP');
|
||||
}
|
||||
|
|
|
@ -42,7 +42,8 @@ function fmt(fmt /*, ...*/) {
|
|||
}
|
||||
|
||||
function forward_proto_txt(s) {
|
||||
return fmt('%s-%s', _('IPv4'),
|
||||
return fmt('%s-%s',
|
||||
fwtool.fmt_family(uci.get('firewall', s, 'family')),
|
||||
fwtool.fmt_proto(uci.get('firewall', s, 'proto'),
|
||||
uci.get('firewall', s, 'icmp_type')) || 'TCP+UDP');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue