Skip to content

Commit 252c346

Browse files
luci-app-upnp: rename UCI section name to settings (v2.0)
Inspired/address copilot's PR review for a clearer config by rename UCI section name `config` (v1.0) -> `settings` (v2.0), helps on migration and to distinguish the updated config from the previous one easily (to merge with prior) Signed-off-by: Self-Hosting-Group <[email protected]>
1 parent e72aa4a commit 252c346

File tree

2 files changed

+6
-6
lines changed
  • applications/luci-app-upnp

2 files changed

+6
-6
lines changed

applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ return view.extend({
9292
'The %s (%s = UPnP IGD & PCP/NAT-PMP) protocols/service enable permitted devices on local networks to autonomously set up port maps (forwards) on this router.')
9393
.format(protocols)
9494
);
95-
if (!uci.get('upnpd', 'config')) {
95+
if (!uci.get('upnpd', 'settings')) {
9696
ui.addNotification(null, E('div', '<h4>' + _('No suitable configuration was found!') + '</h4><p>' +
97-
_('No suitable (LuCI app %s) config found in %s. Related package update (daemon or LuCI app) may be missing.').format('v1.0', '<code>/etc/config/upnpd</code>') + '<br>' +
97+
_('No suitable (LuCI app %s) config found in %s. Related package update (daemon or LuCI app) may be missing.').format('v2.0', '<code>/etc/config/upnpd</code>') + '<br>' +
9898
_('Use the software package manager, update lists, and install the related update. Config is migrated on the daemon package update.') + '</p>' +
9999
'<a class="btn" href="/cgi-bin/luci/admin/system/package-manager?query=UPnP%20IGD%20&%20PCP/NAT-PMP">' + _('Go to package manager…') + '</a>'), 'warning');
100100
m.readonly = true;
101101
}
102102

103103
s = m.section(form.GridSection, '_active_rules');
104-
s.disable = uci.get('upnpd', 'config', 'enabled') == '0';
104+
s.disable = uci.get('upnpd', 'settings', 'enabled') == '0';
105105

106106
s.render = L.bind(function(view, section_id) {
107107
const table = E('table', { 'class': 'table cbi-section-table', 'id': 'upnp_status_table' }, [
@@ -142,7 +142,7 @@ return view.extend({
142142
]);
143143
}, o, this);
144144

145-
s = m.section(form.NamedSection, 'config', 'upnpd', _('Service Settings'));
145+
s = m.section(form.NamedSection, 'settings', 'upnpd', _('Service Settings'));
146146
s.addremove = false;
147147
s.tab('setup', _('Service Setup'));
148148
s.tab('advanced', _('Advanced Settings'));
@@ -369,7 +369,7 @@ return view.extend({
369369
o.value('deny', _('Deny'));
370370

371371
return m.render().then(L.bind(function(m, nodes) {
372-
if (uci.get('upnpd', 'config', 'enabled') != '0') {
372+
if (uci.get('upnpd', 'settings', 'enabled') != '0') {
373373
poll.add(L.bind(function() {
374374
return Promise.all([
375375
callUpnpGetStatus()

applications/luci-app-upnp/root/usr/share/rpcd/ucode/luci.upnp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { connect } from 'ubus';
1010
import { cursor } from 'uci';
1111

1212
const uci = cursor();
13-
const leasefilepath = uci.get('upnpd', 'config', 'lease_file') || '/run/miniupnpd.leases';
13+
const leasefilepath = uci.get('upnpd', 'settings', 'lease_file') || '/run/miniupnpd.leases';
1414

1515
const methods = {
1616
get_status: {

0 commit comments

Comments
 (0)