-
Notifications
You must be signed in to change notification settings - Fork 207
/
functions.py
34 lines (29 loc) · 663 Bytes
/
functions.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
def labelToMargin(label):
labels = {
'Vulnerable':'10px',
'Critical':'22px',
'Warning':'28px',
'Checked':'28px'
}
if label in labels:
return labels[label]
def labelToColor(label):
labels = {
'Vulnerable':'red',
'Critical':'black',
'Warning':'orange',
'Checked':'blue'
}
if label in labels:
return labels[label]
def fromOSTypeToFontAwesome(ostype):
icons = {
'windows':'fab fa-windows',
'solaris':'fab fa-linux', # there isn't a better icon on fontawesome :(
'unix':'fab fa-linux', # same here...
'linux':'fab fa-linux',
}
if ostype.lower() in icons:
return str(icons[ostype.lower()])
else:
return 'fas fa-question'