Skip to content

Commit

Permalink
chore: refine
Browse files Browse the repository at this point in the history
  • Loading branch information
vernesong committed Mar 1, 2025
1 parent 498e3f1 commit eae4107
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function(s)
end)

o:value("DIRECT")
o:value("REJECT")
o:value("GLOBAL")
o:value("Disable", translate("Disable"))
o.default = "Disable"
o.rempty = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ o.rmempty = true
o.placeholder = "bgp|sg"

o = s:option(DynamicList, "other_group", translate("Other Group (Support Regex)"))
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT'")..bold_off..font_off
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT' & 'REJECT-DROP' & 'PASS' & 'GLOBAL'")..bold_off..font_off
o:value("all", translate("All Groups"))
uci:foreach("openclash", "groups",
function(s)
Expand All @@ -111,6 +111,9 @@ uci:foreach("openclash", "groups",
end)
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")
o.rmempty = true

local t = {
Expand Down
93 changes: 93 additions & 0 deletions luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "AsianTV", translate("AsianTV"))
o:depends("rule_name", "lhie1")
Expand All @@ -94,6 +97,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "MainlandTV", translate("CN Mainland TV"))
o:depends("rule_name", "lhie1")
Expand All @@ -105,6 +111,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Proxy", translate("Proxy"))
o:depends("rule_name", "lhie1")
Expand All @@ -116,6 +125,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Youtube", translate("Youtube"))
o:depends("rule_name", "lhie1")
Expand All @@ -127,6 +139,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Bilibili", translate("Bilibili"))
o:depends("rule_name", "lhie1")
Expand All @@ -138,6 +153,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Bahamut", translate("Bahamut"))
o:depends("rule_name", "lhie1")
Expand All @@ -149,6 +167,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "HBOMax", translate("HBO Max"))
o:depends("rule_name", "lhie1")
Expand All @@ -160,6 +181,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Pornhub", translate("Pornhub"))
o:depends("rule_name", "lhie1")
Expand All @@ -171,6 +195,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Apple", translate("Apple"))
o:depends("rule_name", "lhie1")
Expand All @@ -182,6 +209,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "AppleTV", translate("Apple TV"))
o:depends("rule_name", "lhie1")
Expand All @@ -193,6 +223,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "GoogleFCM", translate("Google FCM"))
o:depends("rule_name", "lhie1")
Expand All @@ -204,6 +237,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Scholar", translate("Scholar"))
o:depends("rule_name", "lhie1")
Expand All @@ -215,6 +251,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Microsoft", translate("Microsoft"))
o:depends("rule_name", "lhie1")
Expand All @@ -226,6 +265,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "AI_Suite", translate("AI Suite"))
o:depends("rule_name", "lhie1")
Expand All @@ -237,6 +279,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Netflix", translate("Netflix"))
o:depends("rule_name", "lhie1")
Expand All @@ -248,6 +293,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Disney", translate("Disney Plus"))
o:depends("rule_name", "lhie1")
Expand All @@ -259,6 +307,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Discovery", translate("Discovery Plus"))
o:depends("rule_name", "lhie1")
Expand All @@ -270,6 +321,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "DAZN", translate("DAZN"))
o:depends("rule_name", "lhie1")
Expand All @@ -281,6 +335,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Spotify", translate("Spotify"))
o:depends("rule_name", "lhie1")
Expand All @@ -292,6 +349,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Steam", translate("Steam"))
o:depends("rule_name", "lhie1")
Expand All @@ -303,6 +363,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "miHoYo", translate("miHoYo"))
o:depends("rule_name", "lhie1")
Expand All @@ -314,6 +377,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Speedtest", translate("Speedtest"))
o:depends("rule_name", "lhie1")
Expand All @@ -325,6 +391,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Telegram", translate("Telegram"))
o:depends("rule_name", "lhie1")
Expand All @@ -336,6 +405,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Crypto", translate("Crypto"))
o:depends("rule_name", "lhie1")
Expand All @@ -347,6 +419,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Discord", translate("Discord"))
o:depends("rule_name", "lhie1")
Expand All @@ -358,6 +433,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "PayPal", translate("PayPal"))
o:depends("rule_name", "lhie1")
Expand All @@ -369,6 +447,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "AdBlock", translate("AdBlock"))
o:depends("rule_name", "lhie1")
Expand All @@ -380,6 +461,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "HTTPDNS", translate("HTTPDNS"))
o:depends("rule_name", "lhie1")
Expand All @@ -391,6 +475,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Domestic", translate("Domestic"))
o:depends("rule_name", "lhie1")
Expand All @@ -402,6 +489,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

o = s:option(ListValue, "Others", translate("Others"))
o:depends("rule_name", "lhie1")
Expand All @@ -414,6 +504,9 @@ for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ o:value("0", translate("Priority Match"))
o:value("1", translate("Extended Match"))

o = s:option(ListValue, "group", translate("Set Proxy Group"))
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT'")..bold_off..font_off
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT' & 'REJECT-DROP' & 'PASS' & 'GLOBAL'")..bold_off..font_off
o.rmempty = true
local groupnames,filename
filename = m.uci:get(openclash, "config", "config_path")
Expand All @@ -138,6 +138,9 @@ m.uci:foreach("openclash", "groups",

o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")

-- [[ other-setting ]]--
o = s:option(Value, "other_parameters", translate("Other Parameters"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ uci:foreach("openclash", "groups",

o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")
o.rmempty = true

-- [[ Edit Other Rule Provider ]] --
Expand Down
2 changes: 1 addition & 1 deletion luci-app-openclash/luasrc/view/openclash/status.htm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<tr><td width="25%"><%:Main Program%></td><td width="25%" align="left"><span id="_clash"><%:Collecting data...%></span><span id="_watchdog"></span></td><td width="25%"><%:Control Panel Login IP%></td><td width="25%" align="left" id="_daip"><%:Collecting data...%></td></tr>
<tr><td width="20%"><%:Running Mode%></td><td width="30%" align="left"><span id="_mode"><%:Collecting data...%></span><span id="radio-ru-mode" class="radio-button">
<input type="radio" id="normal" name="radios-ru" value="" checked onclick="return switch_run_mode(this.value)"/>
<label for="normal" id="run_normal"><%:Compatible%></label>
<label for="normal" id="run_normal"><%:Compat%></label>
<input type="radio" id="tun" name="radios-ru" value="-tun" onclick="return switch_run_mode(this.value)"/>
<label for="tun"><%:TUN%></label>
<input type="radio" id="mix" name="radios-ru" value="-mix" onclick="return switch_run_mode(this.value)"/>
Expand Down
6 changes: 3 additions & 3 deletions luci-app-openclash/po/zh-cn/openclash.zh-cn.po
Original file line number Diff line number Diff line change
Expand Up @@ -879,8 +879,8 @@ msgstr "Relay【嵌套中转】"
msgid "Other Group (Support Regex)"
msgstr "包含其他策略组(请勿重复添加,支持正则匹配)"

msgid "The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT'"
msgstr "注意:除'DIRECT''REJECT'外,修改配置文件前添加的其他策略组必须已创建"
msgid "The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT' & 'REJECT-DROP' & 'PASS' & 'GLOBAL'"
msgstr "注意:除'DIRECT''REJECT'、'REJECT-DROP'、'PASS'、'GLOBAL'外,修改配置文件前添加的其他策略组必须已创建"

msgid "The Added Proxy Provider Must Exist"
msgstr "修改配置文件前添加的代理集必须已创建"
Expand Down Expand Up @@ -1248,7 +1248,7 @@ msgstr "备份"
msgid "Enhance"
msgstr "增强"

msgid "Compatible"
msgid "Compat"
msgstr "兼容"

msgid "Mix"
Expand Down
Loading

0 comments on commit eae4107

Please sign in to comment.