luci-proto-qmi: allow v6apn and (v6)profile configuration

To support split-APN dual-stack connections over QMI, add new parameters
supported in UCI to LuCI as well. Previously, connection profile wasn't
configurable from LuCI at all, so add options to set which APN profile
to match for each protocol.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
This commit is contained in:
Lech Perczak 2023-06-09 00:57:36 +02:00
parent 23a246e4b4
commit c682e530e2

View file

@ -65,8 +65,7 @@ return network.registerProtocol('qmi', {
}, this)); }, this));
}; };
o = s.taboption('general', form.Value, 'apn', _('APN')); var validate_apn = function(section_id, value) {
o.validate = function(section_id, value) {
if (value == null || value == '') if (value == null || value == '')
return true; return true;
@ -75,6 +74,14 @@ return network.registerProtocol('qmi', {
return true; return true;
}; };
o = s.taboption('general', form.Value, 'apn', _('APN'));
o.validate = validate_apn;
if (L.hasSystemFeature('ipv6')) {
o = s.taboption('general', form.Value, 'v6apn', _('IPv6 APN'));
o.validate = validate_apn;
o.depends('pdptype', 'ipv4v6')
};
o = s.taboption('general', form.Value, 'pincode', _('PIN')); o = s.taboption('general', form.Value, 'pincode', _('PIN'));
o.datatype = 'and(uinteger,minlength(4),maxlength(8))'; o.datatype = 'and(uinteger,minlength(4),maxlength(8))';
@ -133,5 +140,17 @@ return network.registerProtocol('qmi', {
_('If unchecked, the advertised DNS server addresses are ignored')); _('If unchecked, the advertised DNS server addresses are ignored'));
o.default = o.enabled; o.default = o.enabled;
o = s.taboption('advanced', form.Value, 'profile',
_('APN profile index'));
o.placeholder = '1';
o.datatype = 'uinteger';
if (L.hasSystemFeature('ipv6')) {
o = s.taboption('advanced', form.Value, 'v6profile',
_('IPv6 APN profile index'));
o.placeholder = '1';
o.datatype = 'uinteger';
o.depends('pdptype', 'ipv4v6');
};
} }
}); });