<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I think the query to add runs and tests needs to be joined to get only runs and tests referenced from this machine. Also append the test and run IDs to the json object.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 8, 2014, at 3:25 PM, Michael Zolotukhin <<a href="mailto:mzolotukhin@apple.com" class="">mzolotukhin@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">This patch adds JSON-format for machine-overview page. Does it look good?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Michael</div><div class=""><br class=""></div><div class=""><div class=""><font face="Menlo" class="">Index: lnt/server/ui/views.py</font></div><div class=""><font face="Menlo" class="">===================================================================</font></div><div class=""><font face="Menlo" class="">--- lnt/server/ui/views.py<span class="Apple-tab-span" style="white-space:pre"> </span>(revision 223085)</font></div><div class=""><font face="Menlo" class="">+++ lnt/server/ui/views.py<span class="Apple-tab-span" style="white-space:pre"> </span>(working copy)</font></div><div class=""><font face="Menlo" class="">@@ -172,6 +172,20 @@</font></div><div class=""><font face="Menlo" class=""> order_by(ts.Run.start_time.desc()))</font></div><div class=""><font face="Menlo" class=""> associated_runs = associated_runs.items()</font></div><div class=""><font face="Menlo" class=""> associated_runs.sort()</font></div><div class=""><font face="Menlo" class="">+ if bool(request.args.get('json')):</font></div><div class=""><font face="Menlo" class="">+ json_obj = dict()</font></div><div class=""><font face="Menlo" class="">+ machine_obj = ts.query(ts.Machine).filter(ts.Machine.id == id).one()</font></div><div class=""><font face="Menlo" class="">+ json_obj['name'] = machine_obj.name</font></div><div class=""><font face="Menlo" class="">+ json_obj['id'] = machine_obj.id</font></div><div class=""><font face="Menlo" class="">+ json_obj['runs'] = []</font></div><div class=""><font face="Menlo" class="">+ for t in ts.query(ts.Run):</font></div><div class=""><font face="Menlo" class="">+ json_obj['runs'].append((t.order.llvm_project_revision,</font></div><div class=""><font face="Menlo" class="">+ t.start_time,</font></div><div class=""><font face="Menlo" class="">+ t.end_time))</font></div><div class=""><font face="Menlo" class="">+ json_obj['tests'] = []</font></div><div class=""><font face="Menlo" class="">+ for test in ts.query(ts.Test).all():</font></div><div class=""><font face="Menlo" class="">+ json_obj['tests'].append((test.name, test.id))</font></div><div class=""><font face="Menlo" class="">+ return flask.jsonify(**json_obj)</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class=""> return render_template("v4_machine.html",</font></div><div class=""><font face="Menlo" class=""> testsuite_name=g.testsuite_name, id=id,</font></div><div class=""><font face="Menlo" class="">Index: tests/server/ui/V4Pages.py</font></div><div class=""><font face="Menlo" class="">===================================================================</font></div><div class=""><font face="Menlo" class="">--- tests/server/ui/V4Pages.py<span class="Apple-tab-span" style="white-space:pre"> </span>(revision 223085)</font></div><div class=""><font face="Menlo" class="">+++ tests/server/ui/V4Pages.py<span class="Apple-tab-span" style="white-space:pre"> </span>(working copy)</font></div><div class=""><font face="Menlo" class="">@@ -38,6 +38,9 @@</font></div><div class=""><font face="Menlo" class=""> # Get a machine overview page.</font></div><div class=""><font face="Menlo" class=""> check_code(client, '/v4/nts/machine/1')</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">+ # Get a machine overview page in JSON format.</font></div><div class=""><font face="Menlo" class="">+ check_code(client, '/v4/nts/machine/1?json=true')</font></div><div class=""><font face="Menlo" class="">+</font></div><div class=""><font face="Menlo" class=""> # Get the order summary page.</font></div><div class=""><font face="Menlo" class=""> check_code(client, '/v4/nts/all_orders')</font></div></div></div></div></blockquote></div><br class=""></div></body></html>