Skip to content

Commit 6ee6568

Browse files
luci-app-upnp: Add UI field dependencies when UPnP IGD is disabled
Signed-off-by: Self-Hosting-Group <[email protected]>
1 parent 608a9c6 commit 6ee6568

File tree

1 file changed

+24
-10
lines changed
  • applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp

1 file changed

+24
-10
lines changed

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

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,33 +127,47 @@ return view.extend({
127127
s.taboption('general', form.Flag, 'secure_mode', _('Enable secure mode'),
128128
_('Allow adding port forwards only to requesting IP addresses')).default = '1'
129129

130-
s.taboption('general', form.Flag, 'igdv1', _('Enable UPnP IGDv1 mode'),
131-
_('Advertise as UPnP IGDv1 device (no IPv6) instead of IGDv2')).default = '1'
130+
o = s.taboption('general', form.Flag, 'igdv1', _('Enable UPnP IGDv1 mode'),
131+
_('Advertise as UPnP IGDv1 device (no IPv6) instead of IGDv2'))
132+
o.depends('enable_upnp', '1')
133+
o.default = '1'
132134

133135
s.taboption('general', form.Flag, 'log_output', _('Enable additional logging'),
134136
_('Puts extra debugging information into the system log'))
135137

136-
s.taboption('general', form.Value, 'download', _('Download speed'),
137-
_('Value in KByte/s, informational only')).rmempty = true
138+
o = s.taboption('general', form.Value, 'download', _('Download speed'),
139+
_('Value in KByte/s, informational only'))
140+
o.depends('enable_upnp', '1')
141+
o.rmempty = true
138142

139-
s.taboption('general', form.Value, 'upload', _('Upload speed'),
140-
_('Value in KByte/s, informational only')).rmempty = true
143+
o = s.taboption('general', form.Value, 'upload', _('Upload speed'),
144+
_('Value in KByte/s, informational only'))
145+
o.depends('enable_upnp', '1')
146+
o.rmempty = true
141147

142148
o = s.taboption('general', form.Value, 'port', _('SOAP/HTTP port'))
149+
o.depends('enable_upnp', '1')
143150
o.datatype = 'port'
144151
o.default = 5000
145152

146-
s.taboption('advanced', form.Flag, 'system_uptime', _('Report system instead of service uptime')).default = '1'
153+
o = s.taboption('advanced', form.Flag, 'system_uptime', _('Report system instead of service uptime'))
154+
o.depends('enable_upnp', '1')
155+
o.default = '1'
147156

148-
s.taboption('advanced', form.Value, 'uuid', _('Device UUID'))
149-
s.taboption('advanced', form.Value, 'serial_number', _('Announced serial number'))
150-
s.taboption('advanced', form.Value, 'model_number', _('Announced model number'))
157+
o = s.taboption('advanced', form.Value, 'uuid', _('Device UUID'))
158+
o.depends('enable_upnp', '1')
159+
o = s.taboption('advanced', form.Value, 'serial_number', _('Announced serial number'))
160+
o.depends('enable_upnp', '1')
161+
o = s.taboption('advanced', form.Value, 'model_number', _('Announced model number'))
162+
o.depends('enable_upnp', '1')
151163

152164
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>'))
165+
o.depends('enable_upnp', '1')
153166
o.datatype = 'uinteger'
154167
o.placeholder = 900
155168

156169
o = s.taboption('advanced', form.Value, 'presentation_url', _('Presentation URL'))
170+
o.depends('enable_upnp', '1')
157171
o.placeholder = 'http://192.168.1.1/'
158172

159173
o = s.taboption('advanced', form.Value, 'upnp_lease_file', _('Service lease file'))

0 commit comments

Comments
 (0)