summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-upnp
diff options
context:
space:
mode:
authorSergey Ponomarev <stokito@gmail.com>2024-11-30 14:53:50 +0200
committerPaul Donald <newtwen+github@gmail.com>2024-11-30 19:06:51 +0100
commit7a7f9ec0b76489e4a147f5c493d7345e89e9c387 (patch)
tree8ad83ea6a3ca3d8ab00ca58dc5a8159e3b1210b1 /applications/luci-app-upnp
parent98c04137b47dd5253cdfcf18e5b4ad6e68258c46 (diff)
luci-app-upnp: remove dangling lines and split translations
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Diffstat (limited to 'applications/luci-app-upnp')
-rw-r--r--applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js4
-rw-r--r--applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js30
2 files changed, 16 insertions, 18 deletions
diff --git a/applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js b/applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js
index 3173fb35bc..dcb6963734 100644
--- a/applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js
+++ b/applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js
@@ -37,7 +37,6 @@ return baseclass.extend({
},
render: function(data) {
-
var table = E('table', { 'class': 'table', 'id': 'upnp_status_table' }, [
E('tr', { 'class': 'tr table-titles' }, [
E('th', { 'class': 'th' }, _('Client Name')),
@@ -51,7 +50,6 @@ return baseclass.extend({
]);
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
-
var rows = rules.map(function(rule) {
return [
rule.host_hint || _('Unknown'),
@@ -66,9 +64,7 @@ return baseclass.extend({
}, [ _('Delete') ])
];
});
-
cbi_update_table(table, rows, E('em', _('There are no active port maps.')));
-
return table;
}
});
diff --git a/applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js b/applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js
index 6bd7bf3a6d..a51cd72a01 100644
--- a/applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js
+++ b/applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js
@@ -45,9 +45,7 @@ return view.extend({
},
poll_status: function(nodes, data) {
-
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
-
var rows = rules.map(function(rule) {
return [
rule.host_hint || _('Unknown'),
@@ -62,18 +60,21 @@ return view.extend({
}, [ _('Delete') ])
];
});
-
cbi_update_table(nodes.querySelector('#upnp_status_table'), rows, E('em', _('There are no active port maps.')));
-
- return;
},
render: function(data) {
-
var m, s, o;
+ var protocols = '%s & %s/%s'.format(
+ '<a href="https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol" target="_blank" rel="noreferrer"><abbr title="UPnP Internet Gateway Device (Control Protocol)">UPnP IGD</abbr></a>',
+ '<a href="https://en.wikipedia.org/wiki/Port_Control_Protocol" target="_blank" rel="noreferrer"><abbr title="Port Control Protocol">PCP</abbr></a>',
+ '<a href="https://en.wikipedia.org/wiki/NAT_Port_Mapping_Protocol" target="_blank" rel="noreferrer"><abbr title="NAT Port Mapping Protocol">NAT-PMP</abbr></a>');
m = new form.Map('upnpd', [_('UPnP IGD & PCP/NAT-PMP Service')],
- _('The %s protocols allow clients on the local network to configure port maps/forwards on the router autonomously.', 'The %s (%s = UPnP IGD & PCP/NAT-PMP) protocols allow clients on the local network to configure port maps/forwards on the router autonomously.').format('%s & %s/%s').format('<a href="https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol" target="_blank" rel="noreferrer"><abbr title="UPnP Internet Gateway Device (Control Protocol)">UPnP IGD</abbr></a>', '<a href="https://en.wikipedia.org/wiki/Port_Control_Protocol" target="_blank" rel="noreferrer"><abbr title="Port Control Protocol">PCP</abbr></a>', '<a href="https://en.wikipedia.org/wiki/NAT_Port_Mapping_Protocol" target="_blank" rel="noreferrer"><abbr title="NAT Port Mapping Protocol">NAT-PMP</abbr></a>'));
+ _('The %s protocols allow clients on the local network to configure port maps/forwards on the router autonomously.',
+ 'The %s (%s = UPnP IGD & PCP/NAT-PMP) protocols allow clients on the local network to configure port maps/forwards on the router autonomously.')
+ .format(protocols)
+ );
s = m.section(form.GridSection, '_active_rules');
@@ -91,7 +92,6 @@ return view.extend({
]);
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
-
var rows = rules.map(function(rule) {
return [
rule.host_hint || _('Unknown'),
@@ -106,9 +106,7 @@ return view.extend({
}, [ _('Delete') ])
];
});
-
cbi_update_table(table, rows, E('em', _('There are no active port maps.')));
-
return E('div', { 'class': 'cbi-section cbi-tblsection' }, [
E('h3', _('Active Service Port Maps')), table ]);
}, o, this);
@@ -122,9 +120,11 @@ return view.extend({
_('Start autonomous port mapping service'));
o.rmempty = false;
- s.taboption('setup', form.Flag, 'enable_upnp', _('Enable UPnP IGD protocol')).default = '1';
+ s.taboption('setup', form.Flag, 'enable_upnp', _('Enable UPnP IGD protocol'))
+ s.default = '1';
- s.taboption('setup', form.Flag, 'enable_natpmp', _('Enable PCP/NAT-PMP protocols')).default = '1';
+ s.taboption('setup', form.Flag, 'enable_natpmp', _('Enable PCP/NAT-PMP protocols'))
+ s.default = '1';
o = s.taboption('setup', form.Flag, 'igdv1', _('UPnP IGDv1 compatibility mode'),
_('Advertise as IGDv1 (IPv4 only) device instead of IGDv2'));
@@ -140,7 +140,8 @@ return view.extend({
_('Report maximum upload speed in kByte/s'));
o.depends('enable_upnp', '1');
- s.taboption('advanced', form.Flag, 'use_stun', _('Use %s', 'Use %s (%s = STUN)').format('<a href="https://en.wikipedia.org/wiki/STUN" target="_blank" rel="noreferrer"><abbr title="Session Traversal Utilities for NAT">STUN</abbr></a>'),
+ s.taboption('advanced', form.Flag, 'use_stun', _('Use %s', 'Use %s (%s = STUN)')
+ .format('<a href="https://en.wikipedia.org/wiki/STUN" target="_blank" rel="noreferrer"><abbr title="Session Traversal Utilities for NAT">STUN</abbr></a>'),
_('To detect the public IPv4 address for unrestricted full-cone/one-to-one NATs'));
o = s.taboption('advanced', form.Value, 'stun_host', _('STUN Host'));
@@ -158,7 +159,8 @@ return view.extend({
o.depends('enable_upnp', '1');
o = s.taboption('advanced', form.Value, 'notify_interval', _('Notify interval'),
- _('A 900s interval will result in %s notifications with the minimum max-age of 1800s', 'A 900s interval will result in %s (%s = SSDP) notifications with the minimum max-age of 1800s').format('<abbr title="Simple Service Discovery Protocol">SSDP</abbr>'));
+ _('A 900s interval will result in %s notifications with the minimum max-age of 1800s', 'A 900s interval will result in %s (%s = SSDP) notifications with the minimum max-age of 1800s')
+ .format('<abbr title="Simple Service Discovery Protocol">SSDP</abbr>'));
o.datatype = 'uinteger';
o.placeholder = '900';
o.depends('enable_upnp', '1');