diff options
author | Paul Donald <newtwen+github@gmail.com> | 2024-05-12 23:14:47 +0200 |
---|---|---|
committer | Paul Donald <newtwen+github@gmail.com> | 2024-05-14 13:55:36 +0200 |
commit | aa942bdfcefc39a43ae5ad0b478056dd406d2ec8 (patch) | |
tree | 08cf1e22678f294d9d54c38e5e917927b88a1194 /applications | |
parent | ede57a8a186533201bfad1936ca0001e9fc10acb (diff) |
luci-app-xinetd: introduce bind setting
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Diffstat (limited to 'applications')
-rw-r--r-- | applications/luci-app-xinetd/htdocs/luci-static/resources/view/xinetd/xinetd.js | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/applications/luci-app-xinetd/htdocs/luci-static/resources/view/xinetd/xinetd.js b/applications/luci-app-xinetd/htdocs/luci-static/resources/view/xinetd/xinetd.js index c8caa5292f..8f5583f7bd 100644 --- a/applications/luci-app-xinetd/htdocs/luci-static/resources/view/xinetd/xinetd.js +++ b/applications/luci-app-xinetd/htdocs/luci-static/resources/view/xinetd/xinetd.js @@ -4,6 +4,7 @@ 'require form'; 'require view'; 'require fs'; +'require network'; 'require tools.widgets as widgets'; function validateEmpty(section, value) { @@ -16,8 +17,15 @@ function validateEmpty(section, value) { } return view.extend({ - render: function() { + load: function() { + return Promise.all([ + network.getNetworks() + ]); + }, + + render: function(promises) { var m, s, o; + var networks = promises[0]; m = new form.Map('xinetd', _('Xinetd Settings'), _('Here you can configure Xinetd services')); @@ -97,6 +105,24 @@ return view.extend({ o.rmempty = false; o.modalonly = true; + o = s.taboption('basic', form.Value, 'bind', _('Bind address'), _('To which address to bind')); + o.datatype = 'ipaddr'; + [4, 6].forEach(family => { + networks.forEach(network => { + if (network.getName() !== 'loopback') { + const addrs = (family === 6) ? network.getIP6Addrs() : network.getIPAddrs(); + addrs.forEach(addr => { + o.value(addr.split('/')[0], E([], [ + addr.split('/')[0], ' (', + widgets.NetworkSelect.prototype.renderIfaceBadge(network), + ')' + ])); + }); + } + }); + }); + o.rmempty = true; + o = s.taboption('basic', form.Value, 'id', _('Identification'), _('Required if a services can use tcp and udp.')); o.datatype = 'string'; o.value('time-stream'); |