[llvm-commits] [zorg] r147081 - in /zorg/trunk/lnt/lnt/server/ui: templates/v4_order.html templates/v4_overview.html views.py
Daniel Dunbar
daniel at zuster.org
Wed Dec 21 12:00:24 PST 2011
Author: ddunbar
Date: Wed Dec 21 14:00:24 2011
New Revision: 147081
URL: http://llvm.org/viewvc/llvm-project?rev=147081&view=rev
Log:
[lnt/v0.4] lnt.server.ui/v4: Add a primitive UI for browing runs by order, which
is now trivial to implement.
Added:
zorg/trunk/lnt/lnt/server/ui/templates/v4_order.html
Modified:
zorg/trunk/lnt/lnt/server/ui/templates/v4_overview.html
zorg/trunk/lnt/lnt/server/ui/views.py
Added: zorg/trunk/lnt/lnt/server/ui/templates/v4_order.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/templates/v4_order.html?rev=147081&view=auto
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/templates/v4_order.html (added)
+++ zorg/trunk/lnt/lnt/server/ui/templates/v4_order.html Wed Dec 21 14:00:24 2011
@@ -0,0 +1,65 @@
+{% import "utils.html" as utils %}
+
+{% extends "layout.html" %}{
+{% set components = [(ts.name, v4_url_for("v4_overview"))] %}
+{% block head %}
+ <script src="{{ url_for('.static', filename='popup.js') }}"></script>
+{% endblock %}
+{% block title %}Order: {{order.id}}{% endblock %}
+{% block body %}
+
+<h3>Order Fields</h3>
+<table border="1">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Value</th>
+ </tr>
+ </thead>
+ <tr>
+ <td>Ordinal</td>
+ <td>{{order.ordinal}}</td>
+ </tr>
+{% for field in order.fields %}
+ <tr>
+ <td>{{field.name}}</td>
+ <td>{{order.get_field(field)}}</td>
+ </tr>
+{% endfor %}
+</table>
+
+{# Provide links to the previous and next orders. #}
+{% if order.ordinal != 0 %}
+<a href="{{v4_url_for('v4_order', ordinal=order.ordinal - 1)}}">Previous</a>
+{% endif %}
+<a href="{{v4_url_for('v4_order', ordinal=order.ordinal + 1)}}">Next</a>
+
+{# List all submissions which reported for this order. #}
+<h3>Submissions</h3>
+<table class="sortable" border=1>
+ <thead>
+ <tr>
+ <th>Start Time</th>
+ <th>End Time</th>
+ <th>Machine</th>
+ <th>Results</th>
+ </tr>
+ </thead>
+
+{# Show the active submissions. #}
+{% for r in ts.query(ts.Run).filter_by(order_id = order.id) %}
+{% set m = r.machine %}
+ <tr>
+ <td>{{r.start_time}}</td>
+ <td>{{r.end_time}}</td>
+ <td align=left><a href="{{v4_url_for('v4_machine',id=m.id)}}">{{
+ m.name}}:{{m.id}}</a></td>
+ <td><a href="{{v4_url_for('v4_run', id=r.id)}}">
+ View Results</a></td>
+ </tr>
+{% endfor %}
+</table>
+<p><b>Num. Submissions:</b> {{
+ ts.query(ts.Run).filter_by(order_id = order.id).count()}}</p>
+
+{% endblock %}
Modified: zorg/trunk/lnt/lnt/server/ui/templates/v4_overview.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/templates/v4_overview.html?rev=147081&r1=147080&r2=147081&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/templates/v4_overview.html (original)
+++ zorg/trunk/lnt/lnt/server/ui/templates/v4_overview.html Wed Dec 21 14:00:24 2011
@@ -53,7 +53,8 @@
{% for r,run_order in active_submissions %}
{% set m = r.machine %}
<tr>
- <td>{{run_order}}</td></td>
+ <td><a href="{{v4_url_for('v4_order', ordinal=r.order.ordinal)}}">{{
+ run_order}}</a></td></td>
<td>{{r.start_time}}</td>
<td>{{r.end_time}}</td>
<td align=left><a href="{{v4_url_for('v4_machine',id=m.id)}}">{{
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=147081&r1=147080&r2=147081&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/views.py (original)
+++ zorg/trunk/lnt/lnt/server/ui/views.py Wed Dec 21 14:00:24 2011
@@ -637,6 +637,18 @@
testsuite_name=g.testsuite_name, id=id,
associated_runs=associated_runs)
- at v4_route("/run/<id>")
+ at v4_route("/<int:id>")
def v4_run(id):
- return "run %d" % int(id)
+ return "run %d" % id
+
+ at v4_route("/order/<int:ordinal>")
+def v4_order(ordinal):
+ # Get the testsuite.
+ ts = request.get_testsuite()
+
+ # Get the order.
+ order = ts.query(ts.Order).filter_by(ordinal = ordinal).first()
+ if order is None:
+ abort(404)
+
+ return render_template("v4_order.html", ts=ts, order=order)
More information about the llvm-commits
mailing list