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

Fix typo and QoS speed limit set like sqm speed limit in wizard

This commit is contained in:
Ycarus 2018-08-20 14:02:56 +02:00
parent bad27cdf58
commit 89bd189478
2 changed files with 21 additions and 10 deletions

View file

@ -84,12 +84,18 @@ function wizard_add()
ucic:set("sqm",intf,"download",downloadspeed)
ucic:set("sqm",intf,"upload",uploadspeed)
ucic:set("sqm",intf,"enabled","1")
ucic:set("qos",intf,"download",downloadspeed)
ucic:set("qos",intf,"upload",uploadspeed)
ucic:set("qos",intf,"enabled","1")
else
ucic:set("sqm",intf,"enabled","0")
ucic:set("qos",intf,"enabled","0")
end
end
ucic:save("sqm")
ucic:commit("sqm")
ucic:save("qos")
ucic:commit("qos")
ucic:save("network")
ucic:commit("network")
@ -97,7 +103,7 @@ function wizard_add()
local disable_ipv6 = "0"
local enable_ipv6 = luci.http.formvalue("enableipv6") or "1"
if enable_ipv6 == "0" then
disable_pv6 = "1"
disable_ipv6 = "1"
end
set_ipv6_state(disable_ipv6)
@ -576,7 +582,7 @@ function interfaces_status()
uci:foreach("network", "interface", function (section)
local interface = section[".name"]
local net = ntm:get_network(interface)
local ipaddr = net:ipaddr()
local ipaddr = net:ipaddr() or ""
local gateway = section["gateway"] or ""
local multipath = section["multipath"]
local enabled = section["auto"]

View file

@ -167,31 +167,36 @@
</div>
</div>
<%
if nixio.fs.access("/etc/init.d/sqm") then
local download = ""
local upload = ""
if nixio.fs.access("/etc/init.d/sqm") then
download = uci:get("sqm",ifname,"download")
upload = uci:get("sqm",ifname,"upload")
else
download = uci:get("qos",ifname,"download")
upload = uci:get("qos",ifname,"upload")
end
%>
<div class="cbi-value">
<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="<%=uci:get("sqm",ifname,"download")%>" data-type="uinteger">
<input type="text" name="cbid.sqm.<%=ifname%>.download" class="cbi-input-text" value="<%=download%>" data-type="uinteger">
<br />
<div class="cbi-value-description">
<%:Set value between 80-95% of max download speed link. Used for SQM. Empty to disable.%>
<%:Set value between 80-95% of max download speed link. Empty to disable.%>
</div>
</div>
</div>
<div class="cbi-value">
<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="<%=uci:get("sqm",ifname,"upload")%>" data-type="uinteger">
<input type="text" name="cbid.sqm.<%=ifname%>.upload" class="cbi-input-text" value="<%=upload%>" data-type="uinteger">
<br />
<div class="cbi-value-description">
<%:Set value between 80-95% of max upload speed link. Used for SQM. Empty to disable.%>
<%:Set value between 80-95% of max upload speed link. Empty to disable.%>
</div>
</div>
</div>
<%
end
%>
</fieldset>
<%
end