iwla

iwla Commit Details

Date:2014-12-02 21:16:27 (6 years 8 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:273bcd3526ec5d04eadac0e3a413a33eb1e94709
Parents: 7d45b45e8af6ec10b70238791e25228215dee92d
Message:Add weekend coloration

Changes:
Mdisplay.py (4 diffs)
Miwla.py (2 diffs)
Mresources/css/iwla.css (1 diff)

File differences

display.py
5757
5858
5959
60
60
6161
6262
6363
6464
6565
66
66
6767
6868
6969
......
103103
104104
105105
106
107
106
108107
109108
110109
......
155154
156155
157156
158
157
159158
160159
161160
......
213212
214213
215214
216
215
217216
218217
219218
super(DisplayHTMLBlockTable, self).__init__(title=title)
self.cols = cols
self.rows = []
self.cols_cssclasses = ['' for e in cols]
self.cols_cssclasses = [''] * len(cols)
self.rows_cssclasses = []
self.table_css = 'iwla_table'
def appendRow(self, row):
self.rows.append(listToStr(row))
self.rows_cssclasses.append(['' for e in row])
self.rows_cssclasses.append([''] * len(row))
def getCellValue(self, row, col):
if row < 0 or col < 0 or\
if row < 0 or row >= len(self.rows):
raise ValueError('Invalid indice %d' % (row))
for i in range(0, self.rows_cssclasses[row]):
self.rows_cssclasses[row][i] = value
self.rows_cssclasses[row] = [value] * len(self.rows_cssclasses[row])
def setColCSSClass(self, col, value):
if col < 0 or col >= len(self.cols):
self.icon_path = 'resources/icon'
# self.icon_path = self.iwla.getConfValue('icon_path', '/')
self.raw_rows = []
self.maxes = [0 for c in cols]
self.maxes = [0] * len(cols)
self.table_graph_css = 'iwla_graph_table'
def appendRow(self, row):
html += '</tr>'
html += '<tr>'
for i in range(0, len(self.short_titles)):
style = self.getCellCSSClass(0, j)
style = self.getCellCSSClass(i, 0)
if style: style = ' class="%s"' % (style)
html += '<td%s>%s</td>' % (style, self.short_titles[i])
html += '</tr>'
iwla.py
77
88
99
10
1011
1112
1213
......
260261
261262
262263
264
265
266
263267
264268
265269
import gzip
import importlib
from calendar import monthrange
from datetime import date
import default_conf as conf
import conf as _
days.setCellValue(i, 4, bytesToStr(row[4]))
days.setCellValue(i, 5, bytesToStr(row[5]))
days.appendShortTitle(cur_day)
week_day = date(cur_time.tm_year, cur_time.tm_mon, i+1).weekday()
if week_day == 5 or week_day == 6:
days.setRowCSSClass(i, 'iwla_weekend')
stats = self.current_analysis['month_stats']
resources/css/iwla.css
6161
6262
6363
64
6465
6566
6667
.iwla_hit { background : #66DDEE; }
.iwla_bandwidth { background : #2EA495; }
.iwla_search { background : #F4F090; }
.iwla_weekend { background : #ECECEC; }
.iwla_graph_table
{

Archive Download the corresponding diff file

Branches

Tags