From: Paul Donald Date: Tue, 26 May 2026 10:15:15 +0000 (+0300) Subject: luci-proto-modemmanager: correctness fixes X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=f4b13f51ef5a28c7c5e6f39516abe9eb46754724;p=openwrt-luci.git luci-proto-modemmanager: correctness fixes Signed-off-by: Paul Donald --- diff --git a/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/modemmanager_helper.js b/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/modemmanager_helper.js index b8558b885b..ceb78f8dfc 100644 --- a/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/modemmanager_helper.js +++ b/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/modemmanager_helper.js @@ -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)); diff --git a/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/protocol/modemmanager.js b/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/protocol/modemmanager.js index b7b0b98dba..36f7910f4b 100644 --- a/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/protocol/modemmanager.js +++ b/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/protocol/modemmanager.js @@ -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;