diff --git a/README.md b/README.md
index 8fb4cc0..fba1bba 100755
--- a/README.md
+++ b/README.md
@@ -1,29 +1,58 @@
-### 插件和特征库发布地址
-
-https://destan19.github.io/
-### OpenAppFilter功能简介
-
-OpenAppFilter基于数据流深度识别技术,可以实现游戏、视频、直播等app过滤和审计。
-
-## 编译说明
-1. 下载OpenWrt源码,并完成编译
-> git clone https://github.com/coolsnowwolf/lede.git
-> 或 https://github.com/openwrt/openwrt.git (18.06)
-2. 下载应用过滤源码放到OpenWrt的package 目录
-> cd package
-git clone https://github.com/destan19/OpenAppFilter.git
-cd -
-3. make menuconfig, 在luci app中选上luci oaf app模块并保存
-4. make V=s 编译出带应用过滤功能的OpenWrt固件
-也可以将源码路径加入到feeds配置中
+应用过滤是一款基于OpenWrt的家长管理插件,支持游戏、视频、聊天、下载等app过滤
+### 如何编译应用过滤固件
+1. 准备OpenWrt源码,并编译成功
+ 推荐源码仓库:
+ https://github.com/coolsnowwolf/lede.git
+ 如果用官方源码,不要用master分支,因为luci版本不兼容,推荐18.06版本。
+2. clone应用过滤源码到OpenWrt源码package目录
+git clone https://github.com/destan19/OpenAppFilter.git package/OpenAppFilter
+3. make menuconfig 开启应用过滤插件宏
+ 在OpenWrt源码目录执行make menuconfig,进入luci app菜单选择luci-app-oaf保存
+4. 编译生成固件
+ make V=s
+### 使用说明
+1. 将应用过滤设备做主路由
+2. 关闭软硬加速、广告过滤、QOS、多WAN等涉及到nf_conn mark的模块
+3. 开启应用过滤并选择需要过滤的app即可生效
-## 使用说明
-1. 应用过滤与加速模块、广告过滤、mwan等涉及到nf_conntrack mark的模块有冲突,需要关闭冲突模块才能生效。
-2. 应用过滤包含了内核模块,内核版本号和宏配置都会影响插件安装,建议直接编译进固件。
-3. 如果你的固件集成了应用过滤插件,并进行二次发布,请备注应用过滤仓库地址,谢谢!
+### 如何自定义特征码
+https://zhuanlan.zhihu.com/p/419053529
+
+### 固件和特征库下载地址
+https://destan19.github.io
+如果访问不了,可以切换4G网络或者运营商,部分网络屏蔽了github.io
+
+### 演示视频
+https://www.bilibili.com/video/BV1ZL41137aT/
+
+### 6.0以上版本ipk安装
+1. 通过以下源码编译固件
+https://github.com/destan19/openfros
+2. 在release中下载ipk文件直接安装
+
+### OpenWrt应用过滤交流群
+群号: 943396288
+点击链接加入群聊【OpenWrt交流群(OAF)】:
+https://jq.qq.com/?_wv=1027&k=TqQ6VvtV
+
+
+
+App filtering is a parent management plug-in based on OpenWrt, which supports app filtering for games, videos, chats, downloads, etc.
+### How to compile application filtering firmware
+1. Prepare OpenWrt source code and compile successfully
+ Recommended source code repository:
+ https://github.com/coolsnowwolf/lede.git
+ If you use the official source code, do not use the master branch, because the luci version is not compatible, version 18.06 is recommended.
+2. Clone the application filtering source code to the OpenWrt source code package directory
+git clone https://github.com/destan19/OpenAppFilter.git package/OpenAppFilter
+3. make menuconfig to open the application filter plug-in macro
+ Execute make menuconfig in the OpenWrt source code directory, enter the luci app menu and select luci-app-oaf to save
+4. Compile and generate firmware
+ make V=s
+### Instructions for use
+1. Make the application filtering device the main route
+2. Turn off software and hardware acceleration, advertising filtering, QOS, multi-WAN and other modules related to nf_conn mark
+3. Turn on application filtering and select the app that needs to be filtered to take effect
-## 技术交流QQ群 (2000人)
-943396288
-点击链接加入群聊【OpenWrt交流群(OAF)】:https://jq.qq.com/?_wv=1027&k=YQaeDqTY
diff --git a/luci-app-oaf/luasrc/controller/appfilter.lua b/luci-app-oaf/luasrc/controller/appfilter.lua
index 93daabb..383682f 100755
--- a/luci-app-oaf/luasrc/controller/appfilter.lua
+++ b/luci-app-oaf/luasrc/controller/appfilter.lua
@@ -8,14 +8,11 @@ function index()
end
local page
- --hide save button
- page = entry({"admin", "network", "appfilter"}, arcombine(cbi("appfilter/appfilter"), cbi("appfilter/dev_status", {hideapplybtn=true, hidesavebtn=true, hideresetbtn=true})), _("appfilter"), 100)
+ page = entry({"admin", "network", "appfilter"}, arcombine(cbi("appfilter/appfilter"), cbi("appfilter/dev_status", {hideapplybtn=true, hidesavebtn=true, hideresetbtn=true})), _("App Filter"), 100)
page.leaf = true
page.subindex = true
- --page.dependent = true
-
page = entry({"admin", "network", "user_status"}, call("user_status"), nil)
page.leaf = true
@@ -114,8 +111,6 @@ function user_status()
hostname=get_hostname_by_mac(user_array[i].mac),
appid=visit_array[j].appid,
appname=get_app_name_by_id(visit_array[j].appid),
- --total_num=visit_array[j].total_num,
- --drop_num=visit_array[j].drop_num,
total_num=0,
drop_num=0,
latest_action=visit_array[j].latest_action,
diff --git a/luci-app-oaf/luasrc/model/cbi/appfilter/appfilter.lua b/luci-app-oaf/luasrc/model/cbi/appfilter/appfilter.lua
index fc982b3..470decf 100755
--- a/luci-app-oaf/luasrc/model/cbi/appfilter/appfilter.lua
+++ b/luci-app-oaf/luasrc/model/cbi/appfilter/appfilter.lua
@@ -14,56 +14,43 @@ local SYS = require "luci.sys"
local m, s
m = Map("appfilter",
- translate("appfilter"),
+ translate("App Filter"),
translate(""))
s = m:section(TypedSection, "global", translate("Basic Settings"))
s:option(Flag, "enable", translate("Enable App Filter"),translate(""))
-um = s:option(DummyValue, "")
-um.template="cbi/oaf_dvalue"
-local fullcone=SYS.exec("uci get firewall.@defaults[0].fullcone");
-local bbr=SYS.exec("uci get flowoffload.@flow[0].bbr");
-local flow_offloading=SYS.exec("uci get flowoffload.@flow[0].flow_offloading");
-if string.match(fullcone, "1") or string.match(bbr, "1") or string.match(flow_offloading, "1") then
- um.value="运行环境检测失败,请先关闭ACC加速模块!"
-end
s.anonymous = true
local rule_count=0
local version=""
-if nixio.fs.access("/etc/appfilter/feature.cfg") then
- rule_count=tonumber(SYS.exec("cat /etc/appfilter/feature.cfg | wc -l"))
- version=SYS.exec("cat /etc/appfilter/feature.cfg |grep \"#version\" | awk '{print $2}'")
+if nixio.fs.access("/tmp/feature.cfg") then
+ rule_count=tonumber(SYS.exec("cat /tmp/feature.cfg | wc -l"))
+ version=SYS.exec("cat /tmp/feature.cfg |grep \"#version\" | awk '{print $2}'")
end
-local display_str="当前版本: "..version.."
特征码个数: "..rule_count.."
下载地址:https://destan19.github.io"
-s = m:section(TypedSection, "feature", translate("特征库更新"), display_str )
+
+
+local display_str=""..translate("Current Version")..": "..version.."
"..translate("App Feature Num")..": "..rule_count
+s = m:section(TypedSection, "feature", translate("Update feature"), display_str )
fu = s:option(FileUpload, "")
fu.template = "cbi/oaf_upload"
s.anonymous = true
um = s:option(DummyValue, "rule_data")
-um.template="cbi/oaf_dvalue"
-s=m:section(TypedSection,"time",translate("时间控制")) s.anonymous = true
-hv = s:option(Value, "start_time", translate("开始时间")) hv.default="00:00"
+s=m:section(TypedSection,"time",translate("Time Setting")) s.anonymous = true
+hv = s:option(Value, "start_time", translate("Start Time")) hv.default="00:00"
hv.optional=false
-hv = s:option(Value, "end_time", translate("结束时间")) hv.default="23:59"
+hv = s:option(Value, "end_time", translate("End Time")) hv.default="23:59"
hv.optional=false days = s:option(MultiValue, "days", "", translate(""))
days.widget="checkbox" days.size=10
-days:value("0", "周日");
-days:value("1", "周一");
-days:value("2", "周二");
-days:value("3", "周三");
-days:value("4", "周四");
-days:value("5", "周五");
-days:value("6", "周六");
-
---um.value =rule_count .. " " .. translate("Records").. " "..version
-
-
-
-
+days:value("0", translate("Sun"));
+days:value("1", translate("Mon"));
+days:value("2", translate("Tue"));
+days:value("3", translate("Wed"));
+days:value("4", translate("Thur"));
+days:value("5", translate("Fri"));
+days:value("6", translate("Sat"));
s = m:section(TypedSection, "appfilter", translate("App Filter Rules"))
s.anonymous = true
@@ -80,13 +67,9 @@ if class_fd then
end
class = path:match("([^/]+)%.class$")
- -- add a tab
s:tab(class, translate(class))
- -- multi value option
apps = s:taboption(class, MultiValue, class.."apps", translate(""))
apps.rmempty=true
- --apps.delimiter=";"
- -- select
apps.widget="checkbox"
apps.size=10
@@ -121,9 +104,6 @@ if class_fd then
class_fd:close()
end
-
-
-
function get_hostname_by_mac(dst_mac)
leasefile="/tmp/dhcp.leases"
local fd = io.open(leasefile, "r")
@@ -143,6 +123,7 @@ function get_hostname_by_mac(dst_mac)
fd:close()
return nil
end
+
function get_cmd_result(command)
local fd
local result
@@ -213,14 +194,22 @@ http.setfilehandler(
local line=fd2:read("*l");
fd2:close()
local ret=string.match(line, "#version")
+ local lang=m.uci:get_all("luci.main.lang")
+ local feature_file=""
+ if "" == lang or "auto" == lang then
+ feature_file="/etc/appfilter/feature.cfg"
+ else
+ feature_file="/etc/appfilter/feature_"..lang..".cfg"
+ end
if ret ~= nil then
- local cmd="cp /tmp/upload/"..meta.file.." /etc/appfilter/feature.cfg";
+ local cmd="cp /tmp/upload/"..meta.file.." "..feature_file;
os.execute(cmd);
+ os.execute("chmod 666 "..feature_file);
os.execute("rm /tmp/appfilter -fr");
luci.sys.exec("/etc/init.d/appfilter restart &");
- um.value = translate("更新成功,请刷新页面!")
+ um.value = translate("Update the feature file successfully, please refresh the page")
else
- um.value = translate("更新失败,格式错误!")
+ um.value = translate("Failed to update feature file, format error")
end
os.execute("rm /tmp/upload/* -fr");
end
@@ -236,6 +225,4 @@ if luci.http.formvalue("upload") then
elseif luci.http.formvalue("download") then
Download()
end
-
-
return m
diff --git a/luci-app-oaf/luasrc/model/cbi/appfilter/dev_status.lua b/luci-app-oaf/luasrc/model/cbi/appfilter/dev_status.lua
index 55d3440..09133b0 100755
--- a/luci-app-oaf/luasrc/model/cbi/appfilter/dev_status.lua
+++ b/luci-app-oaf/luasrc/model/cbi/appfilter/dev_status.lua
@@ -13,7 +13,7 @@ local jsc = require "luci.jsonc"
local m, s
arg[1] = arg[1] or ""
m = Map("appfilter",
- translate("上网统计("..arg[1]..")"),
+ translate("Data Statistics").."("..arg[1]..")",
translate(""))
local v
diff --git a/luci-app-oaf/luasrc/view/admin_network/dev_status.htm b/luci-app-oaf/luasrc/view/admin_network/dev_status.htm
index 89a8448..58cf16e 100755
--- a/luci-app-oaf/luasrc/view/admin_network/dev_status.htm
+++ b/luci-app-oaf/luasrc/view/admin_network/dev_status.htm
@@ -51,11 +51,11 @@ table.imagetable td {
var total_time_str;
if (hour > 0)
- total_time_str=hour + "小时" + min + "分"
+ total_time_str=hour + "<%:h%>" + min + "<%:m%>"
else{
if (min == 0 && seconds2 != 0)
min = 1;
- total_time_str=min + "分"
+ total_time_str=min + "<%:m%>"
}
return total_time_str;
}
@@ -82,7 +82,7 @@ table.imagetable td {
option = {
title: [
{
- text: 'APP时间统计',
+ text: "<%:App Time Statistics%>",
textStyle: {
fontSize: 16,
color: "black"
@@ -110,8 +110,8 @@ table.imagetable td {
var total_time = get_display_time(parms.data.value);
var str= parms.seriesName+""+
parms.marker+""+parms.data.legendname+""+
- "时间:"+ total_time+""+
- "占比:"+ parms.percent+"%";
+ "<%:Visit Time%>: "+ total_time+""+
+ "<%:Percentage%>: "+ parms.percent+"%";
return str ;
}
},
@@ -128,11 +128,11 @@ table.imagetable td {
},
series: [
{
- name: "访问时间",
+ name: "<%:Visit Time%>",
type:'pie',
center: ['35%', '50%'],
radius: ['40%', '65%'],
- clockwise: false, //饼图的扇区是否是顺时针排布
+ clockwise: false,
avoidLabelOverlap: false,
label: {
normal: {
@@ -164,8 +164,6 @@ table.imagetable td {
var m2R2Data=new Array()
var total_time=0
for(var i = 0; i < data.length; i++){
- console.log("begin display222.");
-
var dev_obj = data[i];
if (dev_obj.visit_time == 0)
continue;
@@ -186,7 +184,7 @@ table.imagetable td {
option = {
title: [
{
- text: 'APP分类时间统计',
+ text: "<%:App classification time statistics%>",
textStyle: {
fontSize: 16,
color: "black"
@@ -213,9 +211,8 @@ table.imagetable td {
formatter:function (parms){
var total_time = get_display_time(parms.data.value);
var str= parms.seriesName+""+
- parms.marker+""+parms.data.legendname+""+
- "时间:"+ total_time +""+
- "占比:"+ parms.percent+"%";
+ parms.marker+""+parms.data.legendname+""+"<%:Visit Time%>: "+ total_time +"" +
+ "<%:Percentage%>: "+ parms.percent+"%";
return str ;
}
},
@@ -232,11 +229,11 @@ table.imagetable td {
},
series: [
{
- name:'访问时间',
+ name:"<%:Visit Time%>",
type:'pie',
center: ['35%', '50%'],
radius: ['40%', '65%'],
- clockwise: false, //饼图的扇区是否是顺时针排布
+ clockwise: false,
avoidLabelOverlap: false,
label: {
normal: {
@@ -289,12 +286,12 @@ table.imagetable td {
{
var action_status=""
if(st[i].latest_action == 1)
- action_status="已过滤"
+ action_status="<%:Filtered%>"
else
- action_status="未过滤"
+ action_status="<%:Unfiltered%>"
var hostname=""
if(st[i].hostname == "" || st[i].hostname == "*"){
- hostname="?";
+ hostname="--";
}
else{
hostname=st[i].hostname;
@@ -313,11 +310,11 @@ table.imagetable td {
total_time_str="-"
else {
if (hour > 0)
- total_time_str=hour + "小时" + min + "分"
+ total_time_str=hour + "<%:h%>" + min + "<%:m%>"
else{
if (min == 0)
min = 1;
- total_time_str=min + "分"
+ total_time_str=min + "<%:m%>"
}
}
@@ -331,6 +328,7 @@ table.imagetable td {
//]]>
+