Do a lot of things

This commit is contained in:
Grégory Soutadé
2014-11-26 16:17:16 +01:00
parent 6505ca3ee5
commit 81b3eee552
12 changed files with 333 additions and 48 deletions

View File

@@ -14,7 +14,7 @@ class IWLADisplayAllVisits(IPlugin):
last_access = sorted(hits.values(), key=lambda t: t['last_access'], reverse=True)
cur_time = self.iwla.getCurTime()
title = time.strftime('All visits %B %Y', cur_time)
title = time.strftime('All visits - %B %Y', cur_time)
filename = 'all_visits_%d.html' % (cur_time.tm_mon)
path = '%d/%s' % (cur_time.tm_year, filename)
@@ -22,8 +22,13 @@ class IWLADisplayAllVisits(IPlugin):
page = DisplayHTMLPage(title, path)
table = DisplayHTMLBlockTable('Last seen', ['Host', 'Pages', 'Hits', 'Bandwidth', 'Last seen'])
for super_hit in last_access:
address = super_hit['remote_addr']
if self.iwla.getConfValue('display_visitor_ip', False) and\
super_hit.get('dns_name_replaced', False):
address = '%s [%s]' % (address, super_hit['remote_ip'])
row = [
super_hit['remote_addr'],
address,
super_hit['viewed_pages'],
super_hit['viewed_hits'],
bytesToStr(super_hit['bandwidth']),