mirror of
https://github.com/kenzok8/openwrt-packages.git
synced 2025-01-09 12:07:32 +08:00
update 2023-03-14 14:21:31
This commit is contained in:
parent
81ea3fc4e4
commit
fab8bab987
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-openclash
|
||||
PKG_VERSION:=0.45.100
|
||||
PKG_VERSION:=0.45.103
|
||||
PKG_RELEASE:=beta
|
||||
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
|
||||
|
||||
|
@ -288,6 +288,18 @@ o:value("360", translate("360"))
|
||||
o:value("qq", translate("QQ"))
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", ListValue, "geodata_loader", translate("Geodata Loader Mode"))
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("memconservative", translate("Memconservative"))
|
||||
o:value("standard", translate("Standard"))
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", ListValue, "enable_geoip_dat", translate("Enable GeoIP Dat"))
|
||||
o.description = translate("Replace GEOIP MMDB With GEOIP Dat, Large Size File")..", "..font_red..bold_on..translate("Need Download First")..bold_off..font_off
|
||||
o.default = 0
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("1", translate("Enable"))
|
||||
|
||||
o = s:taboption("meta", Flag, "enable_meta_sniffer", font_red..bold_on..translate("Enable Sniffer")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Sniffer Will Prevent Domain Name Proxy and DNS Hijack Failure")..bold_off..font_off
|
||||
o.default = 1
|
||||
@ -302,7 +314,7 @@ 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", translate("Force Sniffing Domains Lists"))
|
||||
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")
|
||||
@ -322,7 +334,7 @@ function sniffing_domain_force.write(self, section, value)
|
||||
end
|
||||
end
|
||||
|
||||
sniffing_port_filter = s:taboption("meta", Value, "sniffing_port_filter", translate("Sniffing Ports Filter"))
|
||||
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")
|
||||
@ -342,7 +354,7 @@ function sniffing_port_filter.write(self, section, value)
|
||||
end
|
||||
end
|
||||
|
||||
sniffing_domain_filter = s:taboption("meta", Value, "sniffing_domain_filter", translate("Force Sniffing Domains(sni) Filter"))
|
||||
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")
|
||||
@ -362,18 +374,6 @@ function sniffing_domain_filter.write(self, section, value)
|
||||
end
|
||||
end
|
||||
|
||||
o = s:taboption("meta", ListValue, "geodata_loader", translate("Geodata Loader Mode"))
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("memconservative", translate("Memconservative"))
|
||||
o:value("standard", translate("Standard"))
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", ListValue, "enable_geoip_dat", translate("Enable GeoIP Dat"))
|
||||
o.description = translate("Replace GEOIP MMDB With GEOIP Dat, Large Size File")..", "..font_red..bold_on..translate("Need Download First")..bold_off..font_off
|
||||
o.default = 0
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("1", translate("Enable"))
|
||||
|
||||
---- Rules Settings
|
||||
o = s:taboption("rules", Flag, "rule_source", translate("Enable Other Rules"))
|
||||
o.description = translate("Use Other Rules")
|
||||
|
@ -85,7 +85,7 @@ end
|
||||
|
||||
---- subconverter
|
||||
o = s:option(Flag, "sub_convert", translate("Subscribe Convert Online"))
|
||||
o.description = translate("Convert Subscribe Online With Template, Mix Proxies and Keep Settings options Will Not Effect")
|
||||
o.description = translate("Convert Subscribe Online With Template")
|
||||
o.default = 0
|
||||
|
||||
---- Convert Address
|
||||
|
@ -391,7 +391,7 @@ local tab = {
|
||||
}
|
||||
|
||||
s = m:section(Table, tab)
|
||||
s.description = align_mid..translate("Support syntax check, press").." "..font_green..bold_on.."F11"..bold_off..font_off.." "..translate("to enter full screen editing mode")..align_mid_off
|
||||
s.description = align_mid..translate("Support syntax check, press").." "..font_green..bold_on.."F10"..bold_off..font_off.." "..translate("to control diff option, press").." "..font_green..bold_on.."F11"..bold_off..font_off.." "..translate("to enter full screen editing mode")..align_mid_off
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
@ -403,7 +403,7 @@ if not conf_name then conf_name = "config.yaml" end
|
||||
local sconf = "/etc/openclash/"..conf_name
|
||||
|
||||
sev = s:option(TextValue, "user")
|
||||
sev.description = align_mid..translate("Modify Your Config file:").." "..font_green..bold_on..conf_name..bold_off..font_off.." "..translate("Here, Except The Settings That Were Taken Over")..align_mid_off
|
||||
---sev.description = align_mid..translate("Modify Your Config file:").." "..font_green..bold_on..conf_name..bold_off..font_off.." "..translate("Here, Except The Settings That Were Taken Over")..align_mid_off
|
||||
sev.rows = 40
|
||||
sev.wrap = "off"
|
||||
sev.cfgvalue = function(self, section)
|
||||
@ -421,9 +421,9 @@ end
|
||||
|
||||
def = s:option(TextValue, "default")
|
||||
if fs.isfile(sconf) then
|
||||
def.description = align_mid..translate("Config File Edited By OpenClash For Running")..align_mid_off
|
||||
---def.description = align_mid..translate("Config File Edited By OpenClash For Running")..align_mid_off
|
||||
else
|
||||
def.description = align_mid..translate("Default Config File With Correct Template")..align_mid_off
|
||||
---def.description = align_mid..translate("Default Config File With Correct Template")..align_mid_off
|
||||
end
|
||||
def.rows = 40
|
||||
def.wrap = "off"
|
||||
@ -445,7 +445,7 @@ o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:commit("openclash")
|
||||
uci:commit("openclash")
|
||||
end
|
||||
|
||||
o = a:option(DummyValue, "Create", " ")
|
||||
@ -458,10 +458,10 @@ o.inputtitle = translate("Apply Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
m:append(Template("openclash/config_editor"))
|
||||
|
@ -396,8 +396,8 @@ o:depends("type", "snell")
|
||||
|
||||
o = s:option(ListValue, "obfs_vless", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o.default = "tcp"
|
||||
o:value("tcp", translate("tcp"))
|
||||
o:value("ws", translate("websocket (ws)"))
|
||||
o:value("grpc", translate("grpc"))
|
||||
o:depends("type", "vless")
|
||||
@ -475,6 +475,37 @@ o.placeholder = translate("Host: v2ray.com")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
o:depends("obfs_vless", "ws")
|
||||
|
||||
o = s:option(Value, "vless_flow", translate("flow"))
|
||||
o.rmempty = true
|
||||
o.default = "xtls-rprx-direct"
|
||||
o:value("xtls-rprx-direct")
|
||||
o:value("xtls-rprx-origin")
|
||||
o:value("xtls-rprx-vision")
|
||||
o:depends("obfs_vless", "tcp")
|
||||
|
||||
-- [[ grpc ]]--
|
||||
o = s:option(Value, "grpc_service_name", translate("grpc-service-name"))
|
||||
o.rmempty = true
|
||||
o.datatype = "host"
|
||||
o.placeholder = translate("example")
|
||||
o:depends("obfs_trojan", "grpc")
|
||||
o:depends("obfs_vmess", "grpc")
|
||||
o:depends("obfs_vless", "grpc")
|
||||
|
||||
-- [[ reality-public-key ]]--
|
||||
o = s:option(Value, "reality_public_key", translate("public-key(reality)"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("CrrQSjAG_YkHLwvM2M-7XkKJilgL5upBKCp0od0tLhE")
|
||||
o:depends("obfs_vless", "grpc")
|
||||
o:depends("obfs_vless", "tcp")
|
||||
|
||||
-- [[ reality-short-id ]]--
|
||||
o = s:option(Value, "reality_short_id", translate("short-id(reality)"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("10f897e26c4b9478")
|
||||
o:depends("obfs_vless", "grpc")
|
||||
o:depends("obfs_vless", "tcp")
|
||||
|
||||
o = s:option(Value, "max_early_data", translate("max-early-data"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("2048")
|
||||
@ -523,14 +554,6 @@ o:depends({obfs_vmess = "grpc", tls = "true"})
|
||||
o:depends({obfs_vmess = "none", tls = "true"})
|
||||
o:depends("type", "vless")
|
||||
|
||||
o = s:option(Value, "vless_flow", translate("flow"))
|
||||
o.rmempty = true
|
||||
o.default = "xtls-rprx-direct"
|
||||
o:value("xtls-rprx-direct")
|
||||
o:value("xtls-rprx-origin")
|
||||
o:value("xtls-rprx-vision")
|
||||
o:depends("obfs_vless", "none")
|
||||
|
||||
o = s:option(Value, "keep_alive", translate("keep-alive"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
@ -588,15 +611,6 @@ o:value("h3")
|
||||
o:value("h2")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ grpc ]]--
|
||||
o = s:option(Value, "grpc_service_name", translate("grpc-service-name"))
|
||||
o.rmempty = true
|
||||
o.datatype = "host"
|
||||
o.placeholder = translate("example")
|
||||
o:depends("obfs_trojan", "grpc")
|
||||
o:depends("obfs_vmess", "grpc")
|
||||
o:depends("obfs_vless", "grpc")
|
||||
|
||||
-- [[ trojan-ws-path ]]--
|
||||
o = s:option(Value, "trojan_ws_path", translate("Path"))
|
||||
o.rmempty = true
|
||||
|
@ -5,6 +5,26 @@
|
||||
line-height: 150%;
|
||||
resize: both !important;
|
||||
}
|
||||
.CodeMirror-merge-r-chunk {
|
||||
background: #0095ff2e !important;
|
||||
}
|
||||
.CodeMirror-merge-r-chunk-end {
|
||||
border-bottom: unset !important;
|
||||
}
|
||||
.CodeMirror-merge-r-chunk-start {
|
||||
border-top: unset !important;
|
||||
}
|
||||
.CodeMirror-merge-2pane .CodeMirror-merge-gap {
|
||||
height: 700px !important;
|
||||
}
|
||||
.CodeMirror-merge-r-connect {
|
||||
fill: #0095ff2e !important;
|
||||
stroke: #0095ff2e !important;
|
||||
}
|
||||
.CodeMirror-vscrollbar-oc {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/lib/codemirror.css"/>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/material.css"/>
|
||||
@ -34,8 +54,125 @@
|
||||
<script src="/luci-static/resources/openclash/addon/scroll/annotatescrollbar.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/search/matchesonscrollbar.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/search/jump-to-line.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/merge/diff_match_patch.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/merge/merge.js"></script>
|
||||
<link rel=stylesheet href="/luci-static/resources/openclash/addon/merge/merge.css">
|
||||
|
||||
<%-
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local conf = uci:get("openclash", "config", "config_path")
|
||||
if not conf then conf = "/etc/openclash/config/config.yaml" end
|
||||
local conf_name = fs.basename(conf)
|
||||
if not conf_name then conf_name = "config.yaml" end
|
||||
local sconf = "/etc/openclash/"..conf_name
|
||||
-%>
|
||||
|
||||
<table id="my_editor_div" style="width: 100%; text-align: center; display: none;">
|
||||
<tr>
|
||||
<td style="width: 50%; overflow: hidden;"><%:Modify Your Config file:%> <b style=color:green><%=conf_name%></b> <%:Here, Except The Settings That Were Taken Over%></td>
|
||||
|
||||
<%-
|
||||
if fs.isfile(sconf) then
|
||||
-%>
|
||||
<td style="width: 50%; overflow: hidden;"><%:Config File Edited By OpenClash For Running%></td>
|
||||
<%-
|
||||
else
|
||||
-%>
|
||||
<td style="width: 50%; overflow: hidden;"><%:Default Config File With Correct Template%></td>
|
||||
<%-
|
||||
end
|
||||
-%>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function merge_editor(id, id2, target, target2, readOnly, readOnly2, wid, height)
|
||||
{
|
||||
var value, orig1, orig2, merge_editor, descr, gap, vscrollbar, vscrollbar_oc, panes = 2, highlight = true, connect = null, collapse = false;
|
||||
descr = document.getElementById("my_editor_div");
|
||||
target.parentNode.parentNode.parentNode.insertBefore(descr, target.parentNode.parentNode);
|
||||
descr.style.display="inline-table"
|
||||
value = id.value;
|
||||
if (value == null) {
|
||||
editor(id, readOnly, wid, height);
|
||||
editor(id2, readOnly2, wid, height);
|
||||
}
|
||||
else {
|
||||
target2.parentNode.style.display="none";
|
||||
orig1 = '';
|
||||
orig2 = id2.value;
|
||||
target.style.height= "700px"
|
||||
id.style.display = "none";
|
||||
id2.style.display = "none";
|
||||
merge_editor = CodeMirror.MergeView(target, {
|
||||
mode: "text/yaml",
|
||||
value: value,
|
||||
origLeft: panes == 3 ? orig1 : null,
|
||||
orig: orig2,
|
||||
theme: "material",
|
||||
lineNumbers: true,
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
lint: true,
|
||||
highlightDifferences: highlight,
|
||||
connect: connect,
|
||||
collapseIdentical: collapse,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter", "CodeMirror-lint-markers"],
|
||||
extraKeys: {
|
||||
"F10": function() {
|
||||
merge_editor.setShowDifferences(highlight = !highlight);
|
||||
},
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
gap = document.getElementsByClassName("CodeMirror-merge-gap")[0];
|
||||
vscrollbar = document.getElementsByClassName("CodeMirror-vscrollbar")[0];
|
||||
vscrollbar_oc = document.getElementsByClassName("CodeMirror-vscrollbar-oc")[0];
|
||||
if (cm.getOption("fullScreen")) {
|
||||
console.log(gap.style.display)
|
||||
gap.style.display = "none";
|
||||
vscrollbar.className = "CodeMirror-vscrollbar-oc";
|
||||
}
|
||||
else {
|
||||
gap.style.display = "";
|
||||
vscrollbar_oc.className = "CodeMirror-vscrollbar";
|
||||
};
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
gap = document.getElementsByClassName("CodeMirror-merge-gap")[0];
|
||||
vscrollbar = document.getElementsByClassName("CodeMirror-vscrollbar")[0];
|
||||
vscrollbar_oc = document.getElementsByClassName("CodeMirror-vscrollbar-oc")[0];
|
||||
if (cm.getOption("fullScreen")) {
|
||||
cm.setOption("fullScreen", false);
|
||||
gap.style.display = "";
|
||||
vscrollbar_oc.className = "CodeMirror-vscrollbar";
|
||||
};
|
||||
},
|
||||
"Tab": function(cm) {
|
||||
if (cm.somethingSelected()) {
|
||||
cm.indentSelection('add')
|
||||
} else {
|
||||
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
|
||||
cm.replaceSelection(spaces)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
merge_editor.edit.on("change", function(cm) {
|
||||
id.value = cm.getValue();
|
||||
});
|
||||
|
||||
if (wid && height) {
|
||||
merge_editor.editor().setSize(wid, height);
|
||||
merge_editor.rightOriginal().setSize(wid, height);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
function editor(id, readOnly, wid, height)
|
||||
{
|
||||
var editor = CodeMirror.fromTextArea(id, {
|
||||
@ -76,7 +213,7 @@ function editor(id, readOnly, wid, height)
|
||||
};
|
||||
};
|
||||
|
||||
function shell_editor(id, readOnly)
|
||||
function shell_editor(id, readOnly, wid, height)
|
||||
{
|
||||
var editor = CodeMirror.fromTextArea(id, {
|
||||
mode: "shell",
|
||||
@ -105,9 +242,13 @@ function shell_editor(id, readOnly)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (wid && height) {
|
||||
editor.setSize(wid, height);
|
||||
};
|
||||
};
|
||||
|
||||
function other_editor(id, readOnly)
|
||||
function other_editor(id, readOnly, wid, height)
|
||||
{
|
||||
var editor = CodeMirror.fromTextArea(id, {
|
||||
mode: "lua",
|
||||
@ -136,6 +277,10 @@ function other_editor(id, readOnly)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (wid && height) {
|
||||
editor.setSize(wid, height);
|
||||
};
|
||||
};
|
||||
|
||||
function other_log_area(id, readOnly, wid, height)
|
||||
@ -174,22 +319,29 @@ function other_log_area(id, readOnly, wid, height)
|
||||
var custom_firewall = document.getElementById("cbid.openclash.config.firewall_custom");
|
||||
var custom_ymchange = document.getElementById("cbid.openclash.config.ymchange_custom");
|
||||
if (custom_firewall) {
|
||||
shell_editor(custom_firewall, 'false');
|
||||
shell_editor(custom_firewall, 'false', "100%", '300px');
|
||||
};
|
||||
|
||||
if (custom_ymchange) {
|
||||
shell_editor(custom_ymchange, 'false');
|
||||
shell_editor(custom_ymchange, 'false', "100%", '300px');
|
||||
};
|
||||
|
||||
var myEditor_use = document.getElementById("cbid.table.1.user");
|
||||
var myEditor_def = document.getElementById("cbid.table.1.default");
|
||||
|
||||
if (myEditor_use && myEditor_def) {
|
||||
var myEditor_use_wid = document.getElementById("cbi-table-1-user").offsetWidth;
|
||||
var myEditor_def_wid = document.getElementById("cbi-table-1-default").offsetWidth;
|
||||
var myEditor_div_use = document.getElementById("cbi-table-1-user");
|
||||
var myEditor_div_def = document.getElementById("cbi-table-1-default");
|
||||
|
||||
myEditor_div_def.parentNode.parentNode.style.cssText="text-align: left !important"
|
||||
myEditor_div_def.parentNode.className='cbi-value';
|
||||
myEditor_div_def.parentNode.style.display="revert"
|
||||
myEditor_div_def.parentNode.style.width="100%"
|
||||
|
||||
editor(myEditor_use, 'false', myEditor_use_wid, '700px');
|
||||
editor(myEditor_def, 'true', myEditor_def_wid, '700px');
|
||||
myEditor_div_use.parentNode.className='cbi-value';
|
||||
myEditor_div_use.parentNode.style.display="revert"
|
||||
myEditor_div_use.parentNode.style.width="100%"
|
||||
merge_editor(myEditor_use, myEditor_def, myEditor_div_use, myEditor_div_def, 'true', 'false', 'auto', '700px');
|
||||
};
|
||||
|
||||
var myEditor_hosts = document.getElementById("cbid.openclash.config.custom_hosts");
|
||||
@ -205,38 +357,44 @@ var myEditor_sniffing_domain_filter = document.getElementById("cbid.openclash.co
|
||||
var myEditor_sniffing_port_filter = document.getElementById("cbid.openclash.config.sniffing_port_filter");
|
||||
|
||||
if (myEditor_hosts) {
|
||||
editor(myEditor_hosts, 'false');
|
||||
editor(myEditor_hosts, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_edit_file) {
|
||||
editor(myEditor_edit_file, 'false', "auto", '700px');
|
||||
editor(myEditor_edit_file, 'false', '100%', '700px');
|
||||
};
|
||||
|
||||
if (myEditor_fall_fil) {
|
||||
editor(myEditor_fall_fil, 'false');
|
||||
editor(myEditor_name_pol, 'false');
|
||||
editor(myEditor_name_cus_r1, 'false');
|
||||
editor(myEditor_name_cus_r2, 'false');
|
||||
editor(myEditor_fall_fil, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_name_pol) {
|
||||
editor(myEditor_name_pol, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_name_cus_r1) {
|
||||
editor(myEditor_name_cus_r1, 'false', '100%', '300px');
|
||||
editor(myEditor_name_cus_r2, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_fake_filter) {
|
||||
other_editor(myEditor_fake_filter, 'false');
|
||||
other_editor(myEditor_fake_filter, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_custom_domain_dns) {
|
||||
other_editor(myEditor_custom_domain_dns, 'false');
|
||||
other_editor(myEditor_custom_domain_dns, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_sniffing_domain_force) {
|
||||
other_editor(myEditor_sniffing_domain_force, 'false');
|
||||
other_editor(myEditor_sniffing_domain_force, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_sniffing_domain_filter) {
|
||||
other_editor(myEditor_sniffing_domain_filter, 'false');
|
||||
other_editor(myEditor_sniffing_domain_filter, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_sniffing_port_filter) {
|
||||
other_editor(myEditor_sniffing_port_filter, 'false');
|
||||
other_editor(myEditor_sniffing_port_filter, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
|
||||
@ -282,9 +440,9 @@ if (core_log && oc_log) {
|
||||
}
|
||||
}
|
||||
});
|
||||
core_editor.setSize("auto", "540px");
|
||||
core_editor.setSize("100%", "540px");
|
||||
core_editor.setOption("readOnly","true");
|
||||
oc_editor.setSize("auto", "540px");
|
||||
oc_editor.setSize("100%", "540px");
|
||||
oc_editor.setOption("readOnly","true");
|
||||
};
|
||||
|
||||
@ -293,6 +451,7 @@ var rule_mg = document.getElementById('cbi-table-1-rule_mg');
|
||||
var game_mg = document.getElementById('cbi-table-1-game_mg');
|
||||
var Commit = document.getElementById('cbi-table-1-Commit');
|
||||
var Apply = document.getElementById('cbi-table-1-Apply');
|
||||
var Create = document.getElementById('cbi-table-1-Create');
|
||||
|
||||
if (proxy_mg) {
|
||||
proxy_mg.style.textAlign="center";
|
||||
@ -300,6 +459,7 @@ if (proxy_mg) {
|
||||
game_mg.style.textAlign="center";
|
||||
Commit.style.textAlign="center";
|
||||
Apply.style.textAlign="center";
|
||||
Create.style.textAlign="center";
|
||||
};
|
||||
//]]>
|
||||
</script>
|
@ -15,41 +15,45 @@ ul{
|
||||
}
|
||||
|
||||
#tab-header{
|
||||
background-color: #F7F7F7;
|
||||
height: 33px;
|
||||
min-height: 35px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
#tab-header ul{
|
||||
width: 500px;
|
||||
position: absolute;
|
||||
left: -1px;
|
||||
width: 100%;
|
||||
padding: unset !important;
|
||||
margin: unset !important;
|
||||
}
|
||||
#tab-header ul li{
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 33px;
|
||||
line-height: 33px;
|
||||
width: 160px;
|
||||
line-height: 35px;
|
||||
padding: 0 1px;
|
||||
border-bottom: 1px solid #dddddd;
|
||||
border-right: 1px solid #dddddd;
|
||||
cursor: pointer;
|
||||
}
|
||||
#tab-header ul li.selected{
|
||||
background-color: white;
|
||||
#tab-header ul li a{
|
||||
float: unset !important;
|
||||
padding: unset !important;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
#tab-header ul li.cbi-tab > a{
|
||||
font-weight: bolder;
|
||||
border-bottom: 0;
|
||||
border-right: 1px solid #dddddd;
|
||||
padding: 0;
|
||||
color: unset;
|
||||
}
|
||||
|
||||
#tab-header ul li:hover{
|
||||
#tab-header ul li a:hover{
|
||||
color: orangered;
|
||||
}
|
||||
|
||||
#tab-content .dom{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tab-content .dom ul li{
|
||||
float: left;
|
||||
margin: 15px 10px;
|
||||
@ -85,11 +89,11 @@ ul{
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div id="tab">
|
||||
<div id="tab-header">
|
||||
<ul>
|
||||
<li name="tab-header" class="selected"><%:OpenClash Log%></li>
|
||||
<li name="tab-header"><%:Core Log%></li>
|
||||
<div id="tab" class="cbi-section">
|
||||
<div id="tab-header" class="cbi-tabmenu">
|
||||
<ul class="cbi-tabmenu">
|
||||
<li name="tab-header" class="cbi-tab"><a><%:OpenClash Log%></a></li>
|
||||
<li name="tab-header" class="cbi-tab-disabled"><a><%:Core Log%></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="tab-content">
|
||||
@ -114,8 +118,8 @@ ul{
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<fieldset style="text-align: center; width: 100%" class="cbi-section">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="text-align: center; width: 25%">
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" id="stop_refresh_button" value="<%:Stop Refresh Log%>" onclick=" return stop_refresh() "/>
|
||||
@ -140,10 +144,6 @@ var s;
|
||||
var log_len = 0;
|
||||
var lv = document.getElementById('cbid.openclash.config.clog');
|
||||
var cl = document.getElementById('core_log');
|
||||
document.getElementById('stop_refresh_button').style.textAlign="center";
|
||||
document.getElementById('start_refresh_button').style.textAlign="center";
|
||||
document.getElementById('del_log_button').style.textAlign="center";
|
||||
document.getElementById('down_log_button').style.textAlign="center";
|
||||
|
||||
function get_log_level() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "log_level")%>', null, function(x, status) {
|
||||
@ -291,18 +291,18 @@ window.onload = function(){
|
||||
li.id = i;
|
||||
li.onclick = function(){
|
||||
for(var j=0; j<titles.length; j++){
|
||||
titles[j].className = '';
|
||||
titles[j].className = 'cbi-tab-disabled';
|
||||
divs[j].style.display = 'none';
|
||||
}
|
||||
this.className = 'selected';
|
||||
this.className = 'cbi-tab';
|
||||
divs[this.id].style.display = 'block';
|
||||
}
|
||||
li.onTouchStart = function(){
|
||||
for(var j=0; j<titles.length; j++){
|
||||
titles[j].className = '';
|
||||
titles[j].className = 'cbi-tab-disabled';
|
||||
divs[j].style.display = 'none';
|
||||
}
|
||||
this.className = 'selected';
|
||||
this.className = 'cbi-tab';
|
||||
divs[this.id].style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,10 @@
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.sub_div{
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<%
|
||||
@ -39,7 +43,7 @@
|
||||
local filename = fs.filename(val)
|
||||
local idname = math.random(1000)..(string.match(filename, "[%w_]+") or "")
|
||||
%>
|
||||
<div><span id='<%=idname%>' class="sub_tab"></span> <span class="sub_setting"><img src='/luci-static/resources/openclash/img/arrow-clockwise-light.svg' height="20px" title='<%:Refresh%>' alt='<%:Refresh%>' onclick='return sub_info_refresh_<%=idname%>(this)'></span> <span class="sub_setting"><img src='/luci-static/resources/openclash/img/wrench-light.svg' height="20px" title='<%:Specify URL%>' alt='<%:Specify URL%>' onclick='return set_subinfo_url_<%=idname%>(this,"<%=filename%>")'></span><div>
|
||||
<div class="sub_div"><span id='<%=idname%>' class="sub_tab"></span> <span class="sub_setting"><img src='/luci-static/resources/openclash/img/arrow-clockwise-light.svg' height="20px" title='<%:Refresh%>' alt='<%:Refresh%>' onclick='return sub_info_refresh_<%=idname%>(this)'></span> <span class="sub_setting"><img src='/luci-static/resources/openclash/img/wrench-light.svg' height="20px" title='<%:Specify URL%>' alt='<%:Specify URL%>' onclick='return set_subinfo_url_<%=idname%>(this,"<%=filename%>")'></span></div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
|
@ -18,6 +18,19 @@ function width(o)
|
||||
return ''
|
||||
end
|
||||
|
||||
function table_include(table, value)
|
||||
if table == nil then
|
||||
return false
|
||||
end
|
||||
|
||||
for k, v in pairs(table) do
|
||||
if v == value then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local head_width
|
||||
local a={}
|
||||
local e={}
|
||||
@ -29,7 +42,9 @@ for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(e, 1, {name="ALL"})
|
||||
if not table_include(e, "all") then
|
||||
table.insert(e, 1, {name="all"})
|
||||
end
|
||||
|
||||
if #e > 4 then
|
||||
head_width = (95 / #e).."%"
|
||||
@ -53,7 +68,7 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%>{
|
||||
height: 40px;
|
||||
min-height: 35px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
@ -62,25 +77,33 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul{
|
||||
position: absolute;
|
||||
left: -1px;
|
||||
width: 100%;
|
||||
padding: unset !important;
|
||||
margin: unset !important;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li{
|
||||
float: left;
|
||||
width: <%=head_width%>;
|
||||
line-height: 40px;
|
||||
line-height: 35px;
|
||||
padding: 0 1px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
border-bottom: 1px solid #dddddd;
|
||||
border-right: 1px solid #dddddd;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a{
|
||||
float: unset !important;;
|
||||
float: unset !important;
|
||||
padding: unset !important;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab > a{
|
||||
font-weight: bolder;
|
||||
color: unset;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a:hover{
|
||||
@ -108,7 +131,7 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
<%- end -%>
|
||||
<div class="cbi-section-descr"><%=self.description%></div>
|
||||
<%- local count = 0 -%>
|
||||
<div id="tab-header-<%=self.config%>-<%=self.sectiontype%>">
|
||||
<div id="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tabmenu">
|
||||
<ul class="cbi-tabmenu">
|
||||
<%-
|
||||
if #e ~= 1 then
|
||||
@ -116,8 +139,10 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
if o.name == cfg_name and cfg_name then
|
||||
-%>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a><%=o.name%></a></li>
|
||||
<%- elseif not cfg_name and o.name == "ALL" then -%>
|
||||
<%- elseif not cfg_name and o.name == "all" then -%>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a>ALL</a></li>
|
||||
<%- elseif o.name == "all" then -%>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled"><a>ALL</a></li>
|
||||
<%- else -%>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled"><a><%=o.name%></a></li>
|
||||
<%- end -%>
|
||||
@ -132,6 +157,8 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
if #e ~= 1 and o.name == cfg_name and cfg_name then
|
||||
-%>
|
||||
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
|
||||
<%- elseif #e ~= 1 and o.name == "all" and not cfg_name then -%>
|
||||
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
|
||||
<%- elseif #e == 1 then -%>
|
||||
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
|
||||
<%- else -%>
|
||||
@ -178,10 +205,12 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
for i, k in ipairs(self:cfgsections()) do
|
||||
section = k
|
||||
while true do
|
||||
if o.name ~= "ALL" then
|
||||
if uci:get("openclash", section, "config") ~= o.name then
|
||||
break
|
||||
end
|
||||
if not uci:get("openclash", section, "config") then
|
||||
uci:set("openclash", section, "config", "all")
|
||||
uci:save("openclash")
|
||||
end
|
||||
if uci:get("openclash", section, "config") ~= o.name then
|
||||
break
|
||||
end
|
||||
isempty = false
|
||||
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
|
||||
@ -322,7 +351,6 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
this.className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[this.id].style.display = 'block';
|
||||
localStorage.setItem("titles<%=sectiontype%>",this.id);
|
||||
localStorage.setItem("id<%=sectiontype%>","cbi-<%=self.config%>-<%=self.sectiontype%>");
|
||||
};
|
||||
|
||||
li<%=sectiontype%>.onTouchStart = function(){
|
||||
@ -333,7 +361,6 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
this.className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[this.id].style.display = 'block';
|
||||
localStorage.setItem("titles<%=sectiontype%>",this.id);
|
||||
localStorage.setItem("id<%=sectiontype%>","cbi-<%=self.config%>-<%=self.sectiontype%>");
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%>{
|
||||
height: 35px;
|
||||
min-height: 35px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
@ -44,9 +44,10 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul{
|
||||
position: absolute;
|
||||
left: -1px;
|
||||
width: 100%;
|
||||
padding: unset !important;
|
||||
margin: unset !important;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li{
|
||||
@ -54,15 +55,22 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
width: 160px;
|
||||
line-height: 35px;
|
||||
padding: 0 1px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
border-bottom: 1px solid #dddddd;
|
||||
border-right: 1px solid #dddddd;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a{
|
||||
float: unset !important;;
|
||||
float: unset !important;
|
||||
padding: unset !important;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab > a{
|
||||
font-weight: bolder;
|
||||
color: unset;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a:hover{
|
||||
@ -90,7 +98,7 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
<%- end -%>
|
||||
<div class="cbi-section-descr"><%=self.description%></div>
|
||||
<%- local count = 0 -%>
|
||||
<div id="tab-header-<%=self.config%>-<%=self.sectiontype%>">
|
||||
<div id="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tabmenu">
|
||||
<ul class="cbi-tabmenu">
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a>NameServer</a></li>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled"><a>FallBack</a></li>
|
||||
@ -288,7 +296,6 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
this.className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[this.id].style.display = 'block';
|
||||
localStorage.setItem("titles<%=sectiontype%>",this.id);
|
||||
localStorage.setItem("id<%=sectiontype%>","cbi-<%=self.config%>-<%=self.sectiontype%>");
|
||||
};
|
||||
|
||||
li<%=sectiontype%>.onTouchStart = function(){
|
||||
@ -299,7 +306,6 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
|
||||
this.className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[this.id].style.display = 'block';
|
||||
localStorage.setItem("titles<%=sectiontype%>",this.id);
|
||||
localStorage.setItem("id<%=sectiontype%>","cbi-<%=self.config%>-<%=self.sectiontype%>");
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -251,6 +251,9 @@ msgstr "指定下方列表中域名的 DNS 服务器,只支持填写一个IP
|
||||
msgid "Domain Names In The List Do Not Return Fake-IP, One rule per line, Depend on Dnsmasq"
|
||||
msgstr "每行请只填写一个域名,列表中的域名将使用上方指定的 DNS 进行查询并返回真实IP地址,此功能依赖于 Dnsmasq"
|
||||
|
||||
msgid "Domain Names In The List Do Not Return Fake-IP, One rule per line"
|
||||
msgstr "每行请只填写一个域名,列表中的域名在 Fake-IP 模式下将返回真实IP地址"
|
||||
|
||||
msgid "Domain Names In The List Use The Custom DNS Server, But Still Return Fake-IP Results, One rule per line"
|
||||
msgstr "每行请只填写一个规则,列表中的域名将使用指定的 DNS 进行查询,但 Fake-IP 模式下仍将返回保留地址"
|
||||
|
||||
@ -405,7 +408,7 @@ msgid "Default Config File With Correct Template"
|
||||
msgstr "参考配置文件,方便您查询各项参数注释和正确的设置、顺序"
|
||||
|
||||
msgid "Config File Edited By OpenClash For Running"
|
||||
msgstr "OpenClash修改后用于启动的配置文件"
|
||||
msgstr "OpenClash 修改后用于启动的配置文件"
|
||||
|
||||
msgid "Dashboard Secret"
|
||||
msgstr "管理页面登录密钥"
|
||||
@ -1116,8 +1119,8 @@ msgstr "排序"
|
||||
msgid "Append Node Type"
|
||||
msgstr "插入节点类型"
|
||||
|
||||
msgid "Convert Subscribe Online With Template, Mix Proxies and Keep Settings options Will Not Effect"
|
||||
msgstr "根据模板在线转换配置文件,混合节点和保留配置功能将不可用"
|
||||
msgid "Convert Subscribe Online With Template"
|
||||
msgstr "根据模板在线转换配置文件"
|
||||
|
||||
msgid "Convert Subscribe function of Online is Supported By subconverter Written By tindy X"
|
||||
msgstr "在线订阅转换功能由 tindy X 通过 subconverter 提供支持"
|
||||
@ -1384,7 +1387,10 @@ msgid "Restore failed!"
|
||||
msgstr "还原默认配置失败!"
|
||||
|
||||
msgid "Support syntax check, press"
|
||||
msgstr "支持语法检查,按下"
|
||||
msgstr "支持语法检查,按钮"
|
||||
|
||||
msgid "to control diff option, press"
|
||||
msgstr "控制 Diff 显示,按钮"
|
||||
|
||||
msgid "to enter full screen editing mode"
|
||||
msgstr "进入全屏编辑模式"
|
||||
@ -2973,15 +2979,6 @@ msgstr "(TUN&Meta 内核)"
|
||||
msgid "Warning: Only Meta Core Support QUIC Type DNS, Skip"
|
||||
msgstr "警告:仅 Meta 内核支持 QUIC 类型的 DNS,跳过"
|
||||
|
||||
msgid "Force Sniffing Domains Lists"
|
||||
msgstr "强制探测(嗅探)的域名列表"
|
||||
|
||||
msgid "Force Sniffing Domains(sni) Filter"
|
||||
msgstr "忽略探测(嗅探)的域名(sni)列表"
|
||||
|
||||
msgid "Sniffing Ports Filter"
|
||||
msgstr "指定探测(嗅探)的端口列表"
|
||||
|
||||
msgid "Will Override Dns Queries If Domains in The List"
|
||||
msgstr "列表中的域名将会强制进行探测(嗅探)"
|
||||
|
||||
|
@ -1419,7 +1419,7 @@ if [ -n "$FW4" ]; then
|
||||
|
||||
#intranet allowed
|
||||
if [ "$intranet_allowed" -eq 1 ]; then
|
||||
wan_ints=$(nft list chain inet fw4 input |grep -e "jump input_wan" 2>/dev/null |awk '{for (i=1;i<=NF;i++) {if ($i ~ /iifname/) {print $(i+1)}}}' 2>/dev/null |sed 's/"//g')
|
||||
wan_ints=$(nft list chain inet fw4 input |grep -e "jump input_wan" 2>/dev/null |awk '{for (i=1;i<=NF;i++){if ($i ~ /iifname/ && $(i+1) != "{") {print $(i+1)} if ($i ~ /iifname/ && $(i+1) == "{"){for (j=i+1;j<=NF;j++){if ($j~ /}/) {out="";for (k=i+1;k<=j;k++){out=out" "$k};print out}}}}}' 2>/dev/null |sed 's/"//g'|sed 's/{//g'|sed 's/}//g'|sed 's/,//g')
|
||||
if [ -n "$wan_ints" ]; then
|
||||
nft 'add chain inet fw4 openclash_wan_input' 2>/dev/null
|
||||
nft 'flush chain inet fw4 openclash_wan_input' 2>/dev/null
|
||||
@ -1923,7 +1923,7 @@ if [ -n "$FW4" ]; then
|
||||
|
||||
#intranet allowed
|
||||
if [ "$intranet_allowed" -eq 1 ]; then
|
||||
wan6_ints=$(nft list chain inet fw4 input |grep -e "jump input_wan" 2>/dev/null |awk '{for (i=1;i<=NF;i++) {if ($i ~ /iifname/) {print $(i+1)}}}' 2>/dev/null |sed 's/"//g')
|
||||
wan6_ints=$(nft list chain inet fw4 input |grep -e "jump input_wan" 2>/dev/null |awk '{for (i=1;i<=NF;i++){if ($i ~ /iifname/ && $(i+1) != "{") {print $(i+1)} if ($i ~ /iifname/ && $(i+1) == "{"){for (j=i+1;j<=NF;j++){if ($j~ /}/) {out="";for (k=i+1;k<=j;k++){out=out" "$k};print out}}}}}' 2>/dev/null |sed 's/"//g'|sed 's/{//g'|sed 's/}//g'|sed 's/,//g')
|
||||
if [ -n "$wan6_ints" ]; then
|
||||
nft 'add chain inet fw4 openclash_wan6_input' 2>/dev/null
|
||||
nft 'flush chain inet fw4 openclash_wan6_input' 2>/dev/null
|
||||
|
@ -42,6 +42,10 @@ op_version=$(opkg status luci-app-openclash 2>/dev/null |grep 'Version' |awk -F
|
||||
china_ip_route=$(uci -q get openclash.config.china_ip_route)
|
||||
common_ports=$(uci -q get openclash.config.common_ports)
|
||||
router_self_proxy=$(uci -q get openclash.config.router_self_proxy)
|
||||
core_type=$(uci -q get openclash.config.core_type)
|
||||
da_password=$(uci -q get openclash.config.dashboard_password)
|
||||
cn_port=$(uci -q get openclash.config.cn_port)
|
||||
lan_ip=$(uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null || ip address show $(uci -q -p /tmp/state get network.lan.ifname || uci -q -p /tmp/state get network.lan.device) | grep -w "inet" 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}' || ip addr show 2>/dev/null | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | head -n 1)
|
||||
|
||||
if [ -z "$RAW_CONFIG_FILE" ] || [ ! -f "$RAW_CONFIG_FILE" ]; then
|
||||
CONFIG_NAME=$(ls -lt /etc/openclash/config/ | grep -E '.yaml|.yml' | head -n 1 |awk '{print $9}')
|
||||
@ -103,7 +107,8 @@ LuCI版本: $(opkg status luci 2>/dev/null |grep 'Version' |awk -F ': ' '{print
|
||||
#此项有值时,如不使用IPv6,建议到网络-接口-lan的设置中禁用IPV6的DHCP
|
||||
IPV6-DHCP: $(uci -q get dhcp.lan.dhcpv6)
|
||||
|
||||
#此项结果应仅有配置文件的DNS监听地址
|
||||
DNS劫持: $(dns_re "$enable_redirect_dns")
|
||||
#DNS劫持为Dnsmasq时,此项结果应仅有配置文件的DNS监听地址
|
||||
Dnsmasq转发设置: $(uci -q get dhcp.@dnsmasq[0].server)
|
||||
EOF
|
||||
|
||||
@ -155,6 +160,7 @@ EOF
|
||||
if pidof clash >/dev/null; then
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
运行状态: 运行中
|
||||
内核:$core_type
|
||||
进程pid: $(pidof clash)
|
||||
运行权限: `getpcaps $(pidof clash)`
|
||||
运行用户: $(ps |grep "/etc/openclash/clash" |grep -v grep |awk '{print $2}' 2>/dev/null)
|
||||
@ -251,7 +257,6 @@ cat >> "$DEBUG_LOG" <<-EOF
|
||||
运行模式: $en_mode
|
||||
默认代理模式: $proxy_mode
|
||||
UDP流量转发(tproxy): $(ts_cf "$enable_udp_proxy")
|
||||
DNS劫持: $(dns_re "$enable_redirect_dns")
|
||||
自定义DNS: $(ts_cf "$enable_custom_dns")
|
||||
IPV6代理: $(ts_cf "$ipv6_enable")
|
||||
IPV6-DNS解析: $(ts_cf "$ipv6_dns")
|
||||
@ -302,6 +307,15 @@ fi
|
||||
|
||||
sed -i '/^ \{0,\}secret:/d' "$DEBUG_LOG" 2>/dev/null
|
||||
|
||||
#custom overwrite
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 自定义覆写设置 =====================#
|
||||
|
||||
EOF
|
||||
|
||||
cat /etc/openclash/custom/openclash_custom_overwrite.sh >> "$DEBUG_LOG" 2>/dev/null
|
||||
|
||||
#firewall
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
@ -457,10 +471,23 @@ fi
|
||||
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 最近运行日志 =====================#
|
||||
#===================== 最近运行日志(自动切换为Debug模式) =====================#
|
||||
|
||||
EOF
|
||||
tail -n 50 "/tmp/openclash.log" >> "$DEBUG_LOG" 2>/dev/null
|
||||
|
||||
if pidof clash >/dev/null; then
|
||||
curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer ${da_password}" -XPATCH http://${lan_ip}:${cn_port}/configs -d '{"log-level": "debug"}'
|
||||
sleep 10
|
||||
fi
|
||||
tail -n 100 "/tmp/openclash.log" >> "$DEBUG_LOG" 2>/dev/null
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 最近运行日志获取完成(自动切换为silent模式) =====================#
|
||||
|
||||
EOF
|
||||
if pidof clash >/dev/null; then
|
||||
curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer ${da_password}" -XPATCH http://${lan_ip}:${cn_port}/configs -d '{"log-level": "silent"}'
|
||||
fi
|
||||
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
|
@ -1180,8 +1180,28 @@ do
|
||||
system(grpc_service_name)
|
||||
end
|
||||
end
|
||||
else
|
||||
system '${uci_set}obfs_vless=none'
|
||||
if Value['proxies'][$count].key?('reality-opts') then
|
||||
if Value['proxies'][$count]['reality-opts'].key?('public-key') then
|
||||
reality_public_key = '${uci_set}reality_public_key=\"' + Value['proxies'][$count]['reality-opts']['public-key'].to_s + '\"'
|
||||
system(reality_public_key)
|
||||
end
|
||||
if Value['proxies'][$count]['reality-opts'].key?('short-id') then
|
||||
reality_short_id = '${uci_set}reality_short_id=\"' + Value['proxies'][$count]['reality-opts']['short-id'].to_s + '\"'
|
||||
system(reality_short_id)
|
||||
end
|
||||
end
|
||||
elsif Value['proxies'][$count]['network'].to_s == 'tcp'
|
||||
system '${uci_set}obfs_vless=tcp'
|
||||
if Value['proxies'][$count].key?('reality-opts') then
|
||||
if Value['proxies'][$count]['reality-opts'].key?('public-key') then
|
||||
reality_public_key = '${uci_set}reality_public_key=\"' + Value['proxies'][$count]['reality-opts']['public-key'].to_s + '\"'
|
||||
system(reality_public_key)
|
||||
end
|
||||
if Value['proxies'][$count]['reality-opts'].key?('short-id') then
|
||||
reality_short_id = '${uci_set}reality_short_id=\"' + Value['proxies'][$count]['reality-opts']['short-id'].to_s + '\"'
|
||||
system(reality_short_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
}.join
|
||||
|
@ -283,6 +283,8 @@ yml_servers_set()
|
||||
config_get "ip_version" "$section" "ip_version" ""
|
||||
config_get "tfo" "$section" "tfo" ""
|
||||
config_get "udp_over_tcp" "$section" "udp_over_tcp" ""
|
||||
config_get "reality_public_key" "$section" "reality_public_key" ""
|
||||
config_get "reality_short_id" "$section" "reality_short_id" ""
|
||||
|
||||
if [ "$enabled" = "0" ]; then
|
||||
return
|
||||
@ -358,6 +360,10 @@ yml_servers_set()
|
||||
if [ "$obfs_vless" = "grpc" ]; then
|
||||
obfs_vless="network: grpc"
|
||||
fi
|
||||
|
||||
if [ "$obfs_vless" = "tcp" ]; then
|
||||
obfs_vless="network: tcp"
|
||||
fi
|
||||
|
||||
if [ "$obfs_vmess" = "websocket" ]; then
|
||||
obfs_vmess="network: ws"
|
||||
@ -924,7 +930,7 @@ cat >> "$SERVER_FILE" <<-EOF
|
||||
servername: "$servername"
|
||||
EOF
|
||||
fi
|
||||
if [ "$obfs_vless" != "none" ]; then
|
||||
if [ -n "$obfs_vless" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
$obfs_vless
|
||||
EOF
|
||||
@ -951,12 +957,43 @@ cat >> "$SERVER_FILE" <<-EOF
|
||||
grpc-opts:
|
||||
grpc-service-name: "$grpc_service_name"
|
||||
EOF
|
||||
if [ -n "$reality_public_key" ] || [ -n "$reality_short_id" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
reality-opts:
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$reality_public_key" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
public-key: "$reality_public_key"
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$reality_short_id" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
short-id: "$reality_short_id"
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [ ! -z "$vless_flow" ]; then
|
||||
if [ "$obfs_vless" = "network: tcp" ]; then
|
||||
if [ ! -z "$vless_flow" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
flow: "$vless_flow"
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$reality_public_key" ] || [ -n "$reality_short_id" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
reality-opts:
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$reality_public_key" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
public-key: "$reality_public_key"
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$reality_short_id" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
short-id: "$reality_short_id"
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -0,0 +1,49 @@
|
||||
(function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32}
|
||||
diff_match_patch.prototype.diff_main=function(a,b,c,d){"undefined"==typeof d&&(d=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error("Null input. (diff_main)");if(a==b)return a?[[0,a]]:[];"undefined"==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a,
|
||||
b,e,d);c&&a.unshift([0,c]);g&&a.push([0,g]);this.diff_cleanupMerge(a);return a};
|
||||
diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[[1,b]];if(!b)return[[-1,a]];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[[1,e.substring(0,g)],[0,f],[1,e.substring(g+f.length)]],a.length>b.length&&(c[0][0]=c[2][0]=-1),c):1==f.length?[[-1,a],[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e[0],a=e[1],g=e[2],b=e[3],e=e[4],f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([[0,e]],c)):c&&100<a.length&&100<b.length?this.diff_lineMode_(a,b,
|
||||
d):this.diff_bisect_(a,b,d)};
|
||||
diff_match_patch.prototype.diff_lineMode_=function(a,b,c){var d=this.diff_linesToChars_(a,b);a=d.chars1;b=d.chars2;d=d.lineArray;a=this.diff_main(a,b,!1,c);this.diff_charsToLines_(a,d);this.diff_cleanupSemantic(a);a.push([0,""]);for(var e=d=b=0,f="",g="";b<a.length;){switch(a[b][0]){case 1:e++;g+=a[b][1];break;case -1:d++;f+=a[b][1];break;case 0:if(1<=d&&1<=e){a.splice(b-d-e,d+e);b=b-d-e;d=this.diff_main(f,g,!1,c);for(e=d.length-1;0<=e;e--)a.splice(b,0,d[e]);b+=d.length}d=e=0;g=f=""}b++}a.pop();return a};
|
||||
diff_match_patch.prototype.diff_bisect_=function(a,b,c){for(var d=a.length,e=b.length,f=Math.ceil((d+e)/2),g=f,h=2*f,j=Array(h),i=Array(h),k=0;k<h;k++)j[k]=-1,i[k]=-1;j[g+1]=0;i[g+1]=0;for(var k=d-e,q=0!=k%2,r=0,t=0,p=0,w=0,v=0;v<f&&!((new Date).getTime()>c);v++){for(var n=-v+r;n<=v-t;n+=2){var l=g+n,m;m=n==-v||n!=v&&j[l-1]<j[l+1]?j[l+1]:j[l-1]+1;for(var s=m-n;m<d&&s<e&&a.charAt(m)==b.charAt(s);)m++,s++;j[l]=m;if(m>d)t+=2;else if(s>e)r+=2;else if(q&&(l=g+k-n,0<=l&&l<h&&-1!=i[l])){var u=d-i[l];if(m>=
|
||||
u)return this.diff_bisectSplit_(a,b,m,s,c)}}for(n=-v+p;n<=v-w;n+=2){l=g+n;u=n==-v||n!=v&&i[l-1]<i[l+1]?i[l+1]:i[l-1]+1;for(m=u-n;u<d&&m<e&&a.charAt(d-u-1)==b.charAt(e-m-1);)u++,m++;i[l]=u;if(u>d)w+=2;else if(m>e)p+=2;else if(!q&&(l=g+k-n,0<=l&&(l<h&&-1!=j[l])&&(m=j[l],s=g+m-l,u=d-u,m>=u)))return this.diff_bisectSplit_(a,b,m,s,c)}}return[[-1,a],[1,b]]};
|
||||
diff_match_patch.prototype.diff_bisectSplit_=function(a,b,c,d,e){var f=a.substring(0,c),g=b.substring(0,d);a=a.substring(c);b=b.substring(d);f=this.diff_main(f,g,!1,e);e=this.diff_main(a,b,!1,e);return f.concat(e)};
|
||||
diff_match_patch.prototype.diff_linesToChars_=function(a,b){function c(a){for(var b="",c=0,f=-1,g=d.length;f<a.length-1;){f=a.indexOf("\n",c);-1==f&&(f=a.length-1);var r=a.substring(c,f+1),c=f+1;(e.hasOwnProperty?e.hasOwnProperty(r):void 0!==e[r])?b+=String.fromCharCode(e[r]):(b+=String.fromCharCode(g),e[r]=g,d[g++]=r)}return b}var d=[],e={};d[0]="";var f=c(a),g=c(b);return{chars1:f,chars2:g,lineArray:d}};
|
||||
diff_match_patch.prototype.diff_charsToLines_=function(a,b){for(var c=0;c<a.length;c++){for(var d=a[c][1],e=[],f=0;f<d.length;f++)e[f]=b[d.charCodeAt(f)];a[c][1]=e.join("")}};diff_match_patch.prototype.diff_commonPrefix=function(a,b){if(!a||!b||a.charAt(0)!=b.charAt(0))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(f,e)==b.substring(f,e)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
|
||||
diff_match_patch.prototype.diff_commonSuffix=function(a,b){if(!a||!b||a.charAt(a.length-1)!=b.charAt(b.length-1))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(a.length-e,a.length-f)==b.substring(b.length-e,b.length-f)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
|
||||
diff_match_patch.prototype.diff_commonOverlap_=function(a,b){var c=a.length,d=b.length;if(0==c||0==d)return 0;c>d?a=a.substring(c-d):c<d&&(b=b.substring(0,c));c=Math.min(c,d);if(a==b)return c;for(var d=0,e=1;;){var f=a.substring(c-e),f=b.indexOf(f);if(-1==f)return d;e+=f;if(0==f||a.substring(c-e)==b.substring(0,e))d=e,e++}};
|
||||
diff_match_patch.prototype.diff_halfMatch_=function(a,b){function c(a,b,c){for(var d=a.substring(c,c+Math.floor(a.length/4)),e=-1,g="",h,j,n,l;-1!=(e=b.indexOf(d,e+1));){var m=f.diff_commonPrefix(a.substring(c),b.substring(e)),s=f.diff_commonSuffix(a.substring(0,c),b.substring(0,e));g.length<s+m&&(g=b.substring(e-s,e)+b.substring(e,e+m),h=a.substring(0,c-s),j=a.substring(c+m),n=b.substring(0,e-s),l=b.substring(e+m))}return 2*g.length>=a.length?[h,j,n,l,g]:null}if(0>=this.Diff_Timeout)return null;
|
||||
var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(4>d.length||2*e.length<d.length)return null;var f=this,g=c(d,e,Math.ceil(d.length/4)),d=c(d,e,Math.ceil(d.length/2)),h;if(!g&&!d)return null;h=d?g?g[4].length>d[4].length?g:d:d:g;var j;a.length>b.length?(g=h[0],d=h[1],e=h[2],j=h[3]):(e=h[0],j=h[1],g=h[2],d=h[3]);h=h[4];return[g,d,e,j,h]};
|
||||
diff_match_patch.prototype.diff_cleanupSemantic=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=0,h=0,j=0,i=0;f<a.length;)0==a[f][0]?(c[d++]=f,g=j,h=i,i=j=0,e=a[f][1]):(1==a[f][0]?j+=a[f][1].length:i+=a[f][1].length,e&&(e.length<=Math.max(g,h)&&e.length<=Math.max(j,i))&&(a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,d--,f=0<d?c[d-1]:-1,i=j=h=g=0,e=null,b=!0)),f++;b&&this.diff_cleanupMerge(a);this.diff_cleanupSemanticLossless(a);for(f=1;f<a.length;){if(-1==a[f-1][0]&&1==a[f][0]){b=a[f-1][1];c=a[f][1];
|
||||
d=this.diff_commonOverlap_(b,c);e=this.diff_commonOverlap_(c,b);if(d>=e){if(d>=b.length/2||d>=c.length/2)a.splice(f,0,[0,c.substring(0,d)]),a[f-1][1]=b.substring(0,b.length-d),a[f+1][1]=c.substring(d),f++}else if(e>=b.length/2||e>=c.length/2)a.splice(f,0,[0,b.substring(0,e)]),a[f-1][0]=1,a[f-1][1]=c.substring(0,c.length-e),a[f+1][0]=-1,a[f+1][1]=b.substring(e),f++;f++}f++}};
|
||||
diff_match_patch.prototype.diff_cleanupSemanticLossless=function(a){function b(a,b){if(!a||!b)return 6;var c=a.charAt(a.length-1),d=b.charAt(0),e=c.match(diff_match_patch.nonAlphaNumericRegex_),f=d.match(diff_match_patch.nonAlphaNumericRegex_),g=e&&c.match(diff_match_patch.whitespaceRegex_),h=f&&d.match(diff_match_patch.whitespaceRegex_),c=g&&c.match(diff_match_patch.linebreakRegex_),d=h&&d.match(diff_match_patch.linebreakRegex_),i=c&&a.match(diff_match_patch.blanklineEndRegex_),j=d&&b.match(diff_match_patch.blanklineStartRegex_);
|
||||
return i||j?5:c||d?4:e&&!g&&h?3:g||h?2:e||f?1:0}for(var c=1;c<a.length-1;){if(0==a[c-1][0]&&0==a[c+1][0]){var d=a[c-1][1],e=a[c][1],f=a[c+1][1],g=this.diff_commonSuffix(d,e);if(g)var h=e.substring(e.length-g),d=d.substring(0,d.length-g),e=h+e.substring(0,e.length-g),f=h+f;for(var g=d,h=e,j=f,i=b(d,e)+b(e,f);e.charAt(0)===f.charAt(0);){var d=d+e.charAt(0),e=e.substring(1)+f.charAt(0),f=f.substring(1),k=b(d,e)+b(e,f);k>=i&&(i=k,g=d,h=e,j=f)}a[c-1][1]!=g&&(g?a[c-1][1]=g:(a.splice(c-1,1),c--),a[c][1]=
|
||||
h,j?a[c+1][1]=j:(a.splice(c+1,1),c--))}c++}};diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;diff_match_patch.whitespaceRegex_=/\s/;diff_match_patch.linebreakRegex_=/[\r\n]/;diff_match_patch.blanklineEndRegex_=/\n\r?\n$/;diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/;
|
||||
diff_match_patch.prototype.diff_cleanupEfficiency=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=!1,h=!1,j=!1,i=!1;f<a.length;){if(0==a[f][0])a[f][1].length<this.Diff_EditCost&&(j||i)?(c[d++]=f,g=j,h=i,e=a[f][1]):(d=0,e=null),j=i=!1;else if(-1==a[f][0]?i=!0:j=!0,e&&(g&&h&&j&&i||e.length<this.Diff_EditCost/2&&3==g+h+j+i))a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,e=null,g&&h?(j=i=!0,d=0):(d--,f=0<d?c[d-1]:-1,j=i=!1),b=!0;f++}b&&this.diff_cleanupMerge(a)};
|
||||
diff_match_patch.prototype.diff_cleanupMerge=function(a){a.push([0,""]);for(var b=0,c=0,d=0,e="",f="",g;b<a.length;)switch(a[b][0]){case 1:d++;f+=a[b][1];b++;break;case -1:c++;e+=a[b][1];b++;break;case 0:1<c+d?(0!==c&&0!==d&&(g=this.diff_commonPrefix(f,e),0!==g&&(0<b-c-d&&0==a[b-c-d-1][0]?a[b-c-d-1][1]+=f.substring(0,g):(a.splice(0,0,[0,f.substring(0,g)]),b++),f=f.substring(g),e=e.substring(g)),g=this.diff_commonSuffix(f,e),0!==g&&(a[b][1]=f.substring(f.length-g)+a[b][1],f=f.substring(0,f.length-
|
||||
g),e=e.substring(0,e.length-g))),0===c?a.splice(b-d,c+d,[1,f]):0===d?a.splice(b-c,c+d,[-1,e]):a.splice(b-c-d,c+d,[-1,e],[1,f]),b=b-c-d+(c?1:0)+(d?1:0)+1):0!==b&&0==a[b-1][0]?(a[b-1][1]+=a[b][1],a.splice(b,1)):b++,c=d=0,f=e=""}""===a[a.length-1][1]&&a.pop();c=!1;for(b=1;b<a.length-1;)0==a[b-1][0]&&0==a[b+1][0]&&(a[b][1].substring(a[b][1].length-a[b-1][1].length)==a[b-1][1]?(a[b][1]=a[b-1][1]+a[b][1].substring(0,a[b][1].length-a[b-1][1].length),a[b+1][1]=a[b-1][1]+a[b+1][1],a.splice(b-1,1),c=!0):a[b][1].substring(0,
|
||||
a[b+1][1].length)==a[b+1][1]&&(a[b-1][1]+=a[b+1][1],a[b][1]=a[b][1].substring(a[b+1][1].length)+a[b+1][1],a.splice(b+1,1),c=!0)),b++;c&&this.diff_cleanupMerge(a)};diff_match_patch.prototype.diff_xIndex=function(a,b){var c=0,d=0,e=0,f=0,g;for(g=0;g<a.length;g++){1!==a[g][0]&&(c+=a[g][1].length);-1!==a[g][0]&&(d+=a[g][1].length);if(c>b)break;e=c;f=d}return a.length!=g&&-1===a[g][0]?f:f+(b-e)};
|
||||
diff_match_patch.prototype.diff_prettyHtml=function(a){for(var b=[],c=/&/g,d=/</g,e=/>/g,f=/\n/g,g=0;g<a.length;g++){var h=a[g][0],j=a[g][1],j=j.replace(c,"&").replace(d,"<").replace(e,">").replace(f,"¶<br>");switch(h){case 1:b[g]='<ins style="background:#e6ffe6;">'+j+"</ins>";break;case -1:b[g]='<del style="background:#ffe6e6;">'+j+"</del>";break;case 0:b[g]="<span>"+j+"</span>"}}return b.join("")};
|
||||
diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;c<a.length;c++)1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_text2=function(a){for(var b=[],c=0;c<a.length;c++)-1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_levenshtein=function(a){for(var b=0,c=0,d=0,e=0;e<a.length;e++){var f=a[e][0],g=a[e][1];switch(f){case 1:c+=g.length;break;case -1:d+=g.length;break;case 0:b+=Math.max(c,d),d=c=0}}return b+=Math.max(c,d)};
|
||||
diff_match_patch.prototype.diff_toDelta=function(a){for(var b=[],c=0;c<a.length;c++)switch(a[c][0]){case 1:b[c]="+"+encodeURI(a[c][1]);break;case -1:b[c]="-"+a[c][1].length;break;case 0:b[c]="="+a[c][1].length}return b.join("\t").replace(/%20/g," ")};
|
||||
diff_match_patch.prototype.diff_fromDelta=function(a,b){for(var c=[],d=0,e=0,f=b.split(/\t/g),g=0;g<f.length;g++){var h=f[g].substring(1);switch(f[g].charAt(0)){case "+":try{c[d++]=[1,decodeURI(h)]}catch(j){throw Error("Illegal escape in diff_fromDelta: "+h);}break;case "-":case "=":var i=parseInt(h,10);if(isNaN(i)||0>i)throw Error("Invalid number in diff_fromDelta: "+h);h=a.substring(e,e+=i);"="==f[g].charAt(0)?c[d++]=[0,h]:c[d++]=[-1,h];break;default:if(f[g])throw Error("Invalid diff operation in diff_fromDelta: "+
|
||||
f[g]);}}if(e!=a.length)throw Error("Delta length ("+e+") does not equal source text length ("+a.length+").");return c};diff_match_patch.prototype.match_main=function(a,b,c){if(null==a||null==b||null==c)throw Error("Null input. (match_main)");c=Math.max(0,Math.min(c,a.length));return a==b?0:a.length?a.substring(c,c+b.length)==b?c:this.match_bitap_(a,b,c):-1};
|
||||
diff_match_patch.prototype.match_bitap_=function(a,b,c){function d(a,d){var e=a/b.length,g=Math.abs(c-d);return!f.Match_Distance?g?1:e:e+g/f.Match_Distance}if(b.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<<b.length-1,h=-1,i,k,q=b.length+a.length,r,t=0;t<b.length;t++){i=0;for(k=q;i<k;)d(t,c+
|
||||
k)<=g?i=k:q=k,k=Math.floor((q-i)/2+i);q=k;i=Math.max(1,c-k+1);var p=Math.min(c+k,a.length)+b.length;k=Array(p+2);for(k[p+1]=(1<<t)-1;p>=i;p--){var w=e[a.charAt(p-1)];k[p]=0===t?(k[p+1]<<1|1)&w:(k[p+1]<<1|1)&w|((r[p+1]|r[p])<<1|1)|r[p+1];if(k[p]&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h};
|
||||
diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=0;for(c=0;c<a.length;c++)b[a.charAt(c)]|=1<<a.length-c-1;return b};
|
||||
diff_match_patch.prototype.patch_addContext_=function(a,b){if(0!=b.length){for(var c=b.substring(a.start2,a.start2+a.length1),d=0;b.indexOf(c)!=b.lastIndexOf(c)&&c.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)d+=this.Patch_Margin,c=b.substring(a.start2-d,a.start2+a.length1+d);d+=this.Patch_Margin;(c=b.substring(a.start2-d,a.start2))&&a.diffs.unshift([0,c]);(d=b.substring(a.start2+a.length1,a.start2+a.length1+d))&&a.diffs.push([0,d]);a.start1-=c.length;a.start2-=c.length;a.length1+=
|
||||
c.length+d.length;a.length2+=c.length+d.length}};
|
||||
diff_match_patch.prototype.patch_make=function(a,b,c){var d;if("string"==typeof a&&"string"==typeof b&&"undefined"==typeof c)d=a,b=this.diff_main(d,b,!0),2<b.length&&(this.diff_cleanupSemantic(b),this.diff_cleanupEfficiency(b));else if(a&&"object"==typeof a&&"undefined"==typeof b&&"undefined"==typeof c)b=a,d=this.diff_text1(b);else if("string"==typeof a&&b&&"object"==typeof b&&"undefined"==typeof c)d=a;else if("string"==typeof a&&"string"==typeof b&&c&&"object"==typeof c)d=a,b=c;else throw Error("Unknown call format to patch_make.");
|
||||
if(0===b.length)return[];c=[];a=new diff_match_patch.patch_obj;for(var e=0,f=0,g=0,h=d,j=0;j<b.length;j++){var i=b[j][0],k=b[j][1];!e&&0!==i&&(a.start1=f,a.start2=g);switch(i){case 1:a.diffs[e++]=b[j];a.length2+=k.length;d=d.substring(0,g)+k+d.substring(g);break;case -1:a.length1+=k.length;a.diffs[e++]=b[j];d=d.substring(0,g)+d.substring(g+k.length);break;case 0:k.length<=2*this.Patch_Margin&&e&&b.length!=j+1?(a.diffs[e++]=b[j],a.length1+=k.length,a.length2+=k.length):k.length>=2*this.Patch_Margin&&
|
||||
e&&(this.patch_addContext_(a,h),c.push(a),a=new diff_match_patch.patch_obj,e=0,h=d,f=g)}1!==i&&(f+=k.length);-1!==i&&(g+=k.length)}e&&(this.patch_addContext_(a,h),c.push(a));return c};diff_match_patch.prototype.patch_deepCopy=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=new diff_match_patch.patch_obj;e.diffs=[];for(var f=0;f<d.diffs.length;f++)e.diffs[f]=d.diffs[f].slice();e.start1=d.start1;e.start2=d.start2;e.length1=d.length1;e.length2=d.length2;b[c]=e}return b};
|
||||
diff_match_patch.prototype.patch_apply=function(a,b){if(0==a.length)return[b,[]];a=this.patch_deepCopy(a);var c=this.patch_addPadding(a);b=c+b+c;this.patch_splitMax(a);for(var d=0,e=[],f=0;f<a.length;f++){var g=a[f].start2+d,h=this.diff_text1(a[f].diffs),j,i=-1;if(h.length>this.Match_MaxBits){if(j=this.match_main(b,h.substring(0,this.Match_MaxBits),g),-1!=j&&(i=this.match_main(b,h.substring(h.length-this.Match_MaxBits),g+h.length-this.Match_MaxBits),-1==i||j>=i))j=-1}else j=this.match_main(b,h,g);
|
||||
if(-1==j)e[f]=!1,d-=a[f].length2-a[f].length1;else if(e[f]=!0,d=j-g,g=-1==i?b.substring(j,j+h.length):b.substring(j,i+this.Match_MaxBits),h==g)b=b.substring(0,j)+this.diff_text2(a[f].diffs)+b.substring(j+h.length);else if(g=this.diff_main(h,g,!1),h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)e[f]=!1;else{this.diff_cleanupSemanticLossless(g);for(var h=0,k,i=0;i<a[f].diffs.length;i++){var q=a[f].diffs[i];0!==q[0]&&(k=this.diff_xIndex(g,h));1===q[0]?b=b.substring(0,
|
||||
j+k)+q[1]+b.substring(j+k):-1===q[0]&&(b=b.substring(0,j+k)+b.substring(j+this.diff_xIndex(g,h+q[1].length)));-1!==q[0]&&(h+=q[1].length)}}}b=b.substring(c.length,b.length-c.length);return[b,e]};
|
||||
diff_match_patch.prototype.patch_addPadding=function(a){for(var b=this.Patch_Margin,c="",d=1;d<=b;d++)c+=String.fromCharCode(d);for(d=0;d<a.length;d++)a[d].start1+=b,a[d].start2+=b;var d=a[0],e=d.diffs;if(0==e.length||0!=e[0][0])e.unshift([0,c]),d.start1-=b,d.start2-=b,d.length1+=b,d.length2+=b;else if(b>e[0][1].length){var f=b-e[0][1].length;e[0][1]=c.substring(e[0][1].length)+e[0][1];d.start1-=f;d.start2-=f;d.length1+=f;d.length2+=f}d=a[a.length-1];e=d.diffs;0==e.length||0!=e[e.length-1][0]?(e.push([0,
|
||||
c]),d.length1+=b,d.length2+=b):b>e[e.length-1][1].length&&(f=b-e[e.length-1][1].length,e[e.length-1][1]+=c.substring(0,f),d.length1+=f,d.length2+=f);return c};
|
||||
diff_match_patch.prototype.patch_splitMax=function(a){for(var b=this.Match_MaxBits,c=0;c<a.length;c++)if(!(a[c].length1<=b)){var d=a[c];a.splice(c--,1);for(var e=d.start1,f=d.start2,g="";0!==d.diffs.length;){var h=new diff_match_patch.patch_obj,j=!0;h.start1=e-g.length;h.start2=f-g.length;""!==g&&(h.length1=h.length2=g.length,h.diffs.push([0,g]));for(;0!==d.diffs.length&&h.length1<b-this.Patch_Margin;){var g=d.diffs[0][0],i=d.diffs[0][1];1===g?(h.length2+=i.length,f+=i.length,h.diffs.push(d.diffs.shift()),
|
||||
j=!1):-1===g&&1==h.diffs.length&&0==h.diffs[0][0]&&i.length>2*b?(h.length1+=i.length,e+=i.length,j=!1,h.diffs.push([g,i]),d.diffs.shift()):(i=i.substring(0,b-h.length1-this.Patch_Margin),h.length1+=i.length,e+=i.length,0===g?(h.length2+=i.length,f+=i.length):j=!1,h.diffs.push([g,i]),i==d.diffs[0][1]?d.diffs.shift():d.diffs[0][1]=d.diffs[0][1].substring(i.length))}g=this.diff_text2(h.diffs);g=g.substring(g.length-this.Patch_Margin);i=this.diff_text1(d.diffs).substring(0,this.Patch_Margin);""!==i&&
|
||||
(h.length1+=i.length,h.length2+=i.length,0!==h.diffs.length&&0===h.diffs[h.diffs.length-1][0]?h.diffs[h.diffs.length-1][1]+=i:h.diffs.push([0,i]));j||a.splice(++c,0,h)}}};diff_match_patch.prototype.patch_toText=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=a[c];return b.join("")};
|
||||
diff_match_patch.prototype.patch_fromText=function(a){var b=[];if(!a)return b;a=a.split("\n");for(var c=0,d=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;c<a.length;){var e=a[c].match(d);if(!e)throw Error("Invalid patch string: "+a[c]);var f=new diff_match_patch.patch_obj;b.push(f);f.start1=parseInt(e[1],10);""===e[2]?(f.start1--,f.length1=1):"0"==e[2]?f.length1=0:(f.start1--,f.length1=parseInt(e[2],10));f.start2=parseInt(e[3],10);""===e[4]?(f.start2--,f.length2=1):"0"==e[4]?f.length2=0:(f.start2--,f.length2=
|
||||
parseInt(e[4],10));for(c++;c<a.length;){e=a[c].charAt(0);try{var g=decodeURI(a[c].substring(1))}catch(h){throw Error("Illegal escape in patch_fromText: "+g);}if("-"==e)f.diffs.push([-1,g]);else if("+"==e)f.diffs.push([1,g]);else if(" "==e)f.diffs.push([0,g]);else if("@"==e)break;else if(""!==e)throw Error('Invalid patch mode "'+e+'" in: '+g);c++}}return b};diff_match_patch.patch_obj=function(){this.diffs=[];this.start2=this.start1=null;this.length2=this.length1=0};
|
||||
diff_match_patch.patch_obj.prototype.toString=function(){var a,b;a=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1;b=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;a=["@@ -"+a+" +"+b+" @@\n"];var c;for(b=0;b<this.diffs.length;b++){switch(this.diffs[b][0]){case 1:c="+";break;case -1:c="-";break;case 0:c=" "}a[b+1]=c+encodeURI(this.diffs[b][1])+"\n"}return a.join("").replace(/%20/g," ")};
|
||||
this.diff_match_patch=diff_match_patch;this.DIFF_DELETE=-1;this.DIFF_INSERT=1;this.DIFF_EQUAL=0;})()
|
@ -0,0 +1,119 @@
|
||||
.CodeMirror-merge {
|
||||
position: relative;
|
||||
border: 1px solid #ddd;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.CodeMirror-merge, .CodeMirror-merge .CodeMirror {
|
||||
height: 350px;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-2pane .CodeMirror-merge-pane { width: 47%; }
|
||||
.CodeMirror-merge-2pane .CodeMirror-merge-gap { width: 6%; }
|
||||
.CodeMirror-merge-3pane .CodeMirror-merge-pane { width: 31%; }
|
||||
.CodeMirror-merge-3pane .CodeMirror-merge-gap { width: 3.5%; }
|
||||
|
||||
.CodeMirror-merge-pane {
|
||||
display: inline-block;
|
||||
white-space: normal;
|
||||
vertical-align: top;
|
||||
}
|
||||
.CodeMirror-merge-pane-rightmost {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-gap {
|
||||
z-index: 2;
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
border-left: 1px solid #ddd;
|
||||
border-right: 1px solid #ddd;
|
||||
position: relative;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-scrolllock-wrap {
|
||||
position: absolute;
|
||||
bottom: 0; left: 50%;
|
||||
}
|
||||
.CodeMirror-merge-scrolllock {
|
||||
position: relative;
|
||||
left: -50%;
|
||||
cursor: pointer;
|
||||
color: #555;
|
||||
line-height: 1;
|
||||
}
|
||||
.CodeMirror-merge-scrolllock:after {
|
||||
content: "\21db\00a0\00a0\21da";
|
||||
}
|
||||
.CodeMirror-merge-scrolllock.CodeMirror-merge-scrolllock-enabled:after {
|
||||
content: "\21db\21da";
|
||||
}
|
||||
|
||||
.CodeMirror-merge-copybuttons-left, .CodeMirror-merge-copybuttons-right {
|
||||
position: absolute;
|
||||
left: 0; top: 0;
|
||||
right: 0; bottom: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-copy {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
color: #44c;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-copy-reverse {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
color: #44c;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy { left: 2px; }
|
||||
.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy { right: 2px; }
|
||||
|
||||
.CodeMirror-merge-r-inserted, .CodeMirror-merge-l-inserted {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==);
|
||||
background-position: bottom left;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-r-deleted, .CodeMirror-merge-l-deleted {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==);
|
||||
background-position: bottom left;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-r-chunk { background: #ffffe0; }
|
||||
.CodeMirror-merge-r-chunk-start { border-top: 1px solid #ee8; }
|
||||
.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #ee8; }
|
||||
.CodeMirror-merge-r-connect { fill: #ffffe0; stroke: #ee8; stroke-width: 1px; }
|
||||
|
||||
.CodeMirror-merge-l-chunk { background: #eef; }
|
||||
.CodeMirror-merge-l-chunk-start { border-top: 1px solid #88e; }
|
||||
.CodeMirror-merge-l-chunk-end { border-bottom: 1px solid #88e; }
|
||||
.CodeMirror-merge-l-connect { fill: #eef; stroke: #88e; stroke-width: 1px; }
|
||||
|
||||
.CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk { background: #dfd; }
|
||||
.CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start { border-top: 1px solid #4e4; }
|
||||
.CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #4e4; }
|
||||
|
||||
.CodeMirror-merge-collapsed-widget:before {
|
||||
content: "(...)";
|
||||
}
|
||||
.CodeMirror-merge-collapsed-widget {
|
||||
cursor: pointer;
|
||||
color: #88b;
|
||||
background: #eef;
|
||||
border: 1px solid #ddf;
|
||||
font-size: 90%;
|
||||
padding: 0 3px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.CodeMirror-merge-collapsed-line .CodeMirror-gutter-elt { display: none; }
|
File diff suppressed because it is too large
Load Diff
@ -589,9 +589,9 @@ xray_fingerprint:value("chrome")
|
||||
xray_fingerprint:value("firefox")
|
||||
xray_fingerprint:value("safari")
|
||||
xray_fingerprint:value("ios")
|
||||
xray_fingerprint:value("android")
|
||||
-- xray_fingerprint:value("android")
|
||||
xray_fingerprint:value("edge")
|
||||
xray_fingerprint:value("360")
|
||||
-- xray_fingerprint:value("360")
|
||||
xray_fingerprint:value("qq")
|
||||
xray_fingerprint:value("random")
|
||||
xray_fingerprint:value("randomized")
|
||||
@ -623,9 +623,9 @@ reality_fingerprint:value("chrome")
|
||||
reality_fingerprint:value("firefox")
|
||||
reality_fingerprint:value("safari")
|
||||
reality_fingerprint:value("ios")
|
||||
reality_fingerprint:value("android")
|
||||
-- reality_fingerprint:value("android")
|
||||
reality_fingerprint:value("edge")
|
||||
reality_fingerprint:value("360")
|
||||
-- reality_fingerprint:value("360")
|
||||
reality_fingerprint:value("qq")
|
||||
reality_fingerprint:value("random")
|
||||
reality_fingerprint:value("randomized")
|
||||
|
Loading…
Reference in New Issue
Block a user