Add First CSS

This commit is contained in:
Grégory Soutadé 2014-11-28 16:02:04 +01:00
parent 3858127a6d
commit 1b4f9c0ad5
5 changed files with 71 additions and 4 deletions

View File

@ -169,6 +169,7 @@ class DisplayHTMLPage(object):
f.write('<html>')
f.write('<head>')
f.write('<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />')
f.write('<link rel="stylesheet" href="iwla.css"/>')
if self.title:
f.write('<title>%s</title>' % (self.title))
f.write('</head>')

View File

@ -144,6 +144,8 @@ class IWLA(object):
def _appendHit(self, hit):
remote_addr = hit['remote_addr']
if not remote_addr: return
if not remote_addr in self.current_analysis['visits'].keys():
self._createVisitor(hit)
return
@ -232,7 +234,7 @@ class IWLA(object):
page = DisplayHTMLPage(title, filename)
days = DisplayHTMLBlockTable('By day', ['Day', 'Visits', 'Pages', 'Hits', 'Bandwidth', 'Not viewed Bandwidth'])
days.setColsCSSClass(['', 'iwla_visit', 'iwla_page', 'iwla_hit', 'iwla_bandwith', 'iwla_bandwith'])
days.setColsCSSClass(['', 'iwla_visit', 'iwla_page', 'iwla_hit', 'iwla_bandwidth', 'iwla_bandwidth'])
keys = self.current_analysis['days_stats'].keys()
keys.sort()
nb_visits = 0
@ -391,7 +393,8 @@ class IWLA(object):
if not self._decodeHTTPRequest(hit): return False
for k in hit.keys():
if hit[k] == '-': hit[k] = ''
if hit[k] == '-' or hit[k] == '*':
hit[k] = ''
self._appendHit(hit)

View File

@ -22,7 +22,7 @@ class IWLADisplayAllVisits(IPlugin):
page = DisplayHTMLPage(title, path)
table = DisplayHTMLBlockTable('Last seen', ['Host', 'Pages', 'Hits', 'Bandwidth', 'Last seen'])
table.setColsCSSClass(['', 'iwla_page', 'iwla_hit', 'iwla_bandwith', ''])
table.setColsCSSClass(['', 'iwla_page', 'iwla_hit', 'iwla_bandwidth', ''])
for super_hit in last_access:
address = super_hit['remote_addr']

View File

@ -21,7 +21,7 @@ class IWLADisplayTopVisitors(IPlugin):
index = self.iwla.getDisplayIndex()
table = DisplayHTMLBlockTable('Top visitors', ['Host', 'Pages', 'Hits', 'Bandwidth', 'Last seen'])
table.setColsCSSClass(['', 'iwla_page', 'iwla_hit', 'iwla_bandwith', ''])
table.setColsCSSClass(['', 'iwla_page', 'iwla_hit', 'iwla_bandwidth', ''])
for super_hit in top_visitors:
address = super_hit['remote_addr']
if display_visitor_ip and\

63
resources/css/iwla.css Normal file
View File

@ -0,0 +1,63 @@
body
{
font: 11px verdana, arial, helvetica, sans-serif;
background-color: #FFFFFF;
}
.iwla_block
{
display:block;
margin: 2em;
}
.iwla_block_title {
font: 13px verdana, arial, helvetica, sans-serif;
font-weight: bold;
background-color: #CCCCDD;
text-align: center;
color: #000000;
width: 60%;
}
.iwla_block_title > a
{
font: 11px verdana, arial, helvetica, sans-serif;
font-weight: normal;
text-decoration: none;
}
.iwla_block_value
{
border-width : 0.2em;
border-color : #CCCCDD;
border-style : solid;
}
/* .iwla_block_value table tr th */
th
{
padding : 0.5em;
background : #ECECEC;
font-weight: normal;
white-space: nowrap;
}
td
{
text-align:center;
vertical-align:middle;
}
td:first-child
{
text-align:left;
/* width : 100%; */
}
.iwla_visitor { background : #FFAA66; }
.iwla_visit { background : #F4F090; }
.iwla_page { background : #4477DD; }
.iwla_hit { background : #66DDEE; }
.iwla_bandwidth { background : #2EA495; }
.iwla_search { background : #F4F090; }