forked from immortalwrt/luci
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tianling Shen <[email protected]>
- Loading branch information
1 parent
1b2ba1f
commit 4b70437
Showing
10 changed files
with
200 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,10 @@ | ||
# | ||
# Copyright (C) 2006-2017 OpenWrt.org | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
LUCI_TITLE:=LuCI support for eqos. | ||
LUCI_DESCRIPTION:=LuCI support for Easy QoS(Support speed limit based on IP address). | ||
LUCI_TITLE:=LuCI support for Easy QoS | ||
LUCI_DEPENDS:=+tc +kmod-sched-core +kmod-ifb | ||
LUCI_PKGARCH:=all | ||
|
||
PKG_NAME:=luci-app-eqos | ||
PKG_VERSION:=1.0.0 | ||
PKG_RELEASE:=2 | ||
|
||
PKG_MAINTAINER:=Jianhui Zhao <[email protected]> | ||
|
||
include ../../luci.mk | ||
|
||
# call BuildPackage - OpenWrt buildroot signature | ||
|
67 changes: 67 additions & 0 deletions
67
applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
'use strict'; | ||
'require form'; | ||
'require network'; | ||
'require uci'; | ||
'require view'; | ||
|
||
return view.extend({ | ||
load: function() { | ||
return Promise.all([ | ||
uci.load('eqos'), | ||
network.getHostHints() | ||
]); | ||
}, | ||
|
||
render: function(data) { | ||
var m, s, o; | ||
|
||
m = new form.Map('eqos', _('EQoS'), | ||
_('Network speed control service.')); | ||
|
||
s = m.section(form.NamedSection, 'config', 'eqos'); | ||
|
||
o = s.option(form.Flag, 'enabled', _('Enable')); | ||
o.default = o.disabled; | ||
o.rmempty = false; | ||
|
||
o = s.option(form.Value, 'download', _('Download speed (Mbit/s)'), | ||
_('Total download bandwidth.')); | ||
o.datatype = 'and(uinteger,min(1))'; | ||
o.rmempty = false; | ||
|
||
o = s.option(form.Value, 'upload', _('Upload speed (Mbit/s)'), | ||
_('Total upload bandwidth.')); | ||
o.datatype = 'and(uinteger,min(1))'; | ||
o.rmempty = false; | ||
|
||
s = m.section(form.TableSection, 'device', _('Speed limit based on IP address')); | ||
s.addremove = true; | ||
s.anonymous = true; | ||
s.sortable = true; | ||
|
||
o = s.option(form.Flag, 'enabled', _('Enable')); | ||
o.default = o.enabled; | ||
|
||
o = s.option(form.Value, 'ip', _('IP address')); | ||
o.datatype = 'ip4addr'; | ||
for (var i of Object.entries(data[1]?.hosts)) | ||
for (var v in i[1].ipaddrs) | ||
if (i[1].ipaddrs[v]) { | ||
var ip_addr = i[1].ipaddrs[v], ip_host = i[1].name; | ||
o.value(ip_addr, ip_host ? String.format('%s (%s)', ip_host, ip_addr) : ip_addr) | ||
} | ||
o.rmempty = false; | ||
|
||
o = s.option(form.Value, 'download', _('Download speed (Mbit/s)')); | ||
o.datatype = 'and(uinteger,min(1))'; | ||
o.rmempty = false; | ||
|
||
o = s.option(form.Value, 'upload', _('Upload speed (Mbit/s)')); | ||
o.datatype = 'and(uinteger,min(1))'; | ||
o.rmempty = false; | ||
|
||
o = s.option(form.Value, 'comment', _('Comment')); | ||
|
||
return m.render(); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
msgid "" | ||
msgstr "Content-Type: text/plain; charset=UTF-8" | ||
|
||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:64 | ||
msgid "Comment" | ||
msgstr "" | ||
|
||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:28 | ||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:56 | ||
msgid "Download speed (Mbit/s)" | ||
msgstr "" | ||
|
||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:18 | ||
#: applications/luci-app-eqos/root/usr/share/luci/menu.d/luci-app-eqos.json:3 | ||
msgid "EQoS" | ||
msgstr "" | ||
|
||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:24 | ||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:43 | ||
msgid "Enable" | ||
msgstr "" | ||
|
||
#: applications/luci-app-eqos/root/usr/share/rpcd/acl.d/luci-app-eqos.json:3 | ||
msgid "Grant UCI access for luci-app-eqos" | ||
msgstr "" | ||
|
||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:46 | ||
msgid "IP address" | ||
msgstr "" | ||
|
||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:19 | ||
msgid "Network speed control service." | ||
msgstr "" | ||
|
||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:38 | ||
msgid "Speed limit based on IP address" | ||
msgstr "" | ||
|
||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:29 | ||
msgid "Total download bandwidth." | ||
msgstr "" | ||
|
||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:34 | ||
msgid "Total upload bandwidth." | ||
msgstr "" | ||
|
||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:33 | ||
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:60 | ||
msgid "Upload speed (Mbit/s)" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
applications/luci-app-eqos/root/usr/share/luci/menu.d/luci-app-eqos.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"admin/services/eqos": { | ||
"title": "EQoS", | ||
"action": { | ||
"type": "view", | ||
"path": "eqos" | ||
}, | ||
"depends": { | ||
"acl": [ "luci-app-eqos" ], | ||
"uci": { "eqos": true } | ||
} | ||
} | ||
} |