mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix checkbox for SQM
This commit is contained in:
parent
f28313e61d
commit
c9192c9522
2 changed files with 7 additions and 6 deletions
|
@ -1,9 +1,10 @@
|
||||||
|
local math = require "math"
|
||||||
local tools = require "luci.tools.status"
|
local tools = require "luci.tools.status"
|
||||||
local sys = require "luci.sys"
|
local sys = require "luci.sys"
|
||||||
local json = require("luci.json")
|
local json = require("luci.json")
|
||||||
local fs = require("nixio.fs")
|
local fs = require("nixio.fs")
|
||||||
local net = require "luci.model.network".init()
|
local net = require "luci.model.network".init()
|
||||||
local ucic = luci.model.uci.cursor()
|
local ucic = luci.model.uci.cursor()
|
||||||
module("luci.controller.openmptcprouter", package.seeall)
|
module("luci.controller.openmptcprouter", package.seeall)
|
||||||
|
|
||||||
function index()
|
function index()
|
||||||
|
@ -219,15 +220,15 @@ function wizard_add()
|
||||||
if downloadspeed ~= "0" and uploadspeed ~= "0" then
|
if downloadspeed ~= "0" and uploadspeed ~= "0" then
|
||||||
ucic:set("network",intf,"downloadspeed",downloadspeed)
|
ucic:set("network",intf,"downloadspeed",downloadspeed)
|
||||||
ucic:set("network",intf,"uploadspeed",uploadspeed)
|
ucic:set("network",intf,"uploadspeed",uploadspeed)
|
||||||
ucic:set("sqm",intf,"download",downloadspeed*95/100)
|
ucic:set("sqm",intf,"download",math.ceil(downloadspeed*95/100))
|
||||||
ucic:set("sqm",intf,"upload",uploadspeed*95/100)
|
ucic:set("sqm",intf,"upload",math.ceil(uploadspeed*95/100))
|
||||||
if sqmenabled == "1" then
|
if sqmenabled == "1" then
|
||||||
ucic:set("sqm",intf,"enabled","1")
|
ucic:set("sqm",intf,"enabled","1")
|
||||||
else
|
else
|
||||||
ucic:set("sqm",intf,"enabled","0")
|
ucic:set("sqm",intf,"enabled","0")
|
||||||
end
|
end
|
||||||
ucic:set("qos",intf,"download",downloadspeed*95/100)
|
ucic:set("qos",intf,"download",math.ceil(downloadspeed*95/100))
|
||||||
ucic:set("qos",intf,"upload",uploadspeed*95/100)
|
ucic:set("qos",intf,"upload",math.ceil(uploadspeed*95/100))
|
||||||
if sqmenabled == "1" then
|
if sqmenabled == "1" then
|
||||||
ucic:set("qos",intf,"enabled","1")
|
ucic:set("qos",intf,"enabled","1")
|
||||||
else
|
else
|
||||||
|
|
|
@ -307,7 +307,7 @@ end
|
||||||
<div class="cbi-value" data-index="5">
|
<div class="cbi-value" data-index="5">
|
||||||
<label class="cbi-value-title"><%:Enable SQM%></label>
|
<label class="cbi-value-title"><%:Enable SQM%></label>
|
||||||
<div class="cbi-value-field">
|
<div class="cbi-value-field">
|
||||||
<input class="cbi-input-checkbox" type="checkbox" name="sqmenabled" value="1" <% if uci:get("sqm",ifname,"enabled") == 1 then %>checked<% end %> />
|
<input class="cbi-input-checkbox" type="checkbox" name="cbid.sqm.enabled" value="1" <% if uci:get("sqm",ifname,"enabled") == 1 then %>checked<% end %> />
|
||||||
<br />
|
<br />
|
||||||
<div class="cbi-value-description">
|
<div class="cbi-value-description">
|
||||||
<%:You should disable SQM for LTE or any interfaces with variable speed.%>
|
<%:You should disable SQM for LTE or any interfaces with variable speed.%>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue