From: David Härdeman Date: Tue, 21 Oct 2025 21:43:15 +0000 (+0200) Subject: luci-mod-network: add a odhcpd tab to dhcp.js X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=000ba488d8ccf7a0d7e2d15845f0ecc6e7f62241;p=project%2Fluci.git luci-mod-network: add a odhcpd tab to dhcp.js Add a separate tab with the global odhcpd settings. Signed-off-by: David Härdeman --- diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js index 456321c21f..0e625a442d 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js @@ -238,6 +238,8 @@ return view.extend({ s = this.add_dnsmasq_cfg(m, networks); + this.add_odhcpd_cfg(s); + this.add_leases_cfg(s, hosts, duids, pools, macdata); s.tab('pxe_tftp', _('PXE/TFTP')); @@ -663,6 +665,50 @@ return view.extend({ return s; }, + add_odhcpd_cfg: function(s) { + var o, ss, so; + + s.tab('odhcpd', _('odhcpd')); + o = s.taboption('odhcpd', form.SectionValue, '__odhcpd__', form.TypedSection, 'odhcpd', null, + _('Note that many options are set on a per-interface basis in the Interfaces tab.')); + + ss = o.subsection; + ss.anonymous = true; + + so = ss.option(form.Flag, 'maindhcp', + _('DHCPv4'), + _('Use odhcp for DHCPv4. This will disable DHCPv4 support in dnsmasq.') + '
' + + _('The DHCPv4 functionality also needs to be enabled on a per-interface basis.')); + + so = ss.option(form.Value, 'leasefile', + _('Lease file'), + _('File to store active DHCP leases in.')); + + so = ss.option(form.Value, 'leasetrigger', + _('Lease trigger'), + _('Path to a script to run each time the lease file changes.')); + + so = ss.option(form.Value, 'hostsfile', + _('Hosts file'), + _('Path to store a hostsfile (IP address to hostname mapping) in. Used by e.g. dnsmasq.')); + + so = ss.option(form.Value, 'piofolder', + _('PIO directory'), + _('Directory to store IPv6 prefix information files in (to detect and announce stale prefixes).')); + + so = ss.option(form.Value, 'loglevel', + _('Log level'), + _('Log level of the odhcpd daemon.')); + so.value('0', 'Emergency'); + so.value('1', 'Alert'); + so.value('2', 'Critical'); + so.value('3', 'Error'); + so.value('4', 'Warning'); + so.value('5', 'Notice'); + so.value('6', 'Info'); + so.value('7', 'Debug'); + }, + add_leases_cfg: function(s, hosts, duids, pools, macdata) { var has_dhcpv6 = L.hasSystemFeature('dnsmasq', 'dhcpv6') || L.hasSystemFeature('odhcpd'), o, ss, so;