luci-proto-modemmanager: correctness fixes
authorPaul Donald <redacted>
Tue, 26 May 2026 10:15:15 +0000 (13:15 +0300)
committerPaul Donald <redacted>
Wed, 27 May 2026 12:49:46 +0000 (15:49 +0300)
Signed-off-by: Paul Donald <redacted>
protocols/luci-proto-modemmanager/htdocs/luci-static/resources/modemmanager_helper.js
protocols/luci-proto-modemmanager/htdocs/luci-static/resources/protocol/modemmanager.js

index b8558b885b0922635085f4f9d5b2d22ac755ba91..ceb78f8dfcd2d7b32315402a76fc9ec988c14efc 100644 (file)
@@ -30,7 +30,7 @@ return baseclass.extend({
                        if (obj == this._emptyStringValue) {
                                obj = null;
                        }
-               } else if (Array.isArray()) {
+               } else if (Array.isArray(obj)) {
                        obj = obj.map(L.bind(function (it) {
                                return this._removeEmptyStrings(it);
                        }, this));
index b7b0b98dba6cd63cc3eeb9250a8b21ceb498b15d..36f7910f4bf15224c9548721034ccede918fbefe 100644 (file)
@@ -83,7 +83,7 @@ return network.registerProtocol('modemmanager', {
                o.value('mschapv2', 'MSCHAPv2');
                o.value('eap', 'EAP');
                o.value('', _('None'));
-               o.default = 'none';
+               o.default = '';
 
                o = s.taboption('general', form.ListValue, 'allowedmode', _('Allowed network technology'),
                        _('Setting the allowed network technology.'));
@@ -187,19 +187,11 @@ return network.registerProtocol('modemmanager', {
                o.default = '';
 
                o = s.taboption('general', form.Value, 'init_username', _('Initial EPS Bearer Username'));
-               o.depends('init_allowedauth', 'pap');
-               o.depends('init_allowedauth', 'chap');
-               o.depends('init_allowedauth', 'mschap');
-               o.depends('init_allowedauth', 'mschapv2');
-               o.depends('init_allowedauth', 'eap');
+               o.depends({'init_epsbearer': 'custom', 'init_allowedauth': '.+'});
                o.default = '';
 
                o = s.taboption('general', form.Value, 'init_password', _('Initial EPS Bearer Password'));
-               o.depends('init_allowedauth', 'pap');
-               o.depends('init_allowedauth', 'chap');
-               o.depends('init_allowedauth', 'mschap');
-               o.depends('init_allowedauth', 'mschapv2');
-               o.depends('init_allowedauth', 'eap');
+               o.depends({'init_epsbearer': 'custom', 'init_allowedauth': '.+'});
                o.default = '';
                o.password = true;
 
git clone https://git.99rst.org/PROJECT