mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 11:09:57 +08:00
luci-app-passwall: sync with upstream source
This commit is contained in:
parent
e385554af8
commit
66cc0cd6c3
@ -340,15 +340,14 @@ function server_user_status()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function server_user_log()
|
function server_user_log()
|
||||||
local e = {}
|
|
||||||
local id = luci.http.formvalue("id")
|
local id = luci.http.formvalue("id")
|
||||||
if nixio.fs.access("/var/etc/passwall_server/" .. id .. ".log") then
|
if nixio.fs.access("/var/etc/passwall_server/" .. id .. ".log") then
|
||||||
e.code = 200
|
local content = luci.sys.exec("cat /var/etc/passwall_server/" .. id .. ".log")
|
||||||
|
content = content:gsub("\n", "<br />")
|
||||||
|
luci.http.write(content)
|
||||||
else
|
else
|
||||||
e.code = 400
|
luci.http.write(string.format("<script>alert('%s');window.close();</script>", i18n.translate("Not enabled log")))
|
||||||
end
|
end
|
||||||
e.data = luci.sys.exec("cat /var/etc/passwall_server/" .. id .. ".log")
|
|
||||||
http_write_json(e)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function server_get_log()
|
function server_get_log()
|
||||||
|
@ -12,8 +12,6 @@ s.anonymous = true
|
|||||||
|
|
||||||
s:tab("direct_list", translate("Direct List"))
|
s:tab("direct_list", translate("Direct List"))
|
||||||
s:tab("proxy_list", translate("Proxy List"))
|
s:tab("proxy_list", translate("Proxy List"))
|
||||||
s:tab("proxy_list2", translate("Proxy List") .. " 2")
|
|
||||||
s:tab("proxy_list3", translate("Proxy List") .. " 3")
|
|
||||||
|
|
||||||
---- Direct Hosts
|
---- Direct Hosts
|
||||||
local direct_host = string.format("/usr/share/%s/rules/direct_host", appname)
|
local direct_host = string.format("/usr/share/%s/rules/direct_host", appname)
|
||||||
|
@ -1,26 +1,5 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
function get_log(cbi_id) {
|
|
||||||
if (cbi_id) {
|
|
||||||
XHR.get('<%=url([[admin]], [[services]], [[passwall]], [[server_user_log]])%>', {
|
|
||||||
id: cbi_id
|
|
||||||
},
|
|
||||||
function(x, result) {
|
|
||||||
if (x && x.status == 200) {
|
|
||||||
if (result.code == 200) {
|
|
||||||
var content = result.data;
|
|
||||||
content = content.replace(/\n/g, "<br />");
|
|
||||||
var new_window = window.open();
|
|
||||||
new_window.document.write(content);
|
|
||||||
} else {
|
|
||||||
alert('<%:Not enabled log%>');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var _users_status = document.getElementsByClassName('_users_status');
|
var _users_status = document.getElementsByClassName('_users_status');
|
||||||
for(var i = 0; i < _users_status.length; i++) {
|
for(var i = 0; i < _users_status.length; i++) {
|
||||||
var id = _users_status[i].parentElement.parentElement.parentElement.id;
|
var id = _users_status[i].parentElement.parentElement.parentElement.id;
|
||||||
@ -45,7 +24,7 @@
|
|||||||
var td = edit_btn[i].parentNode;
|
var td = edit_btn[i].parentNode;
|
||||||
var new_div = "";
|
var new_div = "";
|
||||||
//添加"日志"按钮
|
//添加"日志"按钮
|
||||||
new_div += '<input class="cbi-button cbi-button-add" type="button" value="<%:Log%>" onclick="get_log(\'' + id + '\')"/> ';
|
new_div += '<input class="cbi-button cbi-button-add" type="button" value="<%:Log%>" onclick="window.open(\'' + '<%=url([[admin]], [[services]], [[passwall]], [[server_user_log]])%>' + '?id=' + id + '\', \'_blank\')"/> ';
|
||||||
td.innerHTML = new_div + td.innerHTML;
|
td.innerHTML = new_div + td.innerHTML;
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
|
@ -1234,7 +1234,7 @@ start() {
|
|||||||
start_redir UDP udp
|
start_redir UDP udp
|
||||||
start_dns
|
start_dns
|
||||||
add_dnsmasq
|
add_dnsmasq
|
||||||
source $APP_PATH/iptables.sh start &
|
source $APP_PATH/iptables.sh start
|
||||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||||
echolog "重启 dnsmasq 服务[$?]"
|
echolog "重启 dnsmasq 服务[$?]"
|
||||||
}
|
}
|
||||||
|
@ -575,7 +575,7 @@ add_firewall_rule() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
del_firewall_rule() {
|
del_firewall_rule() {
|
||||||
ib_nat_exist=`$ipt_n -L PREROUTING | grep -c PSW`
|
ib_nat_exist=$($ipt_n -nL PREROUTING | grep -c PSW)
|
||||||
if [ ! -z "$ib_nat_exist" ];then
|
if [ ! -z "$ib_nat_exist" ];then
|
||||||
until [ "$ib_nat_exist" = 0 ]
|
until [ "$ib_nat_exist" = 0 ]
|
||||||
do
|
do
|
||||||
@ -592,7 +592,7 @@ del_firewall_rule() {
|
|||||||
$ip6t_m -D PREROUTING -j PSW 2>/dev/null
|
$ip6t_m -D PREROUTING -j PSW 2>/dev/null
|
||||||
$ip6t_m -D OUTPUT -p tcp -j PSW_OUTPUT 2>/dev/null
|
$ip6t_m -D OUTPUT -p tcp -j PSW_OUTPUT 2>/dev/null
|
||||||
|
|
||||||
ib_nat_exist=`expr $ib_nat_exist - 1`
|
ib_nat_exist=$(expr $ib_nat_exist - 1)
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
$ipt_n -F PSW 2>/dev/null && $ipt_n -X PSW 2>/dev/null
|
$ipt_n -F PSW 2>/dev/null && $ipt_n -X PSW 2>/dev/null
|
||||||
|
@ -62,6 +62,7 @@ gnews.org
|
|||||||
go.com
|
go.com
|
||||||
google.com
|
google.com
|
||||||
google.com.hk
|
google.com.hk
|
||||||
|
google.com.sg
|
||||||
google.com.tw
|
google.com.tw
|
||||||
googleapis.com
|
googleapis.com
|
||||||
googletagmanager.com
|
googletagmanager.com
|
||||||
|
Loading…
x
Reference in New Issue
Block a user