Mercurial > libervia-web
comparison libervia.tac @ 218:4e6467efd6bf
browser_side: small improvements for parameters panel
- auto-select the first tab
- remove the parameters item if there's nothing to display
author | souliane <souliane@mailoo.org> |
---|---|
date | Sat, 07 Sep 2013 19:54:41 +0200 |
parents | e830a0c60d32 |
children | 36673d19c87e |
comparison
equal
deleted
inserted
replaced
217:f7ec248192de | 218:4e6467efd6bf |
---|---|
369 self.authorized_params = {} | 369 self.authorized_params = {} |
370 for cat in minidom.parseString(d.encode('utf-8')).getElementsByTagName("category"): | 370 for cat in minidom.parseString(d.encode('utf-8')).getElementsByTagName("category"): |
371 params = cat.getElementsByTagName("param") | 371 params = cat.getElementsByTagName("param") |
372 params_list = [param.getAttribute("name") for param in params] | 372 params_list = [param.getAttribute("name") for param in params] |
373 self.authorized_params[cat.getAttribute("name")] = params_list | 373 self.authorized_params[cat.getAttribute("name")] = params_list |
374 return d | 374 if self.authorized_params: |
375 return d | |
376 else: | |
377 return None | |
375 d.addCallback(setAuthorizedParams) | 378 d.addCallback(setAuthorizedParams) |
376 | 379 |
377 from sat.tools.xml_tools import paramsXml2xmlUI | 380 from sat.tools.xml_tools import paramsXml2xmlUI |
378 d.addCallback(lambda d: paramsXml2xmlUI(d)) | 381 d.addCallback(lambda d: paramsXml2xmlUI(d) if d else "") |
379 | 382 |
380 self.sat_host.bridge.getParams(SECURITY_LIMIT, profile, callback=d.callback, errback=d.errback) | 383 self.sat_host.bridge.getParams(SECURITY_LIMIT, profile, callback=d.callback, errback=d.errback) |
381 return d | 384 return d |
382 | 385 |
383 def jsonrpc_setParam(self, name, value, category): | 386 def jsonrpc_setParam(self, name, value, category): |