luci-app-xinetd: make the server configuration option mandatory

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert
2025-03-19 12:50:29 +01:00
parent ac3cbd6106
commit 790302ce85
@@ -159,15 +159,25 @@ return view.extend({
o.rmempty = false;
o.modalonly = true;
o = s.taboption('basic', form.Flag, '_redirect', _('Use redirect'));
o.modalonly = true;
o.load = function(section_id) {
var redirect = uci.get(this.config, section_id, 'redirect');
return redirect ? 1 : 0
};
o.write = function(section_id, formvalue) {};
o = s.taboption('basic', form.Value, 'redirect', _('Redirect'), _('Redirect incoming TCP requests to this IP address:port.'));
o.datatype = 'ipaddrport(1)';
o.rmempty = false;
o.modalonly = true;
o.depends('_redirect', '1');
o = s.taboption('basic', form.Value, 'server', _('Server'), _('Complete path to the executable server file'));
o.datatype = 'string';
o.rmempty = false;
o.modalonly = true;
o.depends('type', 'UNLISTED');
o.depends({ 'type': 'UNLISTED', '_redirect': '0' });
o.validate = validateEmpty;
o.write = function(section, value) {
return fs.stat(value).then(function(res) {
@@ -186,7 +196,7 @@ return view.extend({
o = s.taboption('basic', form.Value, 'server_args', _('Server arguments'), _('Additional arguments passed to the server. There is no validation of this input.'));
o.datatype = 'string';
o.modalonly = true;
o.depends('type', 'UNLISTED');
o.depends({ 'type': 'UNLISTED', '_redirect': '0' });
// Advanced settings
o = s.taboption('advanced', widgets.UserSelect, 'user', _('User (UID)'), _('User ID for the server process for this service'));