diff options
Diffstat (limited to 'applications/luci-app-nft-qos')
-rw-r--r-- | applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua | 241 | ||||
-rw-r--r-- | applications/luci-app-nft-qos/po/pl/nft-qos.po | 6 |
2 files changed, 147 insertions, 100 deletions
diff --git a/applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua b/applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua index 6f67a6110b..b089433d9b 100644 --- a/applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua +++ b/applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua @@ -15,6 +15,7 @@ local def_up = uci:get("nft-qos", "default", "dynamic_bw_up") local def_down = uci:get("nft-qos", "default", "dynamic_bw_down") local limit_enable = uci:get("nft-qos", "default", "limit_enable") +local limit_mac_enable = uci:get("nft-qos", "default", "limit_mac_enable") local limit_type = uci:get("nft-qos", "default", "limit_type") local enable_priority = uci:get("nft-qos", "default", "priority_enable") @@ -29,7 +30,8 @@ s = m:section(TypedSection, "default", translate("NFT-QoS Settings")) s.addremove = false s.anonymous = true -s:tab("limit", "Limit Rate") +s:tab("limit", "Limit Rate by IP Address") +s:tab("limitmac", "Limit Rate by Mac Address") s:tab("priority", "Traffic Priority") -- @@ -113,116 +115,161 @@ wa.cbi_add_networks(o) -- if limit_enable == "1" and limit_type == "static" then -x = m:section(TypedSection, "download", translate("Static QoS-Download Rate")) -x.anonymous = true -x.addremove = true -x.template = "cbi/tblsection" - -o = x:option(Value, "hostname", translate("Hostname")) -o.datatype = "hostname" -o.default = 'undefined' - -if has_ipv6 then - o = x:option(Value, "ipaddr", translate("IP Address (v4 / v6)")) -else - o = x:option(Value, "ipaddr", translate("IP Address (v4 Only)")) -end -o.datatype = "ipaddr" -if nixio.fs.access("/tmp/dhcp.leases") or nixio.fs.access("/var/dhcp6.leases") then - o.titleref = luci.dispatcher.build_url("admin", "status", "overview") -end - -o = x:option(Value, "macaddr", translate("MAC (optional)")) -o.rmempty = true -o.datatype = "macaddr" - -o = x:option(Value, "rate", translate("Rate")) -o.default = def_rate_dl or '50' -o.size = 4 -o.datatype = "uinteger" - -o = x:option(ListValue, "unit", translate("Unit")) -o.default = def_unit_dl or "kbytes" -o:value("bytes", "Bytes/s") -o:value("kbytes", "KBytes/s") -o:value("mbytes", "MBytes/s") + x = m:section(TypedSection, "download", translate("Static QoS-Download Rate")) + x.anonymous = true + x.addremove = true + x.template = "cbi/tblsection" + + o = x:option(Value, "hostname", translate("Hostname")) + o.datatype = "hostname" + o.default = 'undefined' + + if has_ipv6 then + o = x:option(Value, "ipaddr", translate("IP Address (v4 / v6)")) + else + o = x:option(Value, "ipaddr", translate("IP Address (v4 Only)")) + end + o.datatype = "ipaddr" + if nixio.fs.access("/tmp/dhcp.leases") or nixio.fs.access("/var/dhcp6.leases") then + o.titleref = luci.dispatcher.build_url("admin", "status", "overview") + end + + o = x:option(Value, "rate", translate("Rate")) + o.default = def_rate_dl or '50' + o.size = 4 + o.datatype = "uinteger" + + o = x:option(ListValue, "unit", translate("Unit")) + o.default = def_unit_dl or "kbytes" + o:value("bytes", "Bytes/s") + o:value("kbytes", "KBytes/s") + o:value("mbytes", "MBytes/s") -- -- Static Limit Rate - Upload Rate -- -y = m:section(TypedSection, "upload", translate("Static QoS-Upload Rate")) -y.anonymous = true -y.addremove = true -y.template = "cbi/tblsection" - -o = y:option(Value, "hostname", translate("Hostname")) -o.datatype = "hostname" -o.default = 'undefined' + y = m:section(TypedSection, "upload", translate("Static QoS-Upload Rate")) + y.anonymous = true + y.addremove = true + y.template = "cbi/tblsection" + + o = y:option(Value, "hostname", translate("Hostname")) + o.datatype = "hostname" + o.default = 'undefined' + + if has_ipv6 then + o = y:option(Value, "ipaddr", translate("IP Address (v4 / v6)")) + else + o = y:option(Value, "ipaddr", translate("IP Address (v4 Only)")) + end + o.datatype = "ipaddr" + if nixio.fs.access("/tmp/dhcp.leases") or nixio.fs.access("/var/dhcp6.leases") then + o.titleref = luci.dispatcher.build_url("admin", "status", "overview") + end + + o = y:option(Value, "macaddr", translate("MAC (optional)")) + o.rmempty = true + o.datatype = "macaddr" + + o = y:option(Value, "rate", translate("Rate")) + o.default = def_rate_ul or '50' + o.size = 4 + o.datatype = "uinteger" + + o = y:option(ListValue, "unit", translate("Unit")) + o.default = def_unit_ul or "kbytes" + o:value("bytes", "Bytes/s") + o:value("kbytes", "KBytes/s") + o:value("mbytes", "MBytes/s") -if has_ipv6 then - o = y:option(Value, "ipaddr", translate("IP Address (v4 / v6)")) -else - o = y:option(Value, "ipaddr", translate("IP Address (v4 Only)")) -end -o.datatype = "ipaddr" -if nixio.fs.access("/tmp/dhcp.leases") or nixio.fs.access("/var/dhcp6.leases") then - o.titleref = luci.dispatcher.build_url("admin", "status", "overview") end -o = y:option(Value, "macaddr", translate("MAC (optional)")) -o.rmempty = true -o.datatype = "macaddr" - -o = y:option(Value, "rate", translate("Rate")) -o.default = def_rate_ul or '50' -o.size = 4 -o.datatype = "uinteger" +-- +-- Traffic Priority Settings +-- +if enable_priority == "1" then -o = y:option(ListValue, "unit", translate("Unit")) -o.default = def_unit_ul or "kbytes" -o:value("bytes", "Bytes/s") -o:value("kbytes", "KBytes/s") -o:value("mbytes", "MBytes/s") + s = m:section(TypedSection, "priority", translate("Traffic Priority Settings")) + s.anonymous = true + s.addremove = true + s.template = "cbi/tblsection" + + o = s:option(ListValue, "protocol", translate("Protocol")) + o.default = "tcp" + o:value("tcp", "TCP") + o:value("udp", "UDP") + o:value("udplite", "UDP-Lite") + o:value("sctp", "SCTP") + o:value("dccp", "DCCP") + + o = s:option(ListValue, "priority", translate("Priority")) + o.default = "1" + o:value("-400", "1") + o:value("-300", "2") + o:value("-225", "3") + o:value("-200", "4") + o:value("-150", "5") + o:value("-100", "6") + o:value("0", "7") + o:value("50", "8") + o:value("100", "9") + o:value("225", "10") + o:value("300", "11") + + o = s:option(Value, "service", translate("Service"), translate("e.g. https, 23, (separator is comma)")) + o.default = '?' + + o = s:option(Value, "comment", translate("Comment")) + o.default = '?' end -- --- Traffic Priority Settings +-- limit speed by mac address -- -if enable_priority == "1" then +o = s:taboption("limitmac", Flag, "limit_mac_enable", translate("Limit Enable"), translate("Enable Limit Rate Feature")) +o.default = limit_mac_enable or o.enabled +o.rmempty = false -s = m:section(TypedSection, "priority", translate("Traffic Priority Settings")) -s.anonymous = true -s.addremove = true -s.template = "cbi/tblsection" - -o = s:option(ListValue, "protocol", translate("Protocol")) -o.default = "tcp" -o:value("tcp", "TCP") -o:value("udp", "UDP") -o:value("udplite", "UDP-Lite") -o:value("sctp", "SCTP") -o:value("dccp", "DCCP") - -o = s:option(ListValue, "priority", translate("Priority")) -o.default = "1" -o:value("-400", "1") -o:value("-300", "2") -o:value("-225", "3") -o:value("-200", "4") -o:value("-150", "5") -o:value("-100", "6") -o:value("0", "7") -o:value("50", "8") -o:value("100", "9") -o:value("225", "10") -o:value("300", "11") - -o = s:option(Value, "service", translate("Service"), translate("e.g. https, 23, (separator is comma)")) -o.default = '?' - -o = s:option(Value, "comment", translate("Comment")) -o.default = '?' +-- +-- Static By Mac Address +-- +if limit_mac_enable == "1" then + + x = m:section(TypedSection, "client", translate("Limit Traffic Rate By Mac Address")) + x.anonymous = true + x.addremove = true + x.template = "cbi/tblsection" + + o = x:option(Value, "hostname", translate("Hostname")) + o.datatype = "hostname" + o.default = '' + + o = x:option(Value, "macaddr", translate("MAC Address")) + o.rmempty = true + o.datatype = "macaddr" + + o = x:option(Value, "drate", translate("Download Rate")) + o.default = def_rate_dl or '50' + o.size = 4 + o.datatype = "uinteger" + + o = x:option(ListValue, "drunit", translate("Unit")) + o.default = def_unit_dl or "kbytes" + o:value("bytes", "Bytes/s") + o:value("kbytes", "KBytes/s") + o:value("mbytes", "MBytes/s") + + o = x:option(Value, "urate", translate("Upload Rate")) + o.default = def_rate_ul or '50' + o.size = 4 + o.datatype = "uinteger" + + o = x:option(ListValue, "urunit", translate("Unit")) + o.default = def_unit_ul or "kbytes" + o:value("bytes", "Bytes/s") + o:value("kbytes", "KBytes/s") + o:value("mbytes", "MBytes/s") end diff --git a/applications/luci-app-nft-qos/po/pl/nft-qos.po b/applications/luci-app-nft-qos/po/pl/nft-qos.po index 42a259661c..231a754c55 100644 --- a/applications/luci-app-nft-qos/po/pl/nft-qos.po +++ b/applications/luci-app-nft-qos/po/pl/nft-qos.po @@ -1,6 +1,6 @@ msgid "" msgstr "" -"PO-Revision-Date: 2020-05-02 15:56+0000\n" +"PO-Revision-Date: 2020-08-18 20:32+0000\n" "Last-Translator: Marcin Net <marcin.net@linux.pl>\n" "Language-Team: Polish <https://hosted.weblate.org/projects/openwrt/" "luciapplicationsnft-qos/pl/>\n" @@ -9,7 +9,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.1-dev\n" +"X-Generator: Weblate 4.2-dev\n" #: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:136 #: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:155 @@ -79,7 +79,7 @@ msgstr "Szybkość pobierania" #: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 msgid "Enable Limit Rate Feature" -msgstr "Włączyć funkcję limitu prędkości" +msgstr "Włącz funkcję limitu prędkości" #: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 msgid "Enable Traffic Priority" |