summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-qos
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-07-17 16:02:29 +0000
committerSteven Barth <steven@midlink.org>2008-07-17 16:02:29 +0000
commit52d49762ed28033d82e5ab1e0ccf65ad74a4b593 (patch)
tree61ba5cc4a6a1cebfff038e815bea7f001fab305a /applications/luci-qos
parent8d1aff78b17d6f7437d776bdf53a6aa2112f31db (diff)
applications/luci-qos: Smaller enhancements, support for luci-mini
applications/luci-fw: Fixed support for luci-mini libs/web: Removed luci.dispatcher.registered
Diffstat (limited to 'applications/luci-qos')
-rw-r--r--applications/luci-qos/luasrc/controller/qos.lua9
-rw-r--r--applications/luci-qos/luasrc/i18n/qos.de.lua10
-rw-r--r--applications/luci-qos/luasrc/i18n/qos.en.lua10
-rw-r--r--applications/luci-qos/luasrc/model/cbi/qos/qos.lua21
-rw-r--r--applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua70
5 files changed, 108 insertions, 12 deletions
diff --git a/applications/luci-qos/luasrc/controller/qos.lua b/applications/luci-qos/luasrc/controller/qos.lua
index 581706091..0222806bb 100644
--- a/applications/luci-qos/luasrc/controller/qos.lua
+++ b/applications/luci-qos/luasrc/controller/qos.lua
@@ -18,5 +18,12 @@ function index()
return
end
- entry({"admin", "network", "qos"}, cbi("qos/qos"), "QoS").i18n = "qos"
+ local page = entry({"admin", "network", "qos"}, cbi("qos/qos"), "QoS")
+ page.i18n = "qos"
+ page.dependent = true
+
+
+ local page = entry({"mini", "network", "qos"}, cbi("qos/qosmini"), "QoS")
+ page.i18n = "qos"
+ page.dependent = true
end \ No newline at end of file
diff --git a/applications/luci-qos/luasrc/i18n/qos.de.lua b/applications/luci-qos/luasrc/i18n/qos.de.lua
index 0bfa588a3..e24dbaa2c 100644
--- a/applications/luci-qos/luasrc/i18n/qos.de.lua
+++ b/applications/luci-qos/luasrc/i18n/qos.de.lua
@@ -5,10 +5,14 @@ qos_interface_classgroup = "Klassifizierung"
qos_interface_overhead = "Overheadberechnung"
qos_interface_download = "Downlink"
qos_interface_upload = "Uplink"
-qos_classify = "Klassifizierung"
-qos_classify_target = "Klasse"
+qos_classify = "Priorisierung"
+qos_classify_target = "Priorität"
qos_classify_srchost = "Quelladresse"
qos_classify_srchost_dest = "Quellnetz / Quellhost"
qos_classify_dsthost = "Zieladresse"
qos_classify_dsthost_dest = "Zielnetz / Zielhost"
-qos_classify_portrange = "Portbereich" \ No newline at end of file
+qos_classify_portrange = "Portbereich"
+qos_bulk = "niedrig"
+qos_normal = "normal"
+qos_express = "express"
+qos_priority = "priorisiert" \ No newline at end of file
diff --git a/applications/luci-qos/luasrc/i18n/qos.en.lua b/applications/luci-qos/luasrc/i18n/qos.en.lua
index bd55862c0..eefa95595 100644
--- a/applications/luci-qos/luasrc/i18n/qos.en.lua
+++ b/applications/luci-qos/luasrc/i18n/qos.en.lua
@@ -4,10 +4,14 @@ qos_interface_classgroup = "Classification"
qos_interface_overhead = "Calculate Overhead"
qos_interface_download = "Downlink"
qos_interface_upload = "Uplink"
-qos_classify = "Classification"
-qos_classify_target = "Class"
+qos_classify = "Prioritization"
+qos_classify_target = "Priority"
qos_classify_srchost = "Source address"
qos_classify_srchost_dest = "source network / source host"
qos_classify_dsthost = "Target address"
qos_classify_dsthost_dest = "target network / target host"
-qos_classify_portrange = "portrange" \ No newline at end of file
+qos_classify_portrange = "portrange"
+qos_bulk = "low"
+qos_normal = "normal"
+qos_express = "express"
+qos_priority = "priority" \ No newline at end of file
diff --git a/applications/luci-qos/luasrc/model/cbi/qos/qos.lua b/applications/luci-qos/luasrc/model/cbi/qos/qos.lua
index ea535cea2..0bb559ede 100644
--- a/applications/luci-qos/luasrc/model/cbi/qos/qos.lua
+++ b/applications/luci-qos/luasrc/model/cbi/qos/qos.lua
@@ -34,15 +34,26 @@ s.anonymous = true
s.addremove = true
t = s:option(ListValue, "target")
-t:value("Priority")
-t:value("Express")
-t:value("Normal")
-t:value("Bulk")
+t:value("Priority", translate("qos_priority"))
+t:value("Express", translate("qos_express"))
+t:value("Normal", translate("qos_normal"))
+t:value("Bulk", translate("qos_bulk"))
t.default = "Normal"
s:option(Value, "srchost").optional = true
s:option(Value, "dsthost").optional = true
-s:option(Value, "layer7", "Layer 7").optional = true
+
+l7 = s:option(ListValue, "layer7", translate("service"))
+l7.optional = true
+l7:value("")
+local pats = luci.fs.dir("/etc/l7-protocols")
+if pats then
+ for i,f in ipairs(pats) do
+ if f:sub(-4) == ".pat" then
+ l7:value(f:sub(1, #f-4))
+ end
+ end
+end
p2p = s:option(ListValue, "ipp2p", "P2P")
p2p:value("")
diff --git a/applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua b/applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua
new file mode 100644
index 000000000..db6fa9c6b
--- /dev/null
+++ b/applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua
@@ -0,0 +1,70 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+m = Map("qos")
+
+s = m:section(NamedSection, "wan", "interface", translate("m_n_inet"))
+
+s:option(Flag, "enabled", translate("qos"))
+s:option(Value, "download", translate("qos_interface_download"), "kb/s")
+s:option(Value, "upload", translate("qos_interface_upload"), "kb/s")
+
+s = m:section(TypedSection, "classify")
+
+s.anonymous = true
+s.addremove = true
+
+t = s:option(ListValue, "target")
+t:value("Priority", translate("qos_priority"))
+t:value("Express", translate("qos_express"))
+t:value("Normal", translate("qos_normal"))
+t:value("Bulk", translate("qos_bulk"))
+t.default = "Normal"
+
+s:option(Value, "srchost").optional = true
+s:option(Value, "dsthost").optional = true
+
+l7 = s:option(ListValue, "layer7", translate("service"))
+l7.optional = true
+l7:value("")
+local pats = luci.fs.dir("/etc/l7-protocols")
+if pats then
+ for i,f in ipairs(pats) do
+ if f:sub(-4) == ".pat" then
+ l7:value(f:sub(1, #f-4))
+ end
+ end
+end
+
+p2p = s:option(ListValue, "ipp2p", "P2P")
+p2p:value("")
+p2p:value("all", translate("all"))
+p2p:value("bit", "BitTorrent")
+p2p:value("dc", "DirectConnect")
+p2p:value("edk", "eDonkey")
+p2p:value("gnu", "Gnutella")
+p2p:value("kazaa", "Kazaa")
+p2p.optional = true
+
+p = s:option(ListValue, "proto", translate("protocol"))
+p:value("")
+p:value("tcp", "TCP")
+p:value("udp", "UDP")
+p:value("icmp", "ICMP")
+p.optional = true
+
+s:option(Value, "ports", translate("port")).optional = true
+s:option(Value, "portrange").optional = true
+
+return m \ No newline at end of file