From 9db2c461dcb90b80bc653f18318a8d9c0e666e93 Mon Sep 17 00:00:00 2001 From: Ycarus Date: Fri, 22 Mar 2019 20:27:13 +0100 Subject: [PATCH] Use speed only for glorytun or if no values set for SQM/QoS --- .../luasrc/controller/openmptcprouter.lua | 32 +++++++++++-------- .../luasrc/view/openmptcprouter/wizard.htm | 28 ++++++++++++---- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index f7b1ca01f..3f224a222 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -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") diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index 99dbd5923..3f8be81e9 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -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 %>
@@ -305,9 +309,15 @@ end

+
+ <%:Used by Glorytun UDP. 0 to use default value.%> +
+
@@ -315,9 +325,15 @@ end

+
+ <%:Used by Glorytun UDP. 0 to use default value.%> +
+