[llvm-commits] [zorg] r125923 - in /zorg/trunk/llvmlab/llvmlab/ui: app.py filters.py templates/dashboard.html templates/phase_popup.html
Daniel Dunbar
daniel at zuster.org
Fri Feb 18 08:44:01 PST 2011
Author: ddunbar
Date: Fri Feb 18 10:44:01 2011
New Revision: 125923
URL: http://llvm.org/viewvc/llvm-project?rev=125923&view=rev
Log:
llvmlab: Print timestamps in human readable form.
- Also, add another link to the phase builder from the phase popup header.
Added:
zorg/trunk/llvmlab/llvmlab/ui/filters.py
Modified:
zorg/trunk/llvmlab/llvmlab/ui/app.py
zorg/trunk/llvmlab/llvmlab/ui/templates/dashboard.html
zorg/trunk/llvmlab/llvmlab/ui/templates/phase_popup.html
Modified: zorg/trunk/llvmlab/llvmlab/ui/app.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/app.py?rev=125923&r1=125922&r2=125923&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/app.py (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/app.py Fri Feb 18 10:44:01 2011
@@ -10,6 +10,7 @@
import llvmlab.ci.summary
import llvmlab.ci.status
import llvmlab.ui.ci.views
+import llvmlab.ui.filters
import llvmlab.ui.frontend.views
class App(flask.Flask):
@@ -55,6 +56,9 @@
app.config.summary = llvmlab.ci.summary.Summary(
llvmlab.ui.ci.views.g_config, app.config.status)
+ # Register additional filters.
+ llvmlab.ui.filters.register(app)
+
return app
@staticmethod
Added: zorg/trunk/llvmlab/llvmlab/ui/filters.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/filters.py?rev=125923&view=auto
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/filters.py (added)
+++ zorg/trunk/llvmlab/llvmlab/ui/filters.py Fri Feb 18 10:44:01 2011
@@ -0,0 +1,13 @@
+import datetime
+
+from flask import current_app
+
+def filter_asusertime(time):
+ # FIXME: Support alternate timezones?
+ ts = datetime.datetime.fromtimestamp(time)
+ return ts.strftime('%Y-%m-%d %H:%M:%S %Z PST')
+
+def register(app):
+ for name,object in globals().items():
+ if name.startswith('filter_'):
+ app.jinja_env.filters[name[7:]] = object
Modified: zorg/trunk/llvmlab/llvmlab/ui/templates/dashboard.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/templates/dashboard.html?rev=125923&r1=125922&r2=125923&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/templates/dashboard.html (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/templates/dashboard.html Fri Feb 18 10:44:01 2011
@@ -143,7 +143,7 @@
The most recent released revision is <b>r{{
final_phase.passing.source_stamp }}</b>
validated at:
-<i>{{ final_phase.passing.end_time }}</i>
+<i>{{ final_phase.passing.end_time|asusertime }}</i>
(available <a href="{{ url_for('latest_release') }}">here</a>).
{% else %}
<i><b>No release is currently available!</b></i>
@@ -161,7 +161,7 @@
<b>WARNING!</b> LLVM is currently failing the <i>{{ phase.name }}</i> checks.
The failures started in r{{ phase_info.failing.source_stamp }} at {{
- phase_info.failing.end_time }}.
+ phase_info.failing.end_time|asusertime }}.
{% endif %}
@@ -271,12 +271,16 @@
</tr>
</table>
+<hr>
+
{# The div we use to include phase popups. #}
<div id="phase_popup" style="display: none;"></div>
{# The iframe we use to load the phase popup source. This is never actually
displayed, just used to load the HTML we insert into the popup div. #}
<iframe id="phase_popup_frame" style="display: none;"></iframe>
+<hr>
+
{# The div we use to include timing popups. #}
<div id="timing_popup" style="display: none;">
<canvas id="timing_graph" width="400" height="300"></canvas>
Modified: zorg/trunk/llvmlab/llvmlab/ui/templates/phase_popup.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/templates/phase_popup.html?rev=125923&r1=125922&r2=125923&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/templates/phase_popup.html (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/templates/phase_popup.html Fri Feb 18 10:44:01 2011
@@ -1,6 +1,10 @@
{# Fragment template for rendering an individual phase pop-up #}
-<h3>Phase {{ phase.number }} {{ phase.name }} - r{{ source_stamp }}</h3>
+<h3><a href="{{ config.status.master_url }}/builders/{{
+ phase.phase_builder }}">{{ phase.name }}</a>
+ (Phase {{ phase.number }}) -
+ <a href="http://llvm.org/viewvc/llvm-project?view=rev&revision={{
+ source_stamp }}">r{{ source_stamp }}</a></h3>
<table>
<thead>
<tr><th>Builder</th><th>Status</th></tr>
More information about the llvm-commits
mailing list