Skip to content

Commit

Permalink
update@20210306
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Mar 6, 2021
1 parent 7cca5bf commit 7fc31b1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ o:depends('auto_update', '1')

o = s:option(Value, 'remote_url', translate('更新源地址'))
o:value('https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js', translate('GitHub'))
o:value('https://cdn.jsdelivr.net/gh/NobyDa/Script/JD-DailyBonus/JD_DailyBonus.js', translate('GitHub CDN'))
o:value('https://raw.sevencdn.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js', translate('GitHub CDN 01'))
o:value('https://cdn.jsdelivr.net/gh/NobyDa/Script/JD-DailyBonus/JD_DailyBonus.js', translate('GitHub CDN 02'))
o:value('https://ghproxy.com/https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js', translate('韩国首尔'))
o:value('https://gitee.com/jerrykuku/staff/raw/master/JD_DailyBonus.js', translate('Gitee'))
o.default = 'nil'
o.rmempty = false
Expand Down
19 changes: 13 additions & 6 deletions luci-app-oaf/luasrc/model/cbi/appfilter/appfilter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ m = Map("appfilter",

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
Expand All @@ -31,18 +39,16 @@ local display_str="<strong>当前版本: </strong>"..version.."<br><strong>特
s = m:section(TypedSection, "feature", translate("特征库更新"), display_str )

fu = s:option(FileUpload, "")
fu.template = "cbi/other_upload"
fu.template = "cbi/oaf_upload"
s.anonymous = true

um = s:option(DummyValue, "rule_data")
um.template = "cbi/other_dvalue"

um.template="cbi/oaf_dvalue"
--um.value =rule_count .. " " .. translate("Records").. " "..version
s = m:section(TypedSection, "appfilter", translate("App Filter Rules"))
s.anonymous = true
s.addremove = false


local class_fd = io.popen("find /tmp/appfilter/ -type f -name '*.class'")
if class_fd then
while true do
Expand Down Expand Up @@ -172,7 +178,6 @@ http.setfilehandler(
if not meta then return end
if meta and chunk then fd = nixio.open(dir .. meta.file, "w") end
if not fd then
--um.value = translate("Create upload file error.")
return
end
end
Expand All @@ -182,7 +187,8 @@ http.setfilehandler(
if eof and fd then
fd:close()
local fd2 = io.open("/tmp/upload/"..meta.file)
local line=fd2:read("*l");
local line=fd2:read("*l");
fd2:close()
local ret=string.match(line, "#version")
if ret ~= nil then
local cmd="cp /tmp/upload/"..meta.file.." /etc/appfilter/feature.cfg";
Expand All @@ -193,6 +199,7 @@ http.setfilehandler(
else
um.value = translate("更新失败,格式错误!")
end
os.execute("rm /tmp/upload/* -fr");
end

end
Expand Down
8 changes: 8 additions & 0 deletions luci-app-oaf/luasrc/view/cbi/oaf_dvalue.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<%+cbi/valueheader%>
<span style="color: red">
<%
local val = self:cfgvalue(section) or self.default or ""
write(pcdata(val))
%>
</span>
<%+cbi/valuefooter%>
5 changes: 5 additions & 0 deletions luci-app-oaf/luasrc/view/cbi/oaf_upload.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<%+cbi/valueheader%>
<label class="cbi-value" style="display:inline-block; width: 130px" for="ulfile"><%:选择本地特征库文件:%></label>
<input class="cbi-input-file" style="width: 500px" type="file" id="ulfile" name="ulfile" />
<input type="submit" class="cbi-button cbi-input-apply" name="upload" value="<%:Upload%>" />
<%+cbi/valuefooter%>

0 comments on commit 7fc31b1

Please sign in to comment.