From 8a5daeb3273a6878490589768b83c40e2e265dc1 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 18 Nov 2023 03:32:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E7=AB=99=E7=BB=9F=E8=AE=A1-=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E8=80=97=E6=97=B6=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/webstats/index.py | 12 ++++++++++-- plugins/webstats/js/stats.js | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/plugins/webstats/index.py b/plugins/webstats/index.py index 6a417570c..0fa95627e 100755 --- a/plugins/webstats/index.py +++ b/plugins/webstats/index.py @@ -702,8 +702,8 @@ def attacHistoryLogHack(conn, site_name, query_date='today'): def getLogsList(): args = getArgs() - check = checkArgs(args, ['page', 'page_size', - 'site', 'method', 'status_code', 'spider_type', 'query_date', 'search_uri']) + check = checkArgs(args, ['page', 'page_size','site', 'method', + 'status_code', 'spider_type', 'request_time', 'query_date', 'search_uri']) if not check[0]: return check[1] @@ -713,6 +713,7 @@ def getLogsList(): tojs = args['tojs'] method = args['method'] status_code = args['status_code'] + request_time = args['request_time'] spider_type = args['spider_type'] query_date = args['query_date'] search_uri = args['search_uri'] @@ -743,6 +744,13 @@ def getLogsList(): if status_code != "all": conn = conn.andWhere("status_code=?", (status_code,)) + if request_time != "all": + request_time_s = request_time.strip().split('-') + if len(request_time_s) == 2: + conn = conn.andWhere("request_time>=? and request_time=?", (request_time,)) + if spider_type == "normal": pass elif spider_type == "only_spider": diff --git a/plugins/webstats/js/stats.js b/plugins/webstats/js/stats.js index 45a5f7021..1ed97fb73 100644 --- a/plugins/webstats/js/stats.js +++ b/plugins/webstats/js/stats.js @@ -2175,6 +2175,7 @@ function wsTableLogRequest(page){ args['site'] = $('select[name="site"]').val(); args['method'] = $('select[name="method"]').val(); args['status_code'] = $('select[name="status_code"]').val(); + args['request_time'] = $('select[name="request_time"]').val(); args['spider_type'] = $('select[name="spider_type"]').val(); args['referer'] = $('select[name="referer"]').val(); args['ip'] = $('input[name="ip"]').val(); @@ -2404,7 +2405,16 @@ var html = '
\
\ \
\ - URL过滤: \ + 耗时: \ + \ + URL过滤: \
\ \
\ @@ -2473,6 +2483,10 @@ $('select[name="referer"]').change(function(){ wsTableLogRequest(1); }); +$('select[name="request_time"]').change(function(){ + wsTableLogRequest(1); +}); + $('#logs_search').click(function(){ wsTableLogRequest(1); });