mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-14 19:41:51 +00:00
Add PPPoE proto
This commit is contained in:
parent
3350db0e99
commit
67b62e53ef
2 changed files with 61 additions and 5 deletions
|
@ -222,6 +222,11 @@ function wizard_add()
|
|||
local gateway = luci.http.formvalue("cbid.network.%s.gateway" % intf) or ""
|
||||
local apn = luci.http.formvalue("cbid.network.%s.apn" % intf) or ""
|
||||
local pincode = luci.http.formvalue("cbid.network.%s.pincode" % intf) or ""
|
||||
local delay = luci.http.formvalue("cbid.network.%s.delay" % intf) or ""
|
||||
local username = luci.http.formvalue("cbid.network.%s.username" % intf) or ""
|
||||
local password = luci.http.formvalue("cbid.network.%s.password" % intf) or ""
|
||||
local auth = luci.http.formvalue("cbid.network.%s.auth" % intf) or ""
|
||||
local mode = luci.http.formvalue("cbid.network.%s.mode" % intf) or ""
|
||||
local sqmenabled = luci.http.formvalue("cbid.sqm.%s.enabled" % intf) or "0"
|
||||
if typeintf == "normal" then
|
||||
typeintf = ""
|
||||
|
@ -240,7 +245,14 @@ function wizard_add()
|
|||
end
|
||||
ucic:set("network",intf,"apn",apn)
|
||||
ucic:set("network",intf,"pincode",pincode)
|
||||
ucic:set("network",intf,"delay",delay)
|
||||
ucic:set("network",intf,"username",username)
|
||||
ucic:set("network",intf,"password",password)
|
||||
ucic:set("network",intf,"auth",auth)
|
||||
ucic:set("network",intf,"mode",mode)
|
||||
ucic:set("network",intf,"label",label)
|
||||
ucic:set("network",intf,"defaultroute",0)
|
||||
ucic:set("network",intf,"peerdns",0)
|
||||
if ipaddr ~= "" then
|
||||
ucic:set("network",intf,"ipaddr",ipaddr)
|
||||
ucic:set("network",intf,"netmask",netmask)
|
||||
|
|
|
@ -69,7 +69,7 @@ end
|
|||
<div class="cbi-value-field">
|
||||
<input name="<%=servername%>.server_ip" id="<%=servername%>.server_ip" placeholder="<%:Server IP%>" class="cbi-input-text" value="<%=uci:get("openmptcprouter",servername,"ip")%>" data-optional="false">
|
||||
<div class="cbi-value-description">
|
||||
<%:Server IP will be set for ShadowSocks, Glorytun, OpenVPN and MLVPN%>
|
||||
<%:Server IP will be set for proxy and VPN%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -413,6 +413,7 @@ end
|
|||
<option id="cbid.network.<%=ifname%>.proto-dhcp" value="dhcp"<% if uci:get("network",ifname,"proto") == "dhcp" then findproto = 1 %> selected="selected"<% end %>><%:DHCP%></option>
|
||||
<option id="cbid.network.<%=ifname%>.proto-modemmanager" value="modemmanager"<% if uci:get("network",ifname,"proto") == "modemmanager" then findproto = 1 %> selected="selected"<% end %>><%:ModemManager%></option>
|
||||
<option id="cbid.network.<%=ifname%>.proto-ncm" value="ncm"<% if uci:get("network",ifname,"proto") == "ncm" then findproto = 1 %> selected="selected"<% end %>><%:NCM%></option>
|
||||
<option id="cbid.network.<%=ifname%>.proto-pppoe" value="pppoe"<% if uci:get("network",ifname,"proto") == "pppoe" then findproto = 1 %> selected="selected"<% end %>><%:PPPoE%></option>
|
||||
<option id="cbid.network.<%=ifname%>.proto-qmi" value="qmi"<% if uci:get("network",ifname,"proto") == "qmi" then findproto = 1 %> selected="selected"<% end %>><%:QMI%></option>
|
||||
<option id="cbid.network.<%=ifname%>.proto-other" value="other"<% if uci:get("network",ifname,"proto") ~= nil and findproto ~= "1" then %> selected="selected"<% end %>><%:Other%></option>
|
||||
</select>
|
||||
|
@ -561,6 +562,49 @@ end
|
|||
<input type="text" id="cbid.network.<%=ifname%>.pincode" name="cbid.network.<%=ifname%>.pincode" class="cbi-input-text" value="<%=uci:get("network",ifname,"pincode")%>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-mode" data-depends="[{"cbid.network.<%=ifname%>.proto":"ncm"}]" data-index="8">
|
||||
<label class="cbi-value-title"><%:Service Type%></label>
|
||||
<div class="cbi-value-field">
|
||||
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.mode" name="cbid.network.<%=ifname%>.mode" size="1">
|
||||
<option value=""<% if uci:get("network",ifname,"mode") == "" then %> selected="selected"<% end %>><%=Modem default%></option>
|
||||
<option value="preferlte"<% if uci:get("network",ifname,"auth") == "preferlte" then %> selected="selected"<% end %>><%=Prefer LTE%></option>
|
||||
<option value="preferumts"<% if uci:get("network",ifname,"auth") == "preferumts" then %> selected="selected"<% end %>><%=Prefer UMTS%></option>
|
||||
<option value="lte"<% if uci:get("network",ifname,"auth") == "lte" then %> selected="selected"<% end %>><%=LTE%></option>
|
||||
<option value="umts"<% if uci:get("network",ifname,"auth") == "umts" then %> selected="selected"<% end %>><%=UMTS/GPRS%></option>
|
||||
<option value="gsm"<% if uci:get("network",ifname,"auth") == "gsm" then %> selected="selected"<% end %>><%=GPRS only%></option>
|
||||
<option value="auto"<% if uci:get("network",ifname,"auth") == "auto" then %> selected="selected"<% end %>><%=auto%></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-auth" data-depends="[{"cbid.network.<%=ifname%>.proto":"qmi"},{"cbid.network.<%=ifname%>.proto":"pppoe"}]" data-index="9">
|
||||
<label class="cbi-value-title"><%:Authentication Type%></label>
|
||||
<div class="cbi-value-field">
|
||||
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.auth" name="cbid.network.<%=ifname%>.auth" size="1">
|
||||
<option value="none"<% if uci:get("network",ifname,"auth") == "none" then %> selected="selected"<% end %>><%=NONE%></option>
|
||||
<option value="pap"<% if uci:get("network",ifname,"auth") == "pap" then %> selected="selected"<% end %>><%=PAP%></option>
|
||||
<option value="chap"<% if uci:get("network",ifname,"auth") == "chap" then %> selected="selected"<% end %>><%=CHAP%></option>
|
||||
<option value="both"<% if uci:get("network",ifname,"auth") == "both" then %> selected="selected"<% end %>><%=PAP/CHAP%></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-username" data-depends="[{"cbid.network.<%=ifname%>.proto":"ncm"},{"cbid.network.<%=ifname%>.proto":"qmi"},{"cbid.network.<%=ifname%>.proto":"pppoe"}]" data-index="10">
|
||||
<label class="cbi-value-title"><%:PAP/CHAP username%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" id="cbid.network.<%=ifname%>.username" name="cbid.network.<%=ifname%>.username" class="cbi-input-text" value="<%=uci:get("network",ifname,"username")%>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-password" data-depends="[{"cbid.network.<%=ifname%>.proto":"ncm"},{"cbid.network.<%=ifname%>.proto":"qmi"},{"cbid.network.<%=ifname%>.proto":"pppoe"}]" data-index="11">
|
||||
<label class="cbi-value-title"><%:PAP/CHAP password%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" id="cbid.network.<%=ifname%>.password" name="cbid.network.<%=ifname%>.password" class="cbi-input-text" value="<%=uci:get("network",ifname,"password")%>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-delay" data-depends="[{"cbid.network.<%=ifname%>.proto":"ncm"},{"cbid.network.<%=ifname%>.proto":"qmi"}]" data-index="12">
|
||||
<label class="cbi-value-title"><%:Modem init timeout%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" id="cbid.network.<%=ifname%>.delay" name="cbid.network.<%=ifname%>.delay" class="cbi-input-text" value="<%=uci:get("network",ifname,"delay")%>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%
|
||||
local download = "0"
|
||||
|
@ -577,7 +621,7 @@ end
|
|||
end
|
||||
end
|
||||
%>
|
||||
<div class="cbi-value" data-index="8">
|
||||
<div class="cbi-value" data-index="13">
|
||||
<label class="cbi-value-title"><%:MPTCP over VPN%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input class="cbi-input-checkbox" type="checkbox" name="multipathvpn.<%=ifname%>.enabled" value="1" <% if uci:get("openmptcprouter",ifname,"multipathvpn") == "1" then %>checked<% end %> />
|
||||
|
@ -587,7 +631,7 @@ end
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" data-index="9">
|
||||
<div class="cbi-value" data-index="14">
|
||||
<label class="cbi-value-title"><%:Enable SQM%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input class="cbi-input-checkbox" type="checkbox" name="cbid.sqm.<%=ifname%>.enabled" value="1" <% if uci:get("sqm",ifname,"enabled") == "1" then %>checked<% end %> />
|
||||
|
@ -597,7 +641,7 @@ end
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" data-index="10">
|
||||
<div class="cbi-value" data-index="15">
|
||||
<label class="cbi-value-title"><%:Download speed (Kb/s)%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" name="cbid.sqm.<%=ifname%>.download" class="cbi-input-text" value="<%=download%>" data-type="uinteger">
|
||||
|
@ -613,7 +657,7 @@ end
|
|||
-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" data-index="11">
|
||||
<div class="cbi-value" data-index="16">
|
||||
<label class="cbi-value-title"><%:Upload speed (Kb/s)%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" name="cbid.sqm.<%=ifname%>.upload" class="cbi-input-text" value="<%=upload%>" data-type="uinteger">
|
||||
|
|
Loading…
Reference in a new issue