diff options
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'); |