forked from yorek/ssis-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocessors.py
41 lines (38 loc) · 1.09 KB
/
processors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from app import app
@app.context_processor
def utility_processor():
def tile_color(kpi_value):
result = 'green'
if (kpi_value == 0) :
result = 'primary'
if (kpi_value > 0) :
result = 'red'
return result
return dict(tile_color = tile_color)
@app.context_processor
def utility_processor():
def tile_color_inv(kpi_value):
result = 'green'
if (kpi_value == 0) :
result = 'primary'
if (kpi_value < 0) :
result = 'red'
return result
return dict(tile_color_inv = tile_color_inv)
@app.context_processor
def utility_processor():
def row_status_class(status):
result = {
0 : 'default',
1 : 'default',
2 : 'info',
3 : 'danger',
4 : 'danger',
5 : 'default',
6 : 'danger',
7 : 'success',
8 : 'warning',
9 : 'default'
}
return result[status]
return dict(row_status_class = row_status_class)