Commit 070a133a087c5c89d8d53dd5cf43d86216190003
1 parent
86bf7e2e
Exists in
master
alteração dos campos da coleta manual e detalhes(mostra o e-mail) de quando o us…
…uário está logado ou não
Showing
6 changed files
with
114 additions
and
201 deletions
Show diff stats
wscacicneo/model/coleta_manual.py
@@ -48,261 +48,153 @@ class ColetaManualBase(): | @@ -48,261 +48,153 @@ class ColetaManualBase(): | ||
48 | multivalued=False, | 48 | multivalued=False, |
49 | required=True | 49 | required=True |
50 | )) | 50 | )) |
51 | + | ||
51 | """ | 52 | """ |
52 | LB Processadores | 53 | LB Processadores |
53 | """ | 54 | """ |
54 | - nome_processador = Field(**dict( | ||
55 | - name='nome_processador', | ||
56 | - description='Nome do Processador', | ||
57 | - alias='nome_processador', | 55 | + Win32_Processor_Manufacturer = Field(**dict( |
56 | + name='Win32_Processor_Manufacturer', | ||
57 | + description='Win32_Processor_Manufacturer', | ||
58 | + alias='Win32_Processor_Manufacturer', | ||
58 | datatype='Text', | 59 | datatype='Text', |
59 | indices=['Textual'], | 60 | indices=['Textual'], |
60 | multivalued=False, | 61 | multivalued=False, |
61 | - required=True | 62 | + required=False |
62 | )) | 63 | )) |
63 | - versao_processador = Field(**dict( | ||
64 | - name='versao_processador', | ||
65 | - description='Versão do Processador', | ||
66 | - alias='versao_processaodr', | 64 | + Win32_Processor_NumberOfLogicalProcessors = Field(**dict( |
65 | + name='Win32_Processor_NumberOfLogicalProcessors', | ||
66 | + description='Win32_Processor_NumberOfLogicalProcessors', | ||
67 | + alias='Win32_Processor_NumberOfLogicalProcessors', | ||
67 | datatype='Text', | 68 | datatype='Text', |
68 | indices=['Textual'], | 69 | indices=['Textual'], |
69 | multivalued=False, | 70 | multivalued=False, |
70 | - required=True | 71 | + required=False |
71 | )) | 72 | )) |
72 | 73 | ||
73 | - data_instalacao_processador = Field(**dict( | ||
74 | - name='data_instalacao_processador', | ||
75 | - description='Data da Instalação do Processador', | ||
76 | - alias='data_instalacao_processaodr', | 74 | + Win32_Processor_Caption = Field(**dict( |
75 | + name='Win32_Processor_Caption', | ||
76 | + description='Win32_Processor_Caption', | ||
77 | + alias='Win32_Processor_Caption', | ||
77 | datatype='Text', | 78 | datatype='Text', |
78 | indices=['Textual'], | 79 | indices=['Textual'], |
79 | multivalued=False, | 80 | multivalued=False, |
80 | - required=True | 81 | + required=False |
81 | )) | 82 | )) |
82 | 83 | ||
83 | """ | 84 | """ |
84 | - LB HD | ||
85 | - """ | ||
86 | - marca_hd = Field(**dict( | ||
87 | - name='marca_hd', | ||
88 | - description='Marca do HD', | ||
89 | - alias='marca_hd', | ||
90 | - datatype='Text', | ||
91 | - indices=['Textual'], | ||
92 | - multivalued=False, | ||
93 | - required=True | ||
94 | - )) | ||
95 | - tamanho_hd = Field(**dict( | ||
96 | - name='tamanho_hd', | ||
97 | - description='Tamanho do HD', | ||
98 | - alias='tamanho_hd', | ||
99 | - datatype='Text', | ||
100 | - indices=['Textual'], | ||
101 | - multivalued=False, | ||
102 | - required=True | ||
103 | - )) | ||
104 | - tipo_hd = Field(**dict( | ||
105 | - name='tipo_hd', | ||
106 | - description='Tipo do HD', | ||
107 | - alias='tipo_hd', | ||
108 | - datatype='Text', | ||
109 | - indices=['Textual'], | ||
110 | - multivalued=False, | ||
111 | - required=True | ||
112 | - )) | ||
113 | - idade_hd = Field(**dict( | ||
114 | - name='idade_hd', | ||
115 | - description='Idade do HD', | ||
116 | - alias='idade_hd', | ||
117 | - datatype='Text', | ||
118 | - indices=['Textual'], | ||
119 | - multivalued=False, | ||
120 | - required=True | ||
121 | - )) | ||
122 | - | ||
123 | - """ | ||
124 | - LB Memória | 85 | + LB Sistema Operacional |
125 | """ | 86 | """ |
126 | - | ||
127 | - interface_memoria = Field(**dict( | ||
128 | - name='interface_memoria', | ||
129 | - description='Interface da Memória', | ||
130 | - alias='interface_memoria', | 87 | + OperatingSystem_Version = Field(**dict( |
88 | + name='OperatingSystem_Version', | ||
89 | + description='OperatingSystem_Version', | ||
90 | + alias='OperatingSystem_Version', | ||
131 | datatype='Text', | 91 | datatype='Text', |
132 | indices=['Textual'], | 92 | indices=['Textual'], |
133 | multivalued=False, | 93 | multivalued=False, |
134 | - required=True | 94 | + required=False |
135 | )) | 95 | )) |
136 | - armazenamento_memoria = Field(**dict( | ||
137 | - name='armazenamento_memoria', | ||
138 | - description='Armazenamento da Memória', | ||
139 | - alias='armazenamento_memoria', | 96 | + OperatingSystem_InstallDate = Field(**dict( |
97 | + name='OperatingSystem_InstallDate', | ||
98 | + description='OperatingSystem_InstallDate', | ||
99 | + alias='OperatingSystem_InstallDate', | ||
140 | datatype='Text', | 100 | datatype='Text', |
141 | indices=['Textual'], | 101 | indices=['Textual'], |
142 | multivalued=False, | 102 | multivalued=False, |
143 | - required=True | 103 | + required=False |
144 | )) | 104 | )) |
145 | - idade_memoria = Field(**dict( | ||
146 | - name='idade_memoria', | ||
147 | - description='Idade do Memória', | ||
148 | - alias='idade_memoria', | 105 | + OperatingSystem_Caption = Field(**dict( |
106 | + name='OperatingSystem_Caption', | ||
107 | + description='OperatingSystem_Caption', | ||
108 | + alias='OperatingSystem_Caption', | ||
149 | datatype='Text', | 109 | datatype='Text', |
150 | indices=['Textual'], | 110 | indices=['Textual'], |
151 | multivalued=False, | 111 | multivalued=False, |
152 | - required=True | 112 | + required=False |
153 | )) | 113 | )) |
154 | 114 | ||
155 | """ | 115 | """ |
156 | - LB Sistema Operacional | 116 | + LB SoftwareList |
157 | """ | 117 | """ |
158 | - nome_so = Field(**dict( | ||
159 | - name='nome_so', | ||
160 | - description='Nome do Sistema Operacional', | ||
161 | - alias='nome_so', | ||
162 | - datatype='Text', | ||
163 | - indices=['Textual'], | ||
164 | - multivalued=False, | ||
165 | - required=True | ||
166 | - )) | ||
167 | - versao_so = Field(**dict( | ||
168 | - name='versao_so', | ||
169 | - description='Versão do Sistema Operacional', | ||
170 | - alias='versao_so', | 118 | + SoftwareList = Field(**dict( |
119 | + name='SoftwareList', | ||
120 | + description='SoftwareList', | ||
121 | + alias='SoftwareList', | ||
171 | datatype='Text', | 122 | datatype='Text', |
172 | indices=['Textual'], | 123 | indices=['Textual'], |
173 | - multivalued=False, | ||
174 | - required=True | ||
175 | - )) | ||
176 | - fabricante_so = Field(**dict( | ||
177 | - name='fabricante_so', | ||
178 | - description='Fabricando do Sistema Operacional', | ||
179 | - alias='fabricante_so', | ||
180 | - datatype='Text', | ||
181 | - indices=['Textual'], | ||
182 | - multivalued=False, | ||
183 | - required=True | 124 | + multivalued=True, |
125 | + required=False | ||
184 | )) | 126 | )) |
185 | 127 | ||
186 | """ | 128 | """ |
187 | LB Bios | 129 | LB Bios |
188 | """ | 130 | """ |
189 | - patrimonio_bios = Field(**dict( | ||
190 | - name='patrimonio_bios', | ||
191 | - description='Patrimonio da Bios', | ||
192 | - alias='patrimonio_bios', | ||
193 | - datatype='Text', | ||
194 | - indices=['Textual'], | ||
195 | - multivalued=False, | ||
196 | - required=True | ||
197 | - )) | ||
198 | - fabricante_bios = Field(**dict( | ||
199 | - name='fabricante_bios', | ||
200 | - description='Fabricante da Bios', | ||
201 | - alias='fabricante_bios', | 131 | + Win32_BIOS_Manufacturer = Field(**dict( |
132 | + name='Win32_BIOS_Manufacturer', | ||
133 | + description='Win32_BIOS_Manufacturer', | ||
134 | + alias='Win32_BIOS_Manufacturer', | ||
202 | datatype='Text', | 135 | datatype='Text', |
203 | indices=['Textual'], | 136 | indices=['Textual'], |
204 | multivalued=False, | 137 | multivalued=False, |
205 | - required=True | 138 | + required=False |
206 | )) | 139 | )) |
207 | - | 140 | + |
208 | """ | 141 | """ |
209 | GROUP Sistema Operacional | 142 | GROUP Sistema Operacional |
210 | """ | 143 | """ |
211 | - sistemaoperacional_content = Content() | ||
212 | - sistemaoperacional_content.append(nome_so) | ||
213 | - sistemaoperacional_content.append(versao_so) | ||
214 | - sistemaoperacional_content.append(fabricante_so) | 144 | + OperatingSystem_content = Content() |
145 | + OperatingSystem_content.append(OperatingSystem_Version) | ||
146 | + OperatingSystem_content.append(OperatingSystem_InstallDate) | ||
147 | + OperatingSystem_content.append(OperatingSystem_Caption) | ||
215 | 148 | ||
216 | - sistemaoperacional_metadata = GroupMetadata( | ||
217 | - name='sistemaoperacional', | ||
218 | - alias='sistemaoperacional', | ||
219 | - description='Sistema Operacional', | 149 | + OperatingSystem_metadata = GroupMetadata( |
150 | + name='OperatingSystem', | ||
151 | + alias='OperatingSystem', | ||
152 | + description='OperatingSystem', | ||
220 | multivalued = False | 153 | multivalued = False |
221 | ) | 154 | ) |
222 | 155 | ||
223 | - sistemaoperacional = Group( | ||
224 | - metadata = sistemaoperacional_metadata, | ||
225 | - content = sistemaoperacional_content | 156 | + OperatingSystem = Group( |
157 | + metadata = OperatingSystem_metadata, | ||
158 | + content = OperatingSystem_content | ||
226 | ) | 159 | ) |
227 | 160 | ||
228 | """ | 161 | """ |
229 | GROUP Bios | 162 | GROUP Bios |
230 | """ | 163 | """ |
231 | - bios_content = Content() | ||
232 | - bios_content.append(patrimonio_bios) | ||
233 | - bios_content.append(fabricante_bios) | ||
234 | - | ||
235 | - bios_metadata = GroupMetadata( | ||
236 | - name='bios', | ||
237 | - alias='bios', | ||
238 | - description='Bios', | ||
239 | - multivalued = False | ||
240 | - ) | ||
241 | - | ||
242 | - bios = Group( | ||
243 | - metadata = bios_metadata, | ||
244 | - content = bios_content | ||
245 | - ) | ||
246 | - | ||
247 | - """ | ||
248 | - GROUP Memória | ||
249 | - """ | ||
250 | - memoria_content = Content() | ||
251 | - memoria_content.append(interface_memoria) | ||
252 | - memoria_content.append(armazenamento_memoria) | ||
253 | - memoria_content.append(idade_memoria) | ||
254 | - | ||
255 | - memoria_metadata = GroupMetadata( | ||
256 | - name='memoria', | ||
257 | - alias='memoria', | ||
258 | - description='Memória', | ||
259 | - multivalued = False | ||
260 | - ) | ||
261 | - | ||
262 | - memoria = Group( | ||
263 | - metadata = memoria_metadata, | ||
264 | - content = memoria_content | ||
265 | - ) | ||
266 | - | ||
267 | - """ | ||
268 | - GROUP HD | ||
269 | - """ | ||
270 | - hd_content = Content() | ||
271 | - hd_content.append(marca_hd) | ||
272 | - hd_content.append(tamanho_hd) | ||
273 | - hd_content.append(tipo_hd) | ||
274 | - hd_content.append(idade_hd) | 164 | + Win32_BIOS_content = Content() |
165 | + Win32_BIOS_content.append(Win32_BIOS_Manufacturer) | ||
275 | 166 | ||
276 | - hd_metadata = GroupMetadata( | ||
277 | - name='hd', | ||
278 | - alias='hd', | ||
279 | - description='HD', | 167 | + Win32_BIOS_metadata = GroupMetadata( |
168 | + name='Win32_BIOS', | ||
169 | + alias='Win32_BIOS', | ||
170 | + description='Win32_BIOS', | ||
280 | multivalued = False | 171 | multivalued = False |
281 | ) | 172 | ) |
282 | 173 | ||
283 | - hd = Group( | ||
284 | - metadata = hd_metadata, | ||
285 | - content = hd_content | 174 | + Win32_BIOS = Group( |
175 | + metadata = Win32_BIOS_metadata, | ||
176 | + content = Win32_BIOS_content | ||
286 | ) | 177 | ) |
287 | 178 | ||
179 | + | ||
288 | """ | 180 | """ |
289 | GROUP Processador | 181 | GROUP Processador |
290 | """ | 182 | """ |
291 | - processador_content = Content() | ||
292 | - processador_content.append(nome_processador) | ||
293 | - processador_content.append(versao_processador) | ||
294 | - processador_content.append(data_instalacao_processador) | 183 | + Win32_Processor_content = Content() |
184 | + Win32_Processor_content.append(Win32_Processor_Manufacturer) | ||
185 | + Win32_Processor_content.append(Win32_Processor_NumberOfLogicalProcessors) | ||
186 | + Win32_Processor_content.append(Win32_Processor_Caption) | ||
295 | 187 | ||
296 | - processador_metadata = GroupMetadata( | ||
297 | - name='processador', | ||
298 | - alias='processador', | ||
299 | - description='Processador', | 188 | + Win32_Processor_metadata = GroupMetadata( |
189 | + name='Win32_Processor', | ||
190 | + alias='Win32_Processor', | ||
191 | + description='Win32_Processor', | ||
300 | multivalued = False | 192 | multivalued = False |
301 | ) | 193 | ) |
302 | 194 | ||
303 | - processador = Group( | ||
304 | - metadata = processador_metadata, | ||
305 | - content = processador_content | 195 | + Win32_Processor = Group( |
196 | + metadata = Win32_Processor_metadata, | ||
197 | + content = Win32_Processor_content | ||
306 | ) | 198 | ) |
307 | 199 | ||
308 | base_metadata = BaseMetadata( | 200 | base_metadata = BaseMetadata( |
@@ -310,12 +202,10 @@ class ColetaManualBase(): | @@ -310,12 +202,10 @@ class ColetaManualBase(): | ||
310 | ) | 202 | ) |
311 | 203 | ||
312 | content_list = Content() | 204 | content_list = Content() |
313 | - content_list.append(data_coleta) | ||
314 | - content_list.append(processador) | ||
315 | - content_list.append(hd) | ||
316 | - content_list.append(bios) | ||
317 | - content_list.append(memoria) | ||
318 | - content_list.append(sistemaoperacional) | 205 | + content_list.append(Win32_Processor) |
206 | + content_list.append(OperatingSystem) | ||
207 | + content_list.append(Win32_BIOS) | ||
208 | + content_list.append(SoftwareList) | ||
319 | 209 | ||
320 | lbbase = Base( | 210 | lbbase = Base( |
321 | metadata=base_metadata, | 211 | metadata=base_metadata, |
wscacicneo/templates/login.pt
@@ -21,9 +21,14 @@ | @@ -21,9 +21,14 @@ | ||
21 | </div> | 21 | </div> |
22 | </div> | 22 | </div> |
23 | <div class="col-lg-offset-2 col-lg-6"> | 23 | <div class="col-lg-offset-2 col-lg-6"> |
24 | - <input type="submit" name="form.submitted" class="btn btn-sm" value="Acesar"/> | 24 | + <input type="submit" name="form.submitted" id="submit" class="btn btn-sm" value="Acesar"/> |
25 | </div> | 25 | </div> |
26 | </form> | 26 | </form> |
27 | </metal:content> | 27 | </metal:content> |
28 | + <metal:content fill-slot="javascript"> | ||
29 | + $('#submit').click(function(){ | ||
30 | + setTimeout(function() {noty({text: 'Sua senha e confirmar senha estão diferentes ou em branco',layout:'topRight',type:'error',timeout:5000});}, 100); | ||
31 | + }); | ||
32 | + </metal:content> | ||
28 | </metal:main> | 33 | </metal:main> |
29 | 34 | ||
30 | \ No newline at end of file | 35 | \ No newline at end of file |
wscacicneo/templates/master.pt
@@ -24,18 +24,36 @@ | @@ -24,18 +24,36 @@ | ||
24 | <!-- Navigation starts --> | 24 | <!-- Navigation starts --> |
25 | <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation"> | 25 | <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation"> |
26 | <!-- Links --> | 26 | <!-- Links --> |
27 | - <ul class="nav navbar-nav pull-right"> | 27 | + <ul class="nav navbar-nav pull-right" tal:condition="request.authenticated_userid"> |
28 | <li class="dropdown pull-right"> | 28 | <li class="dropdown pull-right"> |
29 | <a data-toggle="dropdown" class="dropdown-toggle" href="#"> | 29 | <a data-toggle="dropdown" class="dropdown-toggle" href="#"> |
30 | - <i class="fa fa-user"></i> Usuário <b class="caret"></b> | 30 | + <i class="fa fa-user"></i> |
31 | + ${request.authenticated_userid} | ||
32 | + <b class="caret"></b> | ||
31 | </a> | 33 | </a> |
32 | <!-- Dropdown menu --> | 34 | <!-- Dropdown menu --> |
33 | <ul class="dropdown-menu"> | 35 | <ul class="dropdown-menu"> |
34 | - <li><a href="${request.route_url('root')}login"><i class="fa fa-user"></i> Login </a></li> | ||
35 | <li><a href="${request.route_url('root')}logout"><i class="fa fa-sign-out"></i> Logout</a></li> | 36 | <li><a href="${request.route_url('root')}logout"><i class="fa fa-sign-out"></i> Logout</a></li> |
36 | </ul> | 37 | </ul> |
37 | </li> | 38 | </li> |
38 | </ul> | 39 | </ul> |
40 | + | ||
41 | + <!-- Links --> | ||
42 | + <ul class="nav navbar-nav pull-right"> | ||
43 | + <li class="dropdown pull-right"> | ||
44 | + <a data-toggle="dropdown" class="dropdown-toggle" tal:condition="not request.authenticated_userid" href="#"> | ||
45 | + <i class="fa fa-user"></i> | ||
46 | + Usuário | ||
47 | + <b class="caret"></b> | ||
48 | + </a> | ||
49 | + <!-- Dropdown menu --> | ||
50 | + <ul class="dropdown-menu"> | ||
51 | + <li><a href="${request.route_url('root')}login"><i class="fa fa-user"></i> Login </a></li> | ||
52 | + </ul> | ||
53 | + </li> | ||
54 | + </ul> | ||
55 | + | ||
56 | + | ||
39 | <!-- Search form --> | 57 | <!-- Search form --> |
40 | <form class="navbar-form navbar-right" role="search"> | 58 | <form class="navbar-form navbar-right" role="search"> |
41 | <div class="form-group"> | 59 | <div class="form-group"> |
wscacicneo/templates/user.pt
@@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
50 | <label class="col-lg-2 control-label">Permissão</label> | 50 | <label class="col-lg-2 control-label">Permissão</label> |
51 | <div class="col-lg-2"> | 51 | <div class="col-lg-2"> |
52 | <select id="permissao" class="form-control"> | 52 | <select id="permissao" class="form-control"> |
53 | - <option selected disabled>Permissões</option> | 53 | + <option></option> |
54 | <option>Administrador</option> | 54 | <option>Administrador</option> |
55 | <option>Gestor</option> | 55 | <option>Gestor</option> |
56 | </select> | 56 | </select> |
wscacicneo/test/test_reports.py
@@ -17,7 +17,7 @@ class TestRelatorio(unittest.TestCase): | @@ -17,7 +17,7 @@ class TestRelatorio(unittest.TestCase): | ||
17 | Carregando atributos genéricos do teste | 17 | Carregando atributos genéricos do teste |
18 | """ | 18 | """ |
19 | self.rest_url = 'http://api.brlight.net/api' | 19 | self.rest_url = 'http://api.brlight.net/api' |
20 | - self.nm_base = 'coleta_manual' | 20 | + self.nm_base = 'ministerioaaaa' |
21 | 21 | ||
22 | def test_get_doc_base(self): | 22 | def test_get_doc_base(self): |
23 | """ | 23 | """ |
@@ -33,7 +33,7 @@ class TestRelatorio(unittest.TestCase): | @@ -33,7 +33,7 @@ class TestRelatorio(unittest.TestCase): | ||
33 | """ | 33 | """ |
34 | get_doc = reports.Reports(self.nm_base, self.rest_url) | 34 | get_doc = reports.Reports(self.nm_base, self.rest_url) |
35 | coleta = get_doc.get_base_orgao() | 35 | coleta = get_doc.get_base_orgao() |
36 | - hd = get_doc.get_attribute('hd') | 36 | + hd = get_doc.get_attribute('operatingsystem') |
37 | self.assertGreater(len(hd.results), 0) | 37 | self.assertGreater(len(hd.results), 0) |
38 | 38 | ||
39 | def test_count_attribute(self): | 39 | def test_count_attribute(self): |
@@ -43,10 +43,10 @@ class TestRelatorio(unittest.TestCase): | @@ -43,10 +43,10 @@ class TestRelatorio(unittest.TestCase): | ||
43 | """ | 43 | """ |
44 | get_doc = reports.Reports(self.nm_base, self.rest_url) | 44 | get_doc = reports.Reports(self.nm_base, self.rest_url) |
45 | coleta = get_doc.get_base_orgao() | 45 | coleta = get_doc.get_base_orgao() |
46 | - hd = get_doc.get_attribute('hd') | 46 | + hd = get_doc.get_attribute('win32_processor') |
47 | self.assertGreater(len(hd.results), 0) | 47 | self.assertGreater(len(hd.results), 0) |
48 | 48 | ||
49 | - hd_count = get_doc.count_attribute('memoria', 'interface_memoria') | 49 | + hd_count = get_doc.count_attribute('win32_processor', 'win32_processor_manufacturer') |
50 | fd = open('/tmp/teste.json', 'w+') | 50 | fd = open('/tmp/teste.json', 'w+') |
51 | fd.write(json.dumps(hd_count)) | 51 | fd.write(json.dumps(hd_count)) |
52 | fd.close() | 52 | fd.close() |
wscacicneo/views.py
@@ -578,7 +578,7 @@ def post_notify(request): | @@ -578,7 +578,7 @@ def post_notify(request): | ||
578 | @view_config(route_name='cadastro_coleta', renderer='templates/cadastro_coleta.pt') | 578 | @view_config(route_name='cadastro_coleta', renderer='templates/cadastro_coleta.pt') |
579 | def cadastro_coleta(request): | 579 | def cadastro_coleta(request): |
580 | orgao_obj = Orgao( | 580 | orgao_obj = Orgao( |
581 | - nome = 'sahuds', | 581 | + nome = 'teste', |
582 | cargo = 'cargo', | 582 | cargo = 'cargo', |
583 | coleta = '4h', | 583 | coleta = '4h', |
584 | sigla = 'MPOG', | 584 | sigla = 'MPOG', |