Skip to content

Commit

Permalink
update 2024-02-29 12:20:17
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 29, 2024
1 parent 7ba6d32 commit 1689d58
Show file tree
Hide file tree
Showing 83 changed files with 2,106 additions and 23,763 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions luci-app-eqosplus/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright (C) 2006-2017 OpenWrt.org
# Copyright (C) 2022-2023 sirpdboy <[email protected]>
# 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 eqosplus.
LUCI_DESCRIPTION:=LuCI support for Easy eqosplus(Support speed limit based on IP address).
LUCI_DEPENDS:=+bash +tc +kmod-sched-core +kmod-ifb +kmod-sched +iptables-mod-filter +iptables-mod-nat-extra
LUCI_PKGARCH:=all

PKG_VERSION:=1.2.2
PKG_RELEASE:=20230719
PKG_MAINTAINER:=sirpdboy <[email protected]>

define Package/$(PKG_NAME)/conffiles
/etc/config/eqosplus
endef

include $(TOPDIR)/feeds/luci/luci.mk

# call BuildPackage - OpenWrt buildroot signature

107 changes: 107 additions & 0 deletions luci-app-eqosplus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
## 访问数:![hello](https://views.whatilearened.today/views/github/sirpdboy/deplives.svg)[![](https://img.shields.io/badge/TG群-点击加入-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ)

[eqosplus 定时限速插件](https://github.com/sirpdboy/luci-app-eqosplus)

![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明1.jpg)

**认真阅读完毕** 本页面,本页面包含注意事项和如何使用。

## 功能说明:

### 定时限速1.2.2版
#### 2023.7.19 定时限速1.2.2:增加更多日期:工作日和休息日,自定义日期1,2,3中间用逗号分隔;加入MAC地址限速,从此不用担心IPV6和IPV4的限速问题。

### 定时限速1.0版
#### 2022.12.24 定时限速在eqos的加强版,加入定时限制等功能。

## 编译使用方法 [![](https://img.shields.io/badge/-编译使用方法-F5F5F5.svg)](#编译使用方法-)

将luci-app-eqosplus添加至 LEDE/OpenWRT 源码的方法。

### 下载源码方法一:
编辑源码文件夹根目录feeds.conf.default并加入如下内容:

```Brach
# feeds获取源码:
src-git eqosplus https://github.com/sirpdboy/luci-app-eqosplus
```
```Brach
# 更新feeds,并安装主题:
scripts/feeds update eqosplus
scripts/feeds install luci-app-eqosplus
```

### 下载源码方法:
```Brach
# 下载源码
git clone https://github.com/sirpdboy/luci-app-eqosplus package/luci-app-eqosplus
make menuconfig
```
### 配置菜单
```Brach
make menuconfig
# 找到 LuCI -> Applications, 选择 luci-app-eqosplus, 保存后退出。
```
### 编译
```Brach
# 编译固件
make package/luci-app-eqosplus/compile V=s
```

## 说明 [![](https://img.shields.io/badge/-说明-F5F5F5.svg)](#说明-)

源码来源:https://github.com/sirpdboy/luci-app-eqosplus


- 你可以随意使用其中的源码,但请注明出处。

![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明2.jpg)

## 界面

![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/eqosplus.png)

![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/eqosplus2.png)

## 使用与授权相关说明

- 本人开源的所有源码,任何引用需注明本处出处,如需修改二次发布必告之本人,未经许可不得做于任何商用用途。


# My other project

- 网络速度测试 :https://github.com/sirpdboy/NetSpeedTest

- 任务设置(定时和开机二合一)插件 : https://github.com/sirpdboy/luci-app-autotimeset

- 关机功能插件 : https://github.com/sirpdboy/luci-app-poweroffdevice

- opentopd主题 : https://github.com/sirpdboy/luci-theme-opentopd

- kucat 主题: https://github.com/sirpdboy/luci-theme-kucat

- 家长控制: https://github.com/sirpdboy/luci-theme-parentcontrol

- 系统高级设置 : https://github.com/sirpdboy/luci-app-advanced

- ddns-go动态域名: https://github.com/sirpdboy/luci-app-ddns-go

- 进阶设置(系统高级设置+主题设置kucat/agron/opentopd): https://github.com/sirpdboy/luci-app-advancedplus

- 设置向导: https://github.com/sirpdboy/luci-app-wizard

- 分区扩容: https://github.com/sirpdboy/luci-app-partexp

- lukcy大吉: https://github.com/sirpdboy/luci-app-lukcy

## 捐助

![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明3.jpg)

| <img src="https://img.shields.io/badge/-支付宝-F5F5F5.svg" href="#赞助支持本项目-" height="25" alt="图飞了😂"/> | <img src="https://img.shields.io/badge/-微信-F5F5F5.svg" height="25" alt="图飞了😂" href="#赞助支持本项目-"/> |
| :-----------------: | :-------------: |
|![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/支付宝.png) | ![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/微信.png) |

<a href="#readme">
<img src="https://img.shields.io/badge/-返回顶部-orange.svg" alt="图飞了😂" title="返回顶部" align="right"/>
</a>
16 changes: 16 additions & 0 deletions luci-app-eqosplus/luasrc/controller/eqosplus.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module("luci.controller.eqosplus", package.seeall)
-- Copyright 2022-2023 sirpdboy <[email protected]>
function index()
if not nixio.fs.access("/etc/config/eqosplus") then return end
entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false
entry({"admin", "control", "eqosplus"}, cbi("eqosplus"), _("Eqosplus"), 10).dependent =true
entry({"admin", "control", "eqosplus", "status"}, call("act_status")).leaf = true
end

function act_status()
local sys = require "luci.sys"
local e = {}
e.status = sys.call(" tc qdisc show | grep 'default' >/dev/null ") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
105 changes: 105 additions & 0 deletions luci-app-eqosplus/luasrc/model/cbi/eqosplus.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
-- Copyright 2022-2023 sirpdboy <[email protected]>
-- Licensed to the public under the Apache License 2.0.
local sys = require "luci.sys"
local ifaces = sys.net:devices()
local WADM = require "luci.tools.webadmin"
local ipc = require "luci.ip"
local a, t, e

a = Map("eqosplus", translate("Network speed limit"))
a.description = translate("Users can limit the network speed for uploading/downloading through MAC, IP.The speed unit is MB/second.")..translate("Suggested feedback:")..translate("<a href=\'https://github.com/sirpdboy/luci-app-eqosplus.git' target=\'_blank\'>GitHub @sirpdboy/luci-app-eqosplus </a>")
a.template = "eqosplus/index"

t = a:section(TypedSection, "eqosplus")
t.anonymous = true

e = t:option(DummyValue, "eqosplus_status", translate("Status"))
e.template = "eqosplus/eqosplus"
e.value = translate("Collecting data...")


ipi = t:option(ListValue, "ifname", translate("Interface"), translate("Set the interface used for restriction, use pppoe-wan for dialing, use WAN hardware interface for DHCP mode (such as eth1), and use br-lan for bypass mode"))
ipi.default = "1"
ipi:value(1,translate("Automatic settings"))
ipi.rmempty = false
for _, v in pairs(ifaces) do
net = WADM.iface_get_network(v)
if net and net ~= "loopback" then
ipi:value(v)
end
end

t = a:section(TypedSection, "device")
t.template = "cbi/tblsection"
t.anonymous = true
t.addremove = true

e = t:option(Flag, "enable", translate("Enabled"))
e.rmempty = false
e.size = 4

ip = t:option(Value, "mac", translate("IP/MAC"))

ipc.neighbors({family = 4, dev = "br-lan"}, function(n)
if n.mac and n.dest then
ip:value(n.dest:string(), "%s (%s)" %{ n.dest:string(), n.mac })
end
end)
ipc.neighbors({family = 4, dev = "br-lan"}, function(n)
if n.mac and n.dest then
ip:value(n.mac, "%s (%s)" %{n.mac, n.dest:string() })
end
end)

e.size = 8
dl = t:option(Value, "download", translate("Downloads"))
dl.default = '0.1'
dl.size = 4

ul = t:option(Value, "upload", translate("Uploads"))
ul.default = '0.1'
ul.size = 4
function validate_time(self, value, section)
local hh, mm, ss
hh, mm, ss = string.match (value, "^(%d?%d):(%d%d)$")
hh = tonumber (hh)
mm = tonumber (mm)
if hh and mm and hh <= 23 and mm <= 59 then
return value
else
return nil, "Time HH:MM or space"
end
end

e = t:option(Value, "timestart", translate("Start control time"))
e.placeholder = '00:00'
e.default = '00:00'
e.validate = validate_time
e.rmempty = true
e.size = 4

e = t:option(Value, "timeend", translate("Stop control time"))
e.placeholder = '00:00'
e.default = '00:00'
e.validate = validate_time
e.rmempty = true
e.size = 4

week=t:option(Value,"week",translate("Week Day(1~7)"))
week.rmempty = true
week:value('0',translate("Everyday"))
week:value(1,translate("Monday"))
week:value(2,translate("Tuesday"))
week:value(3,translate("Wednesday"))
week:value(4,translate("Thursday"))
week:value(5,translate("Friday"))
week:value(6,translate("Saturday"))
week:value(7,translate("Sunday"))
week:value('1,2,3,4,5',translate("Workday"))
week:value('6,7',translate("Rest Day"))
week.default='0'
week.size = 6
comment = t:option(Value, "comment", translate("Comment"))
comment.size = 8

return a
3 changes: 3 additions & 0 deletions luci-app-eqosplus/luasrc/view/eqosplus/eqosplus.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<%+cbi/valueheader%>
<font class="eqosplus_status"><%=pcdata(self:cfgvalue(section) or self.default or "")%></font>
<%+cbi/valuefooter%>
12 changes: 12 additions & 0 deletions luci-app-eqosplus/luasrc/view/eqosplus/index.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<% include("cbi/map") %>
<script type="text/javascript">//<![CDATA[
XHR.poll(2, '<%=luci.dispatcher.build_url("admin", "control", "eqosplus", "status" )%>', null,
function (x, result) {
var status = document.getElementsByClassName('eqosplus_status')[0];
status.setAttribute("style", "font-weight:bold;");
status.setAttribute("color", result.status ? "green" : "red");
status.innerHTML = result.status ? '<%=translate("RUNNING")%>' : '<%=translate("NOT RUNNING")%>';
}
)
//]]>
</script>
61 changes: 61 additions & 0 deletions luci-app-eqosplus/po/zh-cn/eqosplus.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

msgid "Eqosplus"
msgstr "定时限速"

msgid "Network speed limit"
msgstr "定时网速限制"

msgid "Running state"
msgstr "运行状态"

msgid "Not running"
msgstr "未运行"

msgid "Running"
msgstr "已运行"

msgid "Users can limit the network speed for uploading/downloading through MAC, IP.The speed unit is MB/second."
msgstr "可以通过MAC,IP限制用户上传/下载的网速。速度单位为<font color=\"red\"><b> MB/秒 </b></font>。"

msgid "MAC/IP"
msgstr "MAC/IP"

msgid "Downloads"
msgstr "下载速度"

msgid "Uploads"
msgstr "上传速度"

msgid "Comment"
msgstr "备注"

msgid "Upload bandwidth(Mbit/s)"
msgstr "上传总带宽(Mbit/s)"

msgid "Download bandwidth(Mbit/s)"
msgstr "下载总带宽(Mbit/s)"

msgid "Start control time"
msgstr "起控时间"

msgid "Stop control time"
msgstr "停控时间"

msgid "Week Day(1~7)"
msgstr "星期(1~7)"

msgid "Suggested feedback:"
msgstr "建议反馈:"

msgid "Set the interface used for restriction, use pppoe-wan for dialing, use WAN hardware interface for DHCP mode (such as eth1), and use br-lan for bypass mode"
msgstr "设定用来限制网络速度的接口,拨号使用pppoe-wan,DHCP模式使用WAN口的硬件接口(如:eth1),通用使用br-lan接口"

msgid "Rest Day"
msgstr "休息日"

msgid "Workday"
msgstr "工作日"

msgid "Automatic settings"
msgstr "自动设置"

1 change: 1 addition & 0 deletions luci-app-eqosplus/po/zh_Hans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zh-cn
27 changes: 27 additions & 0 deletions luci-app-eqosplus/root/etc/config/eqosplus
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

config eqosplus
option enabled '0'
option download '1000'
option upload '30'
option ifname '1'

config device
option timestart '00:00'

option week '0'
option download '1'
option timeend '23:55'
option upload '1'
option mac ''
option enable '0'

config device
option mac '192.168.10.10/24'
option timestart '00:00'
option timeend '00:00'

option week '0'
option download '0.1'
option upload '0.1'
option enable '0'

Loading

0 comments on commit 1689d58

Please sign in to comment.