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 | 48 | multivalued=False, |
49 | 49 | required=True |
50 | 50 | )) |
51 | + | |
51 | 52 | """ |
52 | 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 | 59 | datatype='Text', |
59 | 60 | indices=['Textual'], |
60 | 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 | 68 | datatype='Text', |
68 | 69 | indices=['Textual'], |
69 | 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 | 78 | datatype='Text', |
78 | 79 | indices=['Textual'], |
79 | 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 | 91 | datatype='Text', |
132 | 92 | indices=['Textual'], |
133 | 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 | 100 | datatype='Text', |
141 | 101 | indices=['Textual'], |
142 | 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 | 109 | datatype='Text', |
150 | 110 | indices=['Textual'], |
151 | 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 | 122 | datatype='Text', |
172 | 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 | 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 | 135 | datatype='Text', |
203 | 136 | indices=['Textual'], |
204 | 137 | multivalued=False, |
205 | - required=True | |
138 | + required=False | |
206 | 139 | )) |
207 | - | |
140 | + | |
208 | 141 | """ |
209 | 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 | 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 | 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 | 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 | 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 | 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 | 200 | base_metadata = BaseMetadata( |
... | ... | @@ -310,12 +202,10 @@ class ColetaManualBase(): |
310 | 202 | ) |
311 | 203 | |
312 | 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 | 210 | lbbase = Base( |
321 | 211 | metadata=base_metadata, | ... | ... |
wscacicneo/templates/login.pt
... | ... | @@ -21,9 +21,14 @@ |
21 | 21 | </div> |
22 | 22 | </div> |
23 | 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 | 25 | </div> |
26 | 26 | </form> |
27 | 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 | 33 | </metal:main> |
29 | 34 | |
30 | 35 | \ No newline at end of file | ... | ... |
wscacicneo/templates/master.pt
... | ... | @@ -24,18 +24,36 @@ |
24 | 24 | <!-- Navigation starts --> |
25 | 25 | <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation"> |
26 | 26 | <!-- Links --> |
27 | - <ul class="nav navbar-nav pull-right"> | |
27 | + <ul class="nav navbar-nav pull-right" tal:condition="request.authenticated_userid"> | |
28 | 28 | <li class="dropdown pull-right"> |
29 | 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 | 33 | </a> |
32 | 34 | <!-- Dropdown menu --> |
33 | 35 | <ul class="dropdown-menu"> |
34 | - <li><a href="${request.route_url('root')}login"><i class="fa fa-user"></i> Login </a></li> | |
35 | 36 | <li><a href="${request.route_url('root')}logout"><i class="fa fa-sign-out"></i> Logout</a></li> |
36 | 37 | </ul> |
37 | 38 | </li> |
38 | 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 | 57 | <!-- Search form --> |
40 | 58 | <form class="navbar-form navbar-right" role="search"> |
41 | 59 | <div class="form-group"> | ... | ... |
wscacicneo/templates/user.pt
... | ... | @@ -50,7 +50,7 @@ |
50 | 50 | <label class="col-lg-2 control-label">Permissão</label> |
51 | 51 | <div class="col-lg-2"> |
52 | 52 | <select id="permissao" class="form-control"> |
53 | - <option selected disabled>Permissões</option> | |
53 | + <option></option> | |
54 | 54 | <option>Administrador</option> |
55 | 55 | <option>Gestor</option> |
56 | 56 | </select> | ... | ... |
wscacicneo/test/test_reports.py
... | ... | @@ -17,7 +17,7 @@ class TestRelatorio(unittest.TestCase): |
17 | 17 | Carregando atributos genéricos do teste |
18 | 18 | """ |
19 | 19 | self.rest_url = 'http://api.brlight.net/api' |
20 | - self.nm_base = 'coleta_manual' | |
20 | + self.nm_base = 'ministerioaaaa' | |
21 | 21 | |
22 | 22 | def test_get_doc_base(self): |
23 | 23 | """ |
... | ... | @@ -33,7 +33,7 @@ class TestRelatorio(unittest.TestCase): |
33 | 33 | """ |
34 | 34 | get_doc = reports.Reports(self.nm_base, self.rest_url) |
35 | 35 | coleta = get_doc.get_base_orgao() |
36 | - hd = get_doc.get_attribute('hd') | |
36 | + hd = get_doc.get_attribute('operatingsystem') | |
37 | 37 | self.assertGreater(len(hd.results), 0) |
38 | 38 | |
39 | 39 | def test_count_attribute(self): |
... | ... | @@ -43,10 +43,10 @@ class TestRelatorio(unittest.TestCase): |
43 | 43 | """ |
44 | 44 | get_doc = reports.Reports(self.nm_base, self.rest_url) |
45 | 45 | coleta = get_doc.get_base_orgao() |
46 | - hd = get_doc.get_attribute('hd') | |
46 | + hd = get_doc.get_attribute('win32_processor') | |
47 | 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 | 50 | fd = open('/tmp/teste.json', 'w+') |
51 | 51 | fd.write(json.dumps(hd_count)) |
52 | 52 | fd.close() | ... | ... |
wscacicneo/views.py
... | ... | @@ -578,7 +578,7 @@ def post_notify(request): |
578 | 578 | @view_config(route_name='cadastro_coleta', renderer='templates/cadastro_coleta.pt') |
579 | 579 | def cadastro_coleta(request): |
580 | 580 | orgao_obj = Orgao( |
581 | - nome = 'sahuds', | |
581 | + nome = 'teste', | |
582 | 582 | cargo = 'cargo', |
583 | 583 | coleta = '4h', |
584 | 584 | sigla = 'MPOG', | ... | ... |