diff --git a/.github/workflows/compile_meta_core.yml b/.github/workflows/compile_meta_core.yml index 625a5e033e..44ce664157 100644 --- a/.github/workflows/compile_meta_core.yml +++ b/.github/workflows/compile_meta_core.yml @@ -89,7 +89,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: "1.23" check-latest: true - name: Clone Clash Meta Repository diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index 492b948754..1eb71bcd1d 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.46.033 +PKG_VERSION:=0.46.050 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong @@ -27,6 +27,15 @@ define Package/$(PKG_NAME)/config config PACKAGE_iptables-mod-extra default y if ! PACKAGE_firewall4 + + config PACKAGE_dnsmasq_full_ipset + default y if ! PACKAGE_firewall4 + + config PACKAGE_dnsmasq_full_nftset + default y if PACKAGE_firewall4 + + config PACKAGE_ipset + default y if ! PACKAGE_firewall4 endef define Package/$(PKG_NAME) @@ -34,7 +43,7 @@ define Package/$(PKG_NAME) SUBMENU:=3. Applications TITLE:=LuCI support for clash PKGARCH:=all - DEPENDS:=+dnsmasq-full +coreutils +coreutils-nohup +bash +curl +ca-certificates +ipset +ip-full \ + DEPENDS:=+dnsmasq-full +coreutils +coreutils-nohup +bash +curl +ca-certificates +ip-full \ +libcap +libcap-bin +ruby +ruby-yaml +kmod-tun +unzip MAINTAINER:=vernesong endef @@ -64,9 +73,7 @@ define Build/Prepare cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_domain_dns.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_domain_dns.list" >/dev/null 2>&1 cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_domain_dns_policy.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_domain_dns_policy.list" >/dev/null 2>&1 cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_fallback_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_fallback_filter.yaml" >/dev/null 2>&1 - cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_force_sniffing_domain.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_force_sniffing_domain.yaml" >/dev/null 2>&1 - cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_sniffing_domain_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_sniffing_domain_filter.yaml" >/dev/null 2>&1 - cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_sniffing_ports_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_sniffing_ports_filter.yaml" >/dev/null 2>&1 + cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_sniffer.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_sniffer.yaml" >/dev/null 2>&1 cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_localnetwork_ipv4.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_localnetwork_ipv4.list" >/dev/null 2>&1 cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_localnetwork_ipv6.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_localnetwork_ipv6.list" >/dev/null 2>&1 cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_chnroute_pass.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_chnroute_pass.list" >/dev/null 2>&1 diff --git a/luci-app-openclash/luasrc/controller/openclash.lua b/luci-app-openclash/luasrc/controller/openclash.lua index 429abaa850..d65ad4a439 100644 --- a/luci-app-openclash/luasrc/controller/openclash.lua +++ b/luci-app-openclash/luasrc/controller/openclash.lua @@ -830,15 +830,12 @@ end function action_toolbar_show_sys() local pid = luci.sys.exec("pidof clash |head -1 |tr -d '\n' 2>/dev/null") - local mem, cpu + local cpu if pid and pid ~= "" then - mem = tonumber(luci.sys.exec(string.format("cat /proc/%s/status 2>/dev/null |grep -w VmRSS |awk '{print $2}'", pid))) cpu = luci.sys.exec(string.format("top -b -n1 |grep -E '%s' 2>/dev/null |grep -v grep |awk '{for (i=1;i<=NF;i++) {if ($i ~ /clash/) break; else cpu=i}}; {print $cpu}' 2>/dev/null", pid)) - if mem and cpu then - mem = fs.filesize(mem*1024) or "0 KB" + if cpu then cpu = string.match(cpu, "%d+") or "0" else - mem = "0 KB" cpu = "0" end else @@ -846,7 +843,6 @@ function action_toolbar_show_sys() end luci.http.prepare_content("application/json") luci.http.write_json({ - mem = mem, cpu = cpu; }) end diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/client.lua b/luci-app-openclash/luasrc/model/cbi/openclash/client.lua index f2d2b271f9..1893ddf44b 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/client.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/client.lua @@ -53,9 +53,9 @@ for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime) end if uci:get("openclash", "config", "config_path") and string.sub(uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then - e[t].state=translate("Enable") + e[t].state=translate("Enabled") else - e[t].state=translate("Disable") + e[t].state=translate("Disabled") end e[t].check=translate(config_check(o)) end @@ -75,7 +75,7 @@ if a then ck.template="openclash/cfg_check" sb.template="openclash/sub_info_show" - btnis=tb:option(Button,"switch",translate("Switch Config")) + btnis=tb:option(Button,"switch",translate("Switch")) btnis.template="openclash/other_button" btnis.render=function(o,t,a) if not e[t] then return false end @@ -172,4 +172,4 @@ if uci:get("openclash", "config", "dler_token") then return m, dler, form, s, ap, d else return m, form, s, ap, d -end \ No newline at end of file +end diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua b/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua index ab89f3a1a9..72b13a9156 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua @@ -33,7 +33,8 @@ if not lan_ip or lan_ip == "" then end m = Map("openclash", translate("Overwrite Settings")) m.pageaction = false -m.description = translate("Note: To restore the default configuration, try accessing:").." http://"..lan_ip.."/cgi-bin/luci/admin/services/openclash/restore" +m.description = translate("Note: To restore the default configuration, try accessing:").." http://"..lan_ip.."/cgi-bin/luci/admin/services/openclash/restore".. +"
"..font_green..translate("For More Useful Meta Core Functions Go Wiki")..": "..font_off..""..translate("https://wiki.metacubex.one/").."" s = m:section(TypedSection, "openclash") s.anonymous = true @@ -147,7 +148,7 @@ o = s:taboption("dns", Flag, "enable_custom_dns", font_red..bold_on..translate(" o.description = font_red..bold_on..translate("Set OpenClash Upstream DNS Resolve Server")..bold_off..font_off o.default = 0 -o = s:taboption("dns", Flag, "enable_respect_rules", font_red..bold_on..translate("Respect Rules")..bold_off..font_off) +o = s:taboption("dns", Flag, "enable_respect_rules", font_red..bold_on..translate("Respect Rules").."(respect-rules)"..bold_off..font_off) o.description = font_red..bold_on..translate("Whether or not The Connection to the DNS Server Follow the Rules in Config")..bold_off..font_off o.default = 0 @@ -292,14 +293,6 @@ o = s:taboption("meta", Flag, "enable_unified_delay", font_red..bold_on..transla o.description = font_red..bold_on..translate("Change The Delay Calculation Method To Remove Extra Delays Such as Handshaking")..bold_off..font_off o.default = "0" -o = s:taboption("meta", ListValue, "keep_alive_interval", font_red..bold_on..translate("TCP Keep-alive Interval(s)")..bold_off..font_off) -o.description = font_red..bold_on..translate("Change The TCP Keep-alive Interval, Selecting a Larger Value Avoids Abnormal Resource Consumption")..bold_off..font_off -o:value("0", translate("Disable")) -o:value("15") -o:value("1800") -o:value("3600") -o.default = "0" - o = s:taboption("meta", ListValue, "find_process_mode", translate("Enable Process Rule")) o.description = translate("Whether to Enable Process Rules, If You Are Not Sure, Please Choose off Which Useful in Router Environment") o:value("0", translate("Disable")) @@ -347,62 +340,21 @@ o.description = translate("Custom The Force and Skip Sniffing Doamin Lists") o.default = 0 o:depends("enable_meta_sniffer", "1") -sniffing_domain_force = s:taboption("meta", Value, "sniffing_domain_force") -sniffing_domain_force:depends("enable_meta_sniffer_custom", "1") -sniffing_domain_force.template = "cbi/tvalue" -sniffing_domain_force.description = translate("Will Override Dns Queries If Domains in The List") -sniffing_domain_force.rows = 20 -sniffing_domain_force.wrap = "off" - -function sniffing_domain_force.cfgvalue(self, section) - return NXFS.readfile("/etc/openclash/custom/openclash_force_sniffing_domain.yaml") or "" -end -function sniffing_domain_force.write(self, section, value) - if value then - value = value:gsub("\r\n?", "\n") - local old_value = NXFS.readfile("/etc/openclash/custom/openclash_force_sniffing_domain.yaml") - if value ~= old_value then - NXFS.writefile("/etc/openclash/custom/openclash_force_sniffing_domain.yaml", value) - end - end -end - -sniffing_port_filter = s:taboption("meta", Value, "sniffing_port_filter") -sniffing_port_filter:depends("enable_meta_sniffer_custom", "1") -sniffing_port_filter.template = "cbi/tvalue" -sniffing_port_filter.description = translate("Will Only Sniffing If Ports in The List") -sniffing_port_filter.rows = 20 -sniffing_port_filter.wrap = "off" - -function sniffing_port_filter.cfgvalue(self, section) - return NXFS.readfile("/etc/openclash/custom/openclash_sniffing_ports_filter.yaml") or "" -end -function sniffing_port_filter.write(self, section, value) - if value then - value = value:gsub("\r\n?", "\n") - local old_value = NXFS.readfile("/etc/openclash/custom/openclash_sniffing_ports_filter.yaml") - if value ~= old_value then - NXFS.writefile("/etc/openclash/custom/openclash_sniffing_ports_filter.yaml", value) - end - end -end - -sniffing_domain_filter = s:taboption("meta", Value, "sniffing_domain_filter") -sniffing_domain_filter:depends("enable_meta_sniffer_custom", "1") -sniffing_domain_filter.template = "cbi/tvalue" -sniffing_domain_filter.description = translate("Will Disable Sniffing If Domains(sni) in The List") -sniffing_domain_filter.rows = 20 -sniffing_domain_filter.wrap = "off" +sniffer_custom = s:taboption("meta", Value, "sniffer_custom") +sniffer_custom:depends("enable_meta_sniffer_custom", "1") +sniffer_custom.template = "cbi/tvalue" +sniffer_custom.rows = 20 +sniffer_custom.wrap = "off" -function sniffing_domain_filter.cfgvalue(self, section) - return NXFS.readfile("/etc/openclash/custom/openclash_sniffing_domain_filter.yaml") or "" +function sniffer_custom.cfgvalue(self, section) + return NXFS.readfile("/etc/openclash/custom/openclash_custom_sniffer.yaml") or "" end -function sniffing_domain_filter.write(self, section, value) +function sniffer_custom.write(self, section, value) if value then value = value:gsub("\r\n?", "\n") - local old_value = NXFS.readfile("/etc/openclash/custom/openclash_sniffing_domain_filter.yaml") + local old_value = NXFS.readfile("/etc/openclash/custom/openclash_custom_sniffer.yaml") if value ~= old_value then - NXFS.writefile("/etc/openclash/custom/openclash_sniffing_domain_filter.yaml", value) + NXFS.writefile("/etc/openclash/custom/openclash_custom_sniffer.yaml", value) end end end diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe.lua b/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe.lua index e8851f54c6..83ec183e13 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe.lua @@ -121,7 +121,7 @@ o = a:option(Button, "Commit", " ") o.inputtitle = translate("Commit Settings") o.inputstyle = "apply" o.write = function() - fs.unlink("/tmp/Proxy_Group") + fs.unlink("/tmp/Proxy_Group") m.uci:commit("openclash") end @@ -129,7 +129,7 @@ o = a:option(Button, "Apply", " ") o.inputtitle = translate("Update Config") o.inputstyle = "apply" o.write = function() - fs.unlink("/tmp/Proxy_Group") + fs.unlink("/tmp/Proxy_Group") m.uci:set("openclash", "config", "enable", 1) m.uci:commit("openclash") uci:foreach("openclash", "config_subscribe", diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/config.lua b/luci-app-openclash/luasrc/model/cbi/openclash/config.lua index 8ad341719d..0a682018a1 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/config.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/config.lua @@ -177,9 +177,9 @@ else e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime) end if uci:get("openclash", "config", "config_path") and string.sub(uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then - e[t].state=translate("Enable") + e[t].state=translate("Enabled") else - e[t].state=translate("Disable") + e[t].state=translate("Disabled") end e[t].size=fs.filesize(a.size) e[t].check=translate(config_check(o)) @@ -201,7 +201,7 @@ st.template="openclash/cfg_check" ck.template="openclash/cfg_check" sb.template="openclash/sub_info_show" -btnis=tb:option(Button,"switch",translate("Switch Config")) +btnis=tb:option(Button,"switch",translate("Switch")) btnis.template="openclash/other_button" btnis.render=function(o,t,a) if not e[t] then return false end diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/custom-dns-edit.lua b/luci-app-openclash/luasrc/model/cbi/openclash/custom-dns-edit.lua index 3e84bdacf0..8e33997192 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/custom-dns-edit.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/custom-dns-edit.lua @@ -59,7 +59,7 @@ o.rempty = false ---- interface o = s:option(Value, "interface", translate("Specific Interface")) -o.description = translate("DNS Lookup Only Through The Specific Interface")..translate("(Only TUN Core)") +o.description = translate("DNS Lookup Only Through The Specific Interface") local interfaces = SYS.exec("ls -l /sys/class/net/ 2>/dev/null |awk '{print $9}' 2>/dev/null") for interface in string.gmatch(interfaces, "%S+") do o:value(interface) @@ -68,6 +68,11 @@ o:value("Disable", translate("Disable")) o.default = "Disable" o.rempty = false +---- direct-nameserver +o = s:option(Flag, "direct_nameserver", translate("Direct Nameserver"), translate("Use For Domain Need Direct")..translate("(Only Meta Core)")) +o.rmempty = false +o.default = o.disbled + ---- Node Domain Resolve o = s:option(Flag, "node_resolve", translate("Node Domain Resolve"), translate("Use For Node Domain Resolve")..translate("(Only Meta Core)")) o.rmempty = false @@ -79,6 +84,12 @@ o:depends("type", "https") o.rmempty = false o.default = o.disbled +---- Skip-cert-verify +o = s:option(Flag, "skip_cert_verify", translate("skip-cert-verify"), translate("skip-cert-verify")..translate("(Only Meta Core)")) +o:depends("type", "https") +o.rmempty = false +o.default = o.disbled + ---- ECS Subnet o = s:option(Value, "ecs_subnet", translate("ECS Subnet"),translate("Specify the ECS Subnet Address")..translate("(Only Meta Core)")) o:depends("type", "https") diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua b/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua index f4d23afc5f..0de1378e1d 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua @@ -227,7 +227,7 @@ end o:value("DIRECT") o:value("REJECT") -o = s:option(ListValue, "OpenAI", translate("OpenAI")) +o = s:option(ListValue, "AI_Suite", translate("AI Suite")) o:depends("rule_name", "lhie1") o.rmempty = true for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do @@ -407,7 +407,7 @@ o:value("REJECT") end local t = { - {Commit, Back} + {Commit, Back} } a = m:section(Table, t) @@ -415,16 +415,16 @@ o = a:option(Button,"Commit", " ") o.inputtitle = translate("Commit Settings") o.inputstyle = "apply" o.write = function() - m.uci:commit(openclash) - --luci.http.redirect(m.redirect) + m.uci:commit(openclash) + --luci.http.redirect(m.redirect) end o = a:option(Button,"Back", " ") o.inputtitle = translate("Back Settings") o.inputstyle = "reset" o.write = function() - m.uci:revert(openclash, sid) - luci.http.redirect(m.redirect) + m.uci:revert(openclash, sid) + luci.http.redirect(m.redirect) end m:append(Template("openclash/toolbar_show")) diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-file-manage.lua b/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-file-manage.lua index 9dd0d9c123..c73689c89c 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-file-manage.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-file-manage.lua @@ -87,7 +87,7 @@ return r end local t = { - {Refresh, Create, Delete_all, Apply} + {Refresh, Create, Delete_all, Apply} } a = proxy_form:section(Table, t) diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/servers.lua b/luci-app-openclash/luasrc/model/cbi/openclash/servers.lua index 75cfebdbf8..3e28e08f6a 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/servers.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/servers.lua @@ -255,8 +255,6 @@ o = a:option(Button,"Load_Config", " ") o.inputtitle = translate("Read Config") o.inputstyle = "apply" o.write = function() - m.uci:set("openclash", "config", "enable", 0) - m.uci:commit("openclash") luci.sys.call("/usr/share/openclash/yml_groups_get.sh 2>/dev/null &") luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash")) end @@ -265,18 +263,14 @@ o = a:option(Button, "Commit", " ") o.inputtitle = translate("Commit Settings") o.inputstyle = "apply" o.write = function() - fs.unlink("/tmp/Proxy_Group") - m.uci:set("openclash", "config", "enable", 0) - m.uci:commit("openclash") + fs.unlink("/tmp/Proxy_Group") end o = a:option(Button, "Apply", " ") o.inputtitle = translate("Apply Settings") o.inputstyle = "apply" o.write = function() - fs.unlink("/tmp/Proxy_Group") - m.uci:set("openclash", "config", "enable", 0) - m.uci:commit("openclash") + fs.unlink("/tmp/Proxy_Group") luci.sys.call("/usr/share/openclash/yml_groups_set.sh >/dev/null 2>&1 &") luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash")) end diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua b/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua index 7ec44e2381..675d991479 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua @@ -1101,6 +1101,7 @@ o = s:taboption("ipv6", ListValue, "ipv6_mode", translate("IPv6 Proxy Mode")) o:value("0", translate("TProxy Mode")) o:value("1", translate("Redirect Mode")) o:value("2", translate("TUN Mode")..translate("(Only Meta Core)")) +o:value("3", translate("Mix Mode")..translate("(Only Meta Core)")) o.default = "0" o:depends("ipv6_enable", "1") @@ -1108,6 +1109,8 @@ o = s:taboption("ipv6", ListValue, "stack_type_v6", translate("Select Stack Type o.description = translate("Select Stack Type For TUN Mode, According To The Running Speed on Your Machine") o:depends({ipv6_mode= "2", en_mode = "redir-host"}) o:depends({ipv6_mode= "2", en_mode = "fake-ip"}) +o:depends({ipv6_mode= "3", en_mode = "redir-host"}) +o:depends({ipv6_mode= "3", en_mode = "fake-ip"}) o:value("system", translate("System ")) o:value("gvisor", translate("gVisor")) o:value("mixed", translate("Mixed")..translate("(Only Meta Core)")) diff --git a/luci-app-openclash/luasrc/view/openclash/cfg_check.htm b/luci-app-openclash/luasrc/view/openclash/cfg_check.htm index 0c7db10d56..1fc0496b73 100644 --- a/luci-app-openclash/luasrc/view/openclash/cfg_check.htm +++ b/luci-app-openclash/luasrc/view/openclash/cfg_check.htm @@ -2,7 +2,7 @@
<% local val = self:cfgvalue(section) - if val == translate("Enable") or val == translate("Config Normal") or val == translate("Exist") then + if val == translate("Enable") or val == translate("Enabled") or val == translate("Config Normal") or val == translate("Exist") then %>
<% diff --git a/luci-app-openclash/luasrc/view/openclash/config_editor.htm b/luci-app-openclash/luasrc/view/openclash/config_editor.htm index 99e8b86461..89a5f0f356 100644 --- a/luci-app-openclash/luasrc/view/openclash/config_editor.htm +++ b/luci-app-openclash/luasrc/view/openclash/config_editor.htm @@ -357,9 +357,7 @@ var myEditor_fake_filter = document.getElementById("cbid.openclash.config.custom_fake_filter"); var myEditor_custom_domain_dns = document.getElementById("cbid.openclash.config.custom_domain_dns"); var myEditor_edit_file = document.getElementById("cbid.openclash.config.edit_file"); -var myEditor_sniffing_domain_force = document.getElementById("cbid.openclash.config.sniffing_domain_force"); -var myEditor_sniffing_domain_filter = document.getElementById("cbid.openclash.config.sniffing_domain_filter"); -var myEditor_sniffing_port_filter = document.getElementById("cbid.openclash.config.sniffing_port_filter"); +var myEditor_custom_sniffer = document.getElementById("cbid.openclash.config.sniffer_custom"); if (myEditor_hosts) { editor(myEditor_hosts, 'false', '100%', '300px'); @@ -390,19 +388,10 @@ other_editor(myEditor_custom_domain_dns, 'false', '100%', '300px'); }; -if (myEditor_sniffing_domain_force) { - other_editor(myEditor_sniffing_domain_force, 'false', '100%', '300px'); +if (myEditor_custom_sniffer) { + other_editor(myEditor_custom_sniffer, 'false', '100%', '300px'); }; -if (myEditor_sniffing_domain_filter) { - other_editor(myEditor_sniffing_domain_filter, 'false', '100%', '300px'); -}; - -if (myEditor_sniffing_port_filter) { - other_editor(myEditor_sniffing_port_filter, 'false', '100%', '300px'); -}; - - var core_log = document.getElementById("core_log"); var oc_log = document.getElementById("cbid.openclash.config.clog"); if (core_log && oc_log) { diff --git a/luci-app-openclash/luasrc/view/openclash/log.htm b/luci-app-openclash/luasrc/view/openclash/log.htm index 0843805d90..3f41336fac 100644 --- a/luci-app-openclash/luasrc/view/openclash/log.htm +++ b/luci-app-openclash/luasrc/view/openclash/log.htm @@ -225,20 +225,20 @@ var cn = 0; var sn = 0; str.trim().split('\n').forEach(function(v, i) { - var regex = /"([^"]*)"/g; + var regex = /(time=)"([^"]*)"/g; var res = regex.exec(v); if (res) { - var dt = new Date(res[1]); + var dt = new Date(res[2]); } else { var dtt = new Date(v.substring(0,19)); } if (dt && dt != "Invalid Date"){ if (v.indexOf("level=") != -1) { - var log_info = v.substring(res[1].length + 7); + var log_info = v.substring(res[2].length + 7); } else { - var log_info = v.substring(res[1].length + 2); + var log_info = v.substring(res[2].length + 2); } cstrt[cn]=dt.getFullYear()+"-"+p(dt.getMonth()+1)+"-"+p(dt.getDate())+" "+p(dt.getHours())+":"+p(dt.getMinutes())+":"+p(dt.getSeconds())+log_info; cn = cn + 1; diff --git a/luci-app-openclash/luasrc/view/openclash/myip.htm b/luci-app-openclash/luasrc/view/openclash/myip.htm index 1c5bb255a1..db4be40f24 100644 --- a/luci-app-openclash/luasrc/view/openclash/myip.htm +++ b/luci-app-openclash/luasrc/view/openclash/myip.htm @@ -303,7 +303,7 @@ if (localStorage.getItem('privacy_my_ip') != 'true') { $$.getElementById('ip-upaiyun').innerHTML = resp.data.remote_addr; }; - $$.getElementById('ip-upaiyun-geo').innerHTML = resp.data.remote_addr_location.country + resp.data.remote_addr_location.province + resp.data.remote_addr_location.city + ' ' + resp.data.remote_addr_location.isp; + $$.getElementById('ip-upaiyun-geo').innerHTML = resp.data.remote_addr_location.country + ' ' + resp.data.remote_addr_location.province + ' ' + resp.data.remote_addr_location.city + ' ' + resp.data.remote_addr_location.isp; //IP.parseIPIpip(resp.data.remote_addr, 'ip-upaiyun-geo'); addTitleOnOverflow(); }) @@ -379,7 +379,7 @@ if (localStorage.getItem('privacy_my_ip') != 'true') { $$.getElementById('ip-pcol').innerHTML = data.ip; }; - $$.getElementById('ip-pcol-geo').innerHTML = `${data.pro}${data.city}${data.region} ${pcisp[1]}`; + $$.getElementById('ip-pcol-geo').innerHTML = `${data.pro} ${data.city} ${data.region} ${pcisp[1]}`; addTitleOnOverflow(); }; diff --git a/luci-app-openclash/luasrc/view/openclash/status.htm b/luci-app-openclash/luasrc/view/openclash/status.htm index 132583a645..07fad12567 100644 --- a/luci-app-openclash/luasrc/view/openclash/status.htm +++ b/luci-app-openclash/luasrc/view/openclash/status.htm @@ -1,6 +1,14 @@