mirror of
https://github.com/openwrt/luci
synced 2025-01-09 04:28:37 +08:00
luci-app-upnp: Critical hotfix revert 7a7f9ec
Revert "luci-app-upnp: remove dangling lines and split translations"
This reverts commit 7a7f9ec
, as it introduced a regression.
Close #7444
Signed-off-by: Self-Hosting-Group <selfhostinggroup-git+openwrt@shost.ing>
This commit is contained in:
parent
3447700b38
commit
5b1253c41f
@ -37,6 +37,7 @@ return baseclass.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render: function(data) {
|
render: function(data) {
|
||||||
|
|
||||||
var table = E('table', { 'class': 'table', 'id': 'upnp_status_table' }, [
|
var table = E('table', { 'class': 'table', 'id': 'upnp_status_table' }, [
|
||||||
E('tr', { 'class': 'tr table-titles' }, [
|
E('tr', { 'class': 'tr table-titles' }, [
|
||||||
E('th', { 'class': 'th' }, _('Client Name')),
|
E('th', { 'class': 'th' }, _('Client Name')),
|
||||||
@ -50,6 +51,7 @@ return baseclass.extend({
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
|
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
|
||||||
|
|
||||||
var rows = rules.map(function(rule) {
|
var rows = rules.map(function(rule) {
|
||||||
return [
|
return [
|
||||||
rule.host_hint || _('Unknown'),
|
rule.host_hint || _('Unknown'),
|
||||||
@ -64,7 +66,9 @@ return baseclass.extend({
|
|||||||
}, [ _('Delete') ])
|
}, [ _('Delete') ])
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
cbi_update_table(table, rows, E('em', _('There are no active port maps.')));
|
cbi_update_table(table, rows, E('em', _('There are no active port maps.')));
|
||||||
|
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -45,7 +45,9 @@ return view.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
poll_status: function(nodes, data) {
|
poll_status: function(nodes, data) {
|
||||||
|
|
||||||
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
|
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
|
||||||
|
|
||||||
var rows = rules.map(function(rule) {
|
var rows = rules.map(function(rule) {
|
||||||
return [
|
return [
|
||||||
rule.host_hint || _('Unknown'),
|
rule.host_hint || _('Unknown'),
|
||||||
@ -60,10 +62,14 @@ return view.extend({
|
|||||||
}, [ _('Delete') ])
|
}, [ _('Delete') ])
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
cbi_update_table(nodes.querySelector('#upnp_status_table'), rows, E('em', _('There are no active port maps.')));
|
cbi_update_table(nodes.querySelector('#upnp_status_table'), rows, E('em', _('There are no active port maps.')));
|
||||||
|
|
||||||
|
return;
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function(data) {
|
render: function(data) {
|
||||||
|
|
||||||
var m, s, o;
|
var m, s, o;
|
||||||
|
|
||||||
var protocols = '%s & %s/%s'.format(
|
var protocols = '%s & %s/%s'.format(
|
||||||
@ -92,6 +98,7 @@ return view.extend({
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
|
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
|
||||||
|
|
||||||
var rows = rules.map(function(rule) {
|
var rows = rules.map(function(rule) {
|
||||||
return [
|
return [
|
||||||
rule.host_hint || _('Unknown'),
|
rule.host_hint || _('Unknown'),
|
||||||
@ -106,7 +113,9 @@ return view.extend({
|
|||||||
}, [ _('Delete') ])
|
}, [ _('Delete') ])
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
cbi_update_table(table, rows, E('em', _('There are no active port maps.')));
|
cbi_update_table(table, rows, E('em', _('There are no active port maps.')));
|
||||||
|
|
||||||
return E('div', { 'class': 'cbi-section cbi-tblsection' }, [
|
return E('div', { 'class': 'cbi-section cbi-tblsection' }, [
|
||||||
E('h3', _('Active Service Port Maps')), table ]);
|
E('h3', _('Active Service Port Maps')), table ]);
|
||||||
}, o, this);
|
}, o, this);
|
||||||
@ -120,11 +129,9 @@ return view.extend({
|
|||||||
_('Start autonomous port mapping service'));
|
_('Start autonomous port mapping service'));
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
s.taboption('setup', form.Flag, 'enable_upnp', _('Enable UPnP IGD protocol'))
|
s.taboption('setup', form.Flag, 'enable_upnp', _('Enable UPnP IGD protocol')).default = '1';
|
||||||
s.default = '1';
|
|
||||||
|
|
||||||
s.taboption('setup', form.Flag, 'enable_natpmp', _('Enable PCP/NAT-PMP protocols'))
|
s.taboption('setup', form.Flag, 'enable_natpmp', _('Enable PCP/NAT-PMP protocols')).default = '1';
|
||||||
s.default = '1';
|
|
||||||
|
|
||||||
o = s.taboption('setup', form.Flag, 'igdv1', _('UPnP IGDv1 compatibility mode'),
|
o = s.taboption('setup', form.Flag, 'igdv1', _('UPnP IGDv1 compatibility mode'),
|
||||||
_('Advertise as IGDv1 (IPv4 only) device instead of IGDv2'));
|
_('Advertise as IGDv1 (IPv4 only) device instead of IGDv2'));
|
||||||
|
Loading…
Reference in New Issue
Block a user