1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-14 19:41:51 +00:00

Fix device in wizard for qmi, ncm and modemmanager

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-11-09 15:18:59 +01:00
parent ebc63b30e4
commit 82f1f670d1
2 changed files with 15 additions and 9 deletions

View file

@ -218,7 +218,9 @@ function wizard_add()
local typeintf = luci.http.formvalue("cbid.network.%s.type" % intf) or ""
local masterintf = luci.http.formvalue("cbid.network.%s.masterintf" % intf) or ""
local ifname = luci.http.formvalue("cbid.network.%s.intf" % intf) or ""
local device = luci.http.formvalue("cbid.network.%s.device" % intf) or ""
local device_ncm = luci.http.formvalue("cbid.network.%s.device.ncm" % intf) or ""
local device_qmi = luci.http.formvalue("cbid.network.%s.device.qmi" % intf) or ""
local device_modemmanager = luci.http.formvalue("cbid.network.%s.device.modemmanager" % intf) or ""
local ipaddr = luci.http.formvalue("cbid.network.%s.ipaddr" % intf) or ""
local netmask = luci.http.formvalue("cbid.network.%s.netmask" % intf) or ""
local gateway = luci.http.formvalue("cbid.network.%s.gateway" % intf) or ""
@ -243,8 +245,12 @@ function wizard_add()
ucic:set("network",intf,"masterintf",masterintf)
elseif typeintf == "" and ifname ~= "" and (proto == "static" or proto == "dhcp" ) then
ucic:set("network",intf,"ifname",ifname)
elseif typeintf == "" and device ~= "" and (proto == "ncm" or proto == "qmi" or proto == "modemmanager") then
ucic:set("network",intf,"device",device)
elseif typeintf == "" and device ~= "" and proto == "ncm" then
ucic:set("network",intf,"device",device_ncm)
elseif typeintf == "" and device ~= "" and proto == "qmi" then
ucic:set("network",intf,"device",device_qmi)
elseif typeintf == "" and device ~= "" and proto == "modemmanager" then
ucic:set("network",intf,"device",device_manager)
end
if proto ~= "other" then
ucic:set("network",intf,"proto",proto)

View file

@ -572,10 +572,10 @@
</div>
</div>
</div>
<div class="cbi-value" id="cbi-network-<%=ifname%>-device" data-depends="[{&#34;cbid.network.<%=ifname%>.proto&#34;:&#34;ncm&#34;}]" data-index="5">
<div class="cbi-value" id="cbi-network-<%=ifname%>-device-ncm" data-depends="[{&#34;cbid.network.<%=ifname%>.proto&#34;:&#34;ncm&#34;}]" data-index="5">
<label class="cbi-value-title"><%:Device%></label>
<div class="cbi-value-field">
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.device" name="cbid.network.<%=ifname%>.device" size="1">
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.device.ncm" name="cbid.network.<%=ifname%>.device.ncm" size="1">
<%
iffind=0
iftty = nixio.fs.glob("/dev/ttyUSB*")
@ -599,10 +599,10 @@
</select>
</div>
</div>
<div class="cbi-value" id="cbi-network-<%=ifname%>-device" data-depends="[{&#34;cbid.network.<%=ifname%>.proto&#34;:&#34;qmi&#34;}]" data-index="5">
<div class="cbi-value" id="cbi-network-<%=ifname%>-device-qmi" data-depends="[{&#34;cbid.network.<%=ifname%>.proto&#34;:&#34;qmi&#34;}]" data-index="5">
<label class="cbi-value-title"><%:Device%></label>
<div class="cbi-value-field">
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.device" name="cbid.network.<%=ifname%>.device" size="1">
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.device.qmi" name="cbid.network.<%=ifname%>.device.qmi" size="1">
<%
iffind=0
iftty = nixio.fs.glob("/dev/cdc-wdm*")
@ -620,10 +620,10 @@
</select>
</div>
</div>
<div class="cbi-value" id="cbi-network-<%=ifname%>-device" data-depends="[{&#34;cbid.network.<%=ifname%>.proto&#34;:&#34;modemmanager&#34;}]" data-index="5">
<div class="cbi-value" id="cbi-network-<%=ifname%>-device-modemmanager" data-depends="[{&#34;cbid.network.<%=ifname%>.proto&#34;:&#34;modemmanager&#34;}]" data-index="5">
<label class="cbi-value-title"><%:Device%></label>
<div class="cbi-value-field">
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.device" name="cbid.network.<%=ifname%>.device" size="1">
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.device.modemmanager" name="cbid.network.<%=ifname%>.device.modemmanager" size="1">
<%
iffind=0
iftty = luci.sys.exec("/usr/bin/mmcli -L")