1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Add QoS support in wizard

This commit is contained in:
Ycarus (Yannick Chabanois) 2022-05-28 08:36:44 +02:00
parent 97abaf3d32
commit 902d16b334
2 changed files with 74 additions and 51 deletions

View file

@ -9,6 +9,8 @@
local ifaces = sys.net:devices()
local ifttyu = nixio.fs.glob("/dev/ttyUSB*")
local ifttyc = nixio.fs.glob("/dev/cdc-wdm*")
local sqm = luci.sys.exec("opkg list-installed | grep -q luci-app-sqm && echo -n '1' || echo -n '0'")
local qos = luci.sys.exec("opkg list-installed | grep -q luci-app-qos && echo -n '1' || echo -n '0'")
menuentry = uci:get("openmptcprouter","settings","menu") or "openmptcprouter"
function device_notvirtual(dev)
if dev:match("^eth.*") or dev:match("^wwan.*") or dev:match("^tun.*") or dev:match("/") then
@ -932,16 +934,39 @@
</div>
</div>
</div>
<%
if sqm == "1" then
%>
<div class="cbi-value" data-index="16">
<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 %> />
<br />
<div class="cbi-value-description">
<%:SQM control bufferloat: the undesirable latency that arises when the router buffers too much data.%>
<%:You should disable SQM for LTE or any interfaces with variable speed.%>
</div>
</div>
</div>
<%
end
%>
<%
if qos == "1" then
%>
<div class="cbi-value" data-index="16">
<label class="cbi-value-title"><%:Enable QoS%></label>
<div class="cbi-value-field">
<input class="cbi-input-checkbox" type="checkbox" name="cbid.qos.<%=ifname%>.enabled" value="1" <% if uci:get("qos",ifname,"enabled") == "1" then %>checked<% end %> />
<br />
<div class="cbi-value-description">
<%:QoS permit to prioritize any upload traffic.%>
</div>
</div>
</div>
<%
end
%>
<div class="cbi-value" data-index="17">
<label class="cbi-value-title"><%:Download speed (Kb/s)%></label>
<div class="cbi-value-field">