[IMP] hw_proxy: add lsusb full output to hw status page
This commit is contained in:
parent
d1b0b9e656
commit
265c9f7b06
|
@ -54,7 +54,7 @@ class Proxy(http.Controller):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@http.route('/hw_proxy/status', type='http', auth='none', cors='*')
|
@http.route('/hw_proxy/status', type='http', auth='none', cors='*')
|
||||||
def status_http(self):
|
def status_http(self, debug=None, **kwargs):
|
||||||
resp = """
|
resp = """
|
||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
|
@ -102,6 +102,8 @@ class Proxy(http.Controller):
|
||||||
<h2>Connected Devices</h2>
|
<h2>Connected Devices</h2>
|
||||||
<p>The list of connected USB devices as seen by the posbox</p>
|
<p>The list of connected USB devices as seen by the posbox</p>
|
||||||
"""
|
"""
|
||||||
|
if debug is None:
|
||||||
|
resp += """(<a href="/hw_proxy/status?debug">debug version</a>)"""
|
||||||
devices = commands.getoutput("lsusb").split('\n')
|
devices = commands.getoutput("lsusb").split('\n')
|
||||||
count = 0
|
count = 0
|
||||||
resp += "<div class='devices'>\n"
|
resp += "<div class='devices'>\n"
|
||||||
|
@ -117,6 +119,17 @@ class Proxy(http.Controller):
|
||||||
|
|
||||||
resp += "</div>\n</body>\n</html>\n\n"
|
resp += "</div>\n</body>\n</html>\n\n"
|
||||||
|
|
||||||
|
if debug is not None:
|
||||||
|
resp += """
|
||||||
|
|
||||||
|
<h3>Debug version</h3>
|
||||||
|
<p><tt>lsusb -v</tt> output:</p>
|
||||||
|
<pre>
|
||||||
|
%s
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
""" % subprocess.check_output('lsusb -v', shell=True)
|
||||||
|
|
||||||
return request.make_response(resp,{
|
return request.make_response(resp,{
|
||||||
'Cache-Control': 'no-cache',
|
'Cache-Control': 'no-cache',
|
||||||
'Content-Type': 'text/html; charset=utf-8',
|
'Content-Type': 'text/html; charset=utf-8',
|
||||||
|
|
Loading…
Reference in New Issue