[llvm-commits] [zorg] r147044 - in /zorg/trunk/lnt/lnt/server/ui: templates/v4_machine.html views.py

Daniel Dunbar daniel at zuster.org
Tue Dec 20 22:22:17 PST 2011


Author: ddunbar
Date: Wed Dec 21 00:22:17 2011
New Revision: 147044

URL: http://llvm.org/viewvc/llvm-project?rev=147044&view=rev
Log:
[lnt/v0.4] lnt.server.ui: Implement V4 machine page.

Added:
    zorg/trunk/lnt/lnt/server/ui/templates/v4_machine.html
Modified:
    zorg/trunk/lnt/lnt/server/ui/views.py

Added: zorg/trunk/lnt/lnt/server/ui/templates/v4_machine.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/templates/v4_machine.html?rev=147044&view=auto
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/templates/v4_machine.html (added)
+++ zorg/trunk/lnt/lnt/server/ui/templates/v4_machine.html Wed Dec 21 00:22:17 2011
@@ -0,0 +1,92 @@
+{% import "utils.html" as utils %}
+
+{% set ts = request.get_testsuite() %}
+{% set machine = ts.getMachine(id) %}
+
+{% extends "layout.html" %}{
+% set components = [(testsuite_name, v4_url_for("v4_overview"))] %}
+{% block head %}
+        <script src="{{ url_for('.static', filename='popup.js') }}"></script>
+{% endblock %}
+{% block title %}Machine: {{machine.name}}:{{machine.id}}{% endblock %}
+{% block body %}
+
+<table width="100%%" border=1>
+  <tr>
+    <td valign="top" width="200">
+      <a href="../..">Homepage</a>
+      <h4>Relatives:</h4>
+      <ul>
+
+{# List all machines with this name. #}
+{% for m in ts.machines(name=machine.name) %}
+        <li><a href="{{ v4_url_for('v4_machine', id=m.id)}}">{{
+            m.name}}:{{m.id}}</a></li>
+{% endfor %}
+      </ul>
+    </td>
+    <td valign="top">
+      <table border=1>
+      <tr>
+        <td> <b>Nickname</b> </td>
+        <td> {{machine.name}} </td>
+      </tr>
+      <tr>
+        <td> <b>Machine ID</b> </td>
+        <td> {{machine.id}} </td>
+      </tr>
+      </table>
+
+
+{{ utils.render_popup_begin('machine_info', 'Machine Info', true, 1) }}
+      <h4>Fields</h4>
+      <table border=1>
+{% for item in ts.machine_fields %}
+      <tr>
+        <td> <b>{{item.name}}</b> </td>
+        <td>{{machine.get_field(item)}}</td>
+      </tr>
+{% endfor %}
+      </table>
+      <h4>Parameters</h4>
+      <table border=1>
+{% for key,value in machine.get_parameters() %}
+      <tr>
+        <td> <b>{{key}}</b> </td>
+        <td>{{value}}</td>
+      </tr>
+{% endfor %}
+      </table>
+{{ utils.render_popup_end() }}
+
+<p>
+<table class="sortable" border=1>
+<thead>
+  <tr>
+    <th>Run Order</th>
+    <th>Start Time</th>
+    <th>End Time</th>
+    <th> </th>
+  </tr>
+</thead>
+{% for order,runs in associated_runs|sort|reverse %}
+{% for run in runs %}
+  <tr>
+{% if loop.first %}
+    <td rowspan="{{ runs|length }}" align=right>{{order}}</td>
+{% endif %}
+    <td>{{ run.start_time }}</td>
+    <td>{{ run.end_time }}s</td>
+    <td><a href="{{v4_url_for('v4_run', id=run.id)}}">
+        View Results</a></td>
+  </tr>
+{% endfor %}
+{% endfor %}
+</table>
+
+
+    </td>
+  </tr>
+</table>
+
+{% endblock %}

Modified: zorg/trunk/lnt/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/views.py?rev=147044&r1=147043&r2=147044&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/views.py (original)
+++ zorg/trunk/lnt/lnt/server/ui/views.py Wed Dec 21 00:22:17 2011
@@ -606,6 +606,8 @@
                            for run in recent_runs[::-1])
 
     # Compute the active submission list.
+    #
+    # FIXME: Remove hard coded field use here.
     N = 30
     active_submissions = [(r, r.order.llvm_project_revision)
                           for r in recent_runs[:N]]
@@ -615,9 +617,25 @@
                            active_machines=active_machines,
                            active_submissions=active_submissions)
 
- at v4_route("/machine/<id>")
+ at v4_route("/machine/<int:id>")
 def v4_machine(id):
-    return "machine %d" % int(id)
+    # Compute the list of associated runs, grouped by order.
+    from lnt.server.ui import util
+
+    # Gather all the runs on this machine.
+    ts = request.get_testsuite()
+
+    # FIXME: Remove hard coded field use here.
+    associated_runs = util.multidict(
+        (run_order, r)
+        for r,run_order in ts.query(ts.Run, ts.Order.llvm_project_revision).\
+            join(ts.Order).\
+            filter(ts.Run.machine_id == id))
+    associated_runs = associated_runs.items()
+
+    return render_template("v4_machine.html",
+                           testsuite_name=g.testsuite_name, id=id,
+                           associated_runs=associated_runs)
 
 @v4_route("/run/<id>")
 def v4_run(id):





More information about the llvm-commits mailing list