mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
网站统计 xx2
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
.cur {
|
||||
background-color: #20a53a;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ws_setting .ws_title {
|
||||
display: inline-block;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"sort": 7,
|
||||
"ps": "【DEV】网站统计报表",
|
||||
"name": "webstats",
|
||||
"title": "网站统计报表",
|
||||
"title": "网站统计报表[此插件开发完成后,需要反馈问题,不当小白鼠,慎用!]",
|
||||
"shell": "install.sh",
|
||||
"versions":["0.0.1"],
|
||||
"tip": "soft",
|
||||
|
||||
@@ -277,10 +277,10 @@ function wsSitesLog(){
|
||||
var data = rdata.data.data;
|
||||
for(i in data){
|
||||
list += '<tr>';
|
||||
list += '<td>' + data[i]['time']+'</td>';
|
||||
list += '<td>' + getLocalTime(data[i]['time'])+'</td>';
|
||||
list += '<td>' + data[i]['domain'] +'</td>';
|
||||
list += '<td>' + data[i]['ip'] +'</td>';
|
||||
list += '<td>' + data[i]['body_length'] +'</td>';
|
||||
list += '<td>' + toSize(data[i]['body_length']) +'</td>';
|
||||
list += '<td>' + data[i]['request_time'] +'ms</td>';
|
||||
list += '<td>' + data[i]['uri'] +'</td>';
|
||||
list += '<td>' + data[i]['status_code']+'/' + data[i]['method'] +'</td>';
|
||||
|
||||
@@ -184,6 +184,7 @@ log_by_lua_block {
|
||||
end
|
||||
|
||||
if "table" == type(data) then
|
||||
D("get_http_original:"..headers..data)
|
||||
headers = table.concat(headers, data)
|
||||
end
|
||||
end
|
||||
@@ -254,6 +255,53 @@ log_by_lua_block {
|
||||
return unset_server_name
|
||||
end
|
||||
|
||||
-- exclude_func start
|
||||
local function execute_status()
|
||||
if not config['exclude_status'] then return false end
|
||||
local the_status = tostring(ngx.status)
|
||||
for _,v in ipairs(config['exclude_status'])
|
||||
do
|
||||
if the_status == v then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function exclude_extension()
|
||||
if not ngx.var.uri then return false end
|
||||
if not config['exclude_extension'] then return false end
|
||||
for _,v in ipairs(config['exclude_extension'])
|
||||
do
|
||||
if ngx.re.find(ngx.var.uri,"[.]"..v.."$",'ijo') then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function exclude_url()
|
||||
if not ngx.var.uri then return false end
|
||||
if not config['exclude_url'] then return false end
|
||||
local the_uri = string.sub(ngx.var.request_uri, 2)
|
||||
local url_conf = config["exclude_url"]
|
||||
for i,conf in pairs(url_conf)
|
||||
do
|
||||
local mode = conf["mode"]
|
||||
local url = conf["url"]
|
||||
if mode == "regular" then
|
||||
if ngx.re.find(the_uri, url, "ijo") then
|
||||
return true
|
||||
end
|
||||
else
|
||||
if the_uri == url then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
-- exclude_func end
|
||||
|
||||
local function cache_logs()
|
||||
|
||||
@@ -309,6 +357,12 @@ log_by_lua_block {
|
||||
client_port=client_port
|
||||
}
|
||||
|
||||
local request_stat_fields = "req=req+1,length=length+"..body_length
|
||||
local spider_stat_fields = "x"
|
||||
local client_stat_fields = "x"
|
||||
|
||||
local stat_fields = request_stat_fields..";"..client_stat_fields..";"..spider_stat_fields
|
||||
D("stat_fields:"..stat_fields)
|
||||
cache_set(server_name, new_id, "log_kv", json.encode(kv))
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user