From af2c89c91106334bf8d2b433d93790f4e8ecb0af Mon Sep 17 00:00:00 2001 From: Michael Pfeifroth Date: Fri, 2 Oct 2026 09:24:29 +0200 Subject: [PATCH] luci-proto-modemmanager: rework initial EPS bearer modes Follow the rework of the 'init_epsbearer' modes in the modemmanager package: - modem: Leave unchanged (stored on modem), the new default - network: Network-assigned - connection: Same as connection (was 'default') - custom: Custom The LuCI value 'none' was stored as an empty option, which since modemmanager commit 246506690f2d clears the initial EPS bearer instead of leaving it untouched as described. Store 'modem' explicitly instead. The legacy values 'none' and 'default' are shown as 'modem' and 'connection'. Link: https://github.com/openwrt/packages/issues/30299 Signed-off-by: Michael Pfeifroth --- .../resources/protocol/modemmanager.js | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) 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 6275a7999c..b33399076a 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 @@ -164,13 +164,28 @@ return network.registerProtocol('modemmanager', { o.default = 'ERR'; o = s.taboption('general', form.ListValue, 'init_epsbearer', _('Initial EPS Bearer'), - _('none: Do not set an initial EPS bearer (default behaviour)') + '
' + - _('default: Use the configuration options above (APN, IP Type, ...).') + '
' + - _('custom: Use different options when establishing a connection (these options are prefixed with %s).').format('init_')); - o.value('', _('none')); - o.value('default', 'default'); - o.value('custom', 'custom'); - o.default = ''; + _('Settings used when attaching to the 4G/5G network, before the data connection is established.') + '
' + + _('Leave unchanged: Keep the settings stored on the modem.') + '
' + + _('Network-assigned: Clear the settings stored on the modem, the network assigns the APN.') + '
' + + _('Same as connection: Use the configuration options above (APN, IP Type, ...).') + '
' + + _('Custom: Use different options (these options are prefixed with %s).').format('init_')); + o.value('modem', _('Leave unchanged (stored on modem)')); + o.value('network', _('Network-assigned')); + o.value('connection', _('Same as connection')); + o.value('custom', _('Custom')); + o.default = 'modem'; + o.load = function(section_id) { + const value = form.ListValue.prototype.load.apply(this, [section_id]); + + switch (value) { + case 'none': + return 'modem'; + case 'default': + return 'connection'; + default: + return value; + } + }; o = s.taboption('general', form.Value, 'init_apn', _('Initial EPS Bearer APN')); o.depends('init_epsbearer', 'custom');