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

Use speed only for glorytun or if no values set for SQM/QoS

This commit is contained in:
Ycarus 2019-03-22 20:27:13 +01:00
parent 67e6cbd987
commit 9db2c461dc
2 changed files with 41 additions and 19 deletions

View file

@ -215,19 +215,25 @@ function wizard_add()
end
if downloadspeed ~= "0" and uploadspeed ~= "0" then
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,"download","0")
ucic:set("sqm",intf,"upload","0")
ucic:set("sqm",intf,"enabled","0")
ucic:set("qos",intf,"download","0")
ucic:set("qos",intf,"upload","0")
ucic:set("qos",intf,"enabled","0")
ucic:set("network",intf,"downloadspeed",downloadspeed)
ucic:set("network",intf,"uploadspeed",uploadspeed)
if ucic:get("sqm",intf,"download") == "" then
ucic:set("sqm",intf,"download",downloadspeed)
ucic:set("sqm",intf,"upload",uploadspeed)
--ucic:set("sqm",intf,"enabled","1")
end
if ucic:get("qos",intf,"download") == "" then
ucic:set("qos",intf,"download",downloadspeed)
ucic:set("qos",intf,"upload",uploadspeed)
--ucic:set("qos",intf,"enabled","1")
end
--else
-- ucic:set("sqm",intf,"download","0")
-- ucic:set("sqm",intf,"upload","0")
-- ucic:set("sqm",intf,"enabled","0")
-- ucic:set("qos",intf,"download","0")
-- ucic:set("qos",intf,"upload","0")
-- ucic:set("qos",intf,"enabled","0")
end
end
ucic:save("sqm")

View file

@ -292,12 +292,16 @@ end
<%
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")
download = uci:get("network",ifname,"downloadspeed")
upload = uci:get("network",ifname,"uploadspeed")
if download == "" or upload == "" then
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
end
%>
<div class="cbi-value" data-index="5">
@ -305,9 +309,15 @@ end
<div class="cbi-value-field">
<input type="text" name="cbid.sqm.<%=ifname%>.download" class="cbi-input-text" value="<%=download%>" data-type="uinteger">
<br />
<div class="cbi-value-description">
<%:Used by Glorytun UDP. 0 to use default value.%>
</div>
<!--
<br />
<div class="cbi-value-description">
<%:Set value between 80-95% of max download speed link. 0 to disable SQM/QoS.%>
</div>
-->
</div>
</div>
<div class="cbi-value" data-index="6">
@ -315,9 +325,15 @@ end
<div class="cbi-value-field">
<input type="text" name="cbid.sqm.<%=ifname%>.upload" class="cbi-input-text" value="<%=upload%>" data-type="uinteger">
<br />
<div class="cbi-value-description">
<%:Used by Glorytun UDP. 0 to use default value.%>
</div>
<!--
<br />
<div class="cbi-value-description">
<%:Set value between 80-95% of max upload speed link. 0 to disable SQM/QoS.%>
</div>
-->
</div>
</div>
</fieldset>