From 26fcbd5df2ce59b349fa3f250d6bddb66ebe242b Mon Sep 17 00:00:00 2001 From: Alexey Dobrovolsky Date: Thu, 5 May 2022 01:18:51 +0300 Subject: [PATCH] luci-mod-system: add interface selection for NTPD UCI option `interface` for sysntpd server was introduced in OpenWrt commit 4da60500ebd2. NTP server binds to the specified interface, or if unspecified, to all. This patch adds selection widget to LuCI. Signed-off-by: Alexey Dobrovolsky (cherry picked from commit 24ac5a2bf6d713c6878cf7be7d4e4516965c2884) --- .../htdocs/luci-static/resources/view/system/system.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js index d207a5c994..aef11b2bc0 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js @@ -5,6 +5,7 @@ 'require uci'; 'require rpc'; 'require form'; +'require tools.widgets as widgets'; var callInitList, callInitAction, callTimezone, callGetLocaltime, callSetLocaltime, CBILocalTime; @@ -281,6 +282,15 @@ return view.extend({ o.ucisection = 'ntp'; o.depends('enabled', '1'); + o = s.taboption('timesync', widgets.NetworkSelect, 'interface', + _('Bind NTP server'), + _('Provide the NTP server to the selected interface or, if unspecified, to all interfaces')); + o.ucisection = 'ntp'; + o.depends('enable_server', '1'); + o.multiple = false; + o.nocreate = true; + o.optional = true; + o = s.taboption('timesync', form.Flag, 'use_dhcp', _('Use DHCP advertised servers')); o.ucisection = 'ntp'; o.default = o.enabled; -- 2.30.2