[LNT] r237987 - Add a searchable machines page
Chris Matthews
cmatthews5 at apple.com
Thu May 21 19:20:54 PDT 2015
Author: cmatthews
Date: Thu May 21 21:20:53 2015
New Revision: 237987
URL: http://llvm.org/viewvc/llvm-project?rev=237987&view=rev
Log:
Add a searchable machines page
Sometimes it is hard to find old machines in LNT. This interface
exposes them directly.
Added:
lnt/trunk/lnt/server/ui/templates/all_machines.html
Modified:
lnt/trunk/lnt/server/ui/templates/layout.html
lnt/trunk/lnt/server/ui/templates/v4_overview.html
lnt/trunk/lnt/server/ui/views.py
Added: lnt/trunk/lnt/server/ui/templates/all_machines.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/all_machines.html?rev=237987&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/all_machines.html (added)
+++ lnt/trunk/lnt/server/ui/templates/all_machines.html Thu May 21 21:20:53 2015
@@ -0,0 +1,56 @@
+{% import "utils.html" as utils %}
+
+{% extends "layout.html" %}
+{% set components = [(ts.name, v4_url_for("v4_recent_activity"))] %}
+{% block title %}Machines{%endblock%}
+
+
+{# Add JS to initialize the graph. #}
+{% block onload %}init(){% endblock %}
+
+{% block javascript %}
+
+function init() {
+ // Filter table by filter text box.
+ $(document).ready(function() {
+ (function ($) {
+ $('#filter').keyup(function () {
+
+ var filter_regex = new RegExp($(this).val(), 'i');
+ $('.searchable tr').hide();
+ $('.searchable tr').filter(function () {
+ return filter_regex.test($(this).text());
+ }).show();
+ })
+ }(jQuery));
+ });
+}
+
+{% endblock %}
+
+</script>
+
+{% block body %}
+<div class="input-group"> <span class="input-group-addon">Filter</span>
+ <input id="filter" type="text" class="form-control" placeholder="Machines...">
+</div>
+
+ <section id="machines" />
+ {# List all Machines which reported for this database. #}
+ <h3>Machines</h3>
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th>Name</th>
+ </tr>
+ </thead>
+ <tbody class="searchable">
+ {# Show the active submissions. #}
+ {% for r in ts.query(ts.Machine) %}
+ <tr>
+ <td>{{ utils.render_machine(r) }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+{% endblock %}
Modified: lnt/trunk/lnt/server/ui/templates/layout.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/layout.html?rev=237987&r1=237986&r2=237987&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/layout.html (original)
+++ lnt/trunk/lnt/server/ui/templates/layout.html Thu May 21 21:20:53 2015
@@ -113,6 +113,7 @@
<li><a href="{{ v4_url_for('v4_recent_activity') }}">Recent Activity</a></li>
<li><a href="{{ v4_url_for('v4_global_status') }}">Global Status</a></li>
<li><a href="{{ v4_url_for('v4_daily_report_overview') }}">Daily Report</a></li>
+ <li><a href="{{ v4_url_for('v4_machines') }}">All Machines</a></li>
<li class="divider"></li>
<li class="disabled"><a href=#>Summary Report</a></li>
{#"{{ v4_url_for('v4_summary_report') }}"#}
Modified: lnt/trunk/lnt/server/ui/templates/v4_overview.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_overview.html?rev=237987&r1=237986&r2=237987&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_overview.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_overview.html Thu May 21 21:20:53 2015
@@ -68,6 +68,12 @@ div .dashboard_box {
<p>high-level performance summary charts (WIP)</p>
</div>
</a>
+<a href="{{ v4_url_for('v4_machines') }}">
+ <div class="dashboard_box dashboard">
+ <h2>All Machines</h2>
+ <p>All the machines with runs on this server.</p>
+ </div>
+</a>
</div>
Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=237987&r1=237986&r2=237987&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Thu May 21 21:20:53 2015
@@ -161,6 +161,17 @@ def v4_recent_activity():
active_machines=active_machines,
active_submissions=active_submissions)
+ at v4_route("/machine/")
+def v4_machines():
+ # 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()
+
+ return render_template("all_machines.html",
+ ts=ts)
+
@v4_route("/machine/<int:id>")
def v4_machine(id):
# Compute the list of associated runs, grouped by order.
@@ -196,6 +207,7 @@ def v4_machine(id):
associated_runs=associated_runs)
except sqlalchemy.orm.exc.NoResultFound as e:
abort(404)
+
class V4RequestInfo(object):
def __init__(self, run_id, only_html_body=True):
self.db = request.get_db()
More information about the llvm-commits
mailing list