-
Notifications
You must be signed in to change notification settings - Fork 556
/
Copy pathviews.py
77 lines (69 loc) · 2.03 KB
/
views.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# -*- coding: utf-8 -*-
from ralph.admin.views.extra import RalphDetailView
class BackOfficeAssetComponents(RalphDetailView):
icon = 'folder'
name = 'components'
label = 'Components'
url_name = 'back_office_asset_components'
def get_context_data(self, **kwargs):
context = super(BackOfficeAssetComponents, self).get_context_data(
**kwargs
)
context['components'] = [
{
'label': 'CPU 1',
'model': 'Intel(R) Xeon(R) CPU E5540 @ 2.53GHz',
'serial_number': '',
'speed': '2415 Mhz',
'size': '4 core(s)',
'count': '',
'action': '',
},
{
'label': 'HDD',
'model': 'Baracuda',
'serial_number': 'SN/JKIO9009KL',
'speed': '',
'size': '120 GB',
'count': '1',
'action': '',
},
{
'label': 'RAM',
'model': 'Kingston',
'serial_number': 'SN/JKIO9009KDS',
'speed': '',
'size': '8 GB',
'count': '1',
'action': '',
},
]
return context
class BackOfficeAssetSoftware(RalphDetailView):
icon = 'wrench'
name = 'software'
label = 'Software'
url_name = 'back_office_asset_software'
def get_context_data(self, **kwargs):
context = super(BackOfficeAssetSoftware, self).get_context_data(
**kwargs
)
context['software_list'] = [
{
'label': 'Windows',
'version': '8',
},
{
'label': 'OpenOffice',
'version': '2.5.6',
},
{
'label': 'HipChat',
'version': '50.6.0',
},
{
'label': 'ESET NOD32',
'version': '1.5.0',
},
]
return context