From ad15bb303f56e7310f1db0d226765fd89736bd7e Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 21 Oct 2023 14:41:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E7=AB=99=E7=BB=9F=E8=AE=A1-=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= 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, 27 insertions(+), 1 deletion(-) diff --git a/plugins/webstats/index.py b/plugins/webstats/index.py index 45105ada2..6a417570c 100755 --- a/plugins/webstats/index.py +++ b/plugins/webstats/index.py @@ -716,6 +716,8 @@ def getLogsList(): spider_type = args['spider_type'] query_date = args['query_date'] search_uri = args['search_uri'] + referer = args['referer'] + ip = args['ip'] setDefaultSite(domain) limit = str(page_size) + ' offset ' + str(page_size * (page - 1)) @@ -726,6 +728,15 @@ def getLogsList(): conn = conn.field(field) conn = conn.where("1=1", ()) + if referer != 'all': + if referer == '1': + conn = conn.andWhere("referer <> ? ", ('',)) + elif referer == '-1': + conn = conn.andWhere("referer is null ", ()) + + if ip != '': + conn = conn.andWhere("ip=?", (ip,)) + if method != "all": conn = conn.andWhere("method=?", (method,)) @@ -761,6 +772,7 @@ def getLogsList(): attacHistoryLogHack(conn, domain, query_date) clist = conn.limit(limit).order('time desc').inquiry() + # print(clist) count_key = "count(*) as num" count = conn.field(count_key).limit('').order('').inquiry() # print(count) diff --git a/plugins/webstats/js/stats.js b/plugins/webstats/js/stats.js index 41553b0d9..202f29c47 100644 --- a/plugins/webstats/js/stats.js +++ b/plugins/webstats/js/stats.js @@ -2176,6 +2176,8 @@ function wsTableLogRequest(page){ args['method'] = $('select[name="method"]').val(); args['status_code'] = $('select[name="status_code"]').val(); args['spider_type'] = $('select[name="spider_type"]').val(); + args['referer'] = $('select[name="referer"]').val(); + args['ip'] = $('input[name="ip"]').val(); var query_date = 'today'; if ($('#time_choose').attr("data-name") != ''){ @@ -2370,6 +2372,12 @@ var html = '
\ \ \ \ + 来源: \ + \ 蜘蛛过滤: \ \ - URL过滤: \ + IP: \ +
\ + \ +
\ +
\ +
\ + URL过滤: \
\ \
\