'require form';
'require view';
'require fs';
+'require network';
'require tools.widgets as widgets';
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'));
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');