Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/luci-app-upnp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

include $(TOPDIR)/rules.mk

LUCI_TITLE:=UPnP IGD & PCP/NAT-PMP configuration module | Universal Plug and Play
LUCI_TITLE:=LuCI support for UPnP IGD & PCP/NAT-PMP service | originally: Universal Plug and Play
LUCI_DEPENDS:=+luci-base +miniupnpd +rpcd-mod-ucode

PKG_LICENSE:=Apache-2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
const callUpnpGetStatus = rpc.declare({
object: 'luci.upnp',
method: 'get_status',
expect: { }
expect: {}
});

const callUpnpDeleteRule = rpc.declare({
object: 'luci.upnp',
method: 'delete_rule',
params: [ 'token' ],
expect: { result : "OK" },
params: ['token'],
expect: { result: 'OK' },
});

function handleDelRule(num, ev) {
Expand All @@ -35,23 +35,23 @@ return baseclass.extend({
},

render: function(data) {
var table = E('table', { 'class': 'table', 'id': 'upnp_status_table' }, [
const table = E('table', { 'class': 'table', 'id': 'upnp_status_table' }, [
E('tr', { 'class': 'tr table-titles' }, [
E('th', { 'class': 'th' }, _('Client Name')),
E('th', { 'class': 'th' }, _('Client Address')),
E('th', { 'class': 'th' }, _('Client Port')),
E('th', { 'class': 'th' }, _('External Port')),
E('th', { 'class': 'th' }, _('Hostname')),
E('th', { 'class': 'th' }, _('IP address')),
E('th', { 'class': 'th' }, _('Port')),
E('th', { 'class': 'th' }, _('External port')),
E('th', { 'class': 'th' }, _('Protocol')),
E('th', { 'class': 'th right' }, _('Expires')),
E('th', { 'class': 'th' }, _('Description')),
E('th', { 'class': 'th' }, _('Added via / description')),
E('th', { 'class': 'th cbi-section-actions' }, '')
])
]);

var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
const rules = Array.isArray(data[0].rules) ? data[0].rules : [];

var rows = rules.map(function(rule) {
const padnum = (num, length) => num.toString().padStart(length, "0");
const rows = rules.map(function(rule) {
const padnum = (num, length) => num.toString().padStart(length, '0');
const expires_sec = rule?.expires || 0;
const hour = Math.floor(expires_sec / 3600);
const minute = Math.floor((expires_sec % 3600) / 60);
Expand All @@ -72,8 +72,9 @@ return baseclass.extend({
rule.descr,
E('button', {
'class': 'btn cbi-button-remove',
'click': L.bind(handleDelRule, this, rule.num)
}, [ _('Delete') ])
'click': L.bind(handleDelRule, this, rule.num),
'title': _('Delete')
}, [_('Delete')])
];
});

Expand Down
Loading
Loading