Author: Antonio Cuni <[email protected]>
Branch: 0.8.4-compat
Changeset: r561:077a430415b9
Date: 2011-08-07 16:34 +0200
http://bitbucket.org/pypy/buildbot/changeset/077a430415b9/
Log: add a link to summary from the builder page by customizing the
templace, and kill the old hack
diff --git a/bot2/pypybuildbot/master.py b/bot2/pypybuildbot/master.py
--- a/bot2/pypybuildbot/master.py
+++ b/bot2/pypybuildbot/master.py
@@ -29,27 +29,6 @@
StatusResourceBuilder.force = my_force
# Done
-# Add a link from the builder page to the summary page
-def my_content(self, req, ctx):
- data = _previous_content(self, req, ctx)
- MARKER = 'waterfall</a>)'
- i = data.find(MARKER)
- if i >= 0:
- from twisted.web import html
- i += len(MARKER)
- b = self.builder_status
- url =
self.path_to_root(req)+"summary?builder="+html.escape(b.getName())
- data = '%s (<a href="%s">view in summary</a>)%s' % (
- data[:i],
- url,
- data[i:])
- return data
-
-_previous_content = StatusResourceBuilder.content
-## if _previous_content.__name__ == 'content':
-## StatusResourceBuilder.content = my_content
-# Done
-
# Add a similar link from the build page to the summary page
def my_content_2(self, req, ctx):
data = _previous_content_2(self, req, ctx)
diff --git a/master/templates/builder.html b/master/templates/builder.html
new file mode 100644
--- /dev/null
+++ b/master/templates/builder.html
@@ -0,0 +1,113 @@
+{% from 'build_line.html' import build_table %}
+{% import 'forms.html' as forms %}
+
+{% extends "layout.html" %}
+{% block content %}
+
+<h1>Builder {{ name }}</h1>
+
+<!-- PyPy specific change: add the "view in summary" link -->
+<p>
+ (<a href="{{ path_to_root }}waterfall?show={{ name }}">view in waterfall</a>)
+
+ (<a href="{{ path_to_root }}summary?builder={{ name }}">view in summary</a>)
+</p>
+
+<div class="column">
+
+{% if current %}
+ <h2>Current Builds:</h2>
+ <ul>
+ {% for b in current %}
+ <li><a href="{{ b.link }}">{{ b.num }}</a>
+ {% if b.when %}
+ ETA: {{ b.when_time }} [{{ b.when }}]
+ {% endif %}
+
+ {{ b.current_step }}
+
+ {% if authz.advertiseAction('stopBuild') %}
+ {{ forms.stop_build(b.stop_url, authz, on_all=False, short=True,
label='Build') }}
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+{% else %}
+ <h2>No current builds</h2>
+{% endif %}
+
+{% if pending %}
+ <h2>Pending Build Requests:</h2>
+ <ul>
+ {% for b in pending %}
+ <li><small>({{ b.when }}, waiting {{ b.delay }})</small>
+
+ {% if authz.advertiseAction('cancelPendingBuild') %}
+ {{ forms.cancel_pending_build(builder_url+"/cancelbuild", authz,
short=True, id=b.id) }}
+ {% endif %}
+
+ {% if b.num_changes < 4 %}
+ {% for c in b.changes %}{{ c.revision|shortrev(c.repo) }}
+ (<a href="{{ c.url }}">{{ c.who }}</a>){% if not loop.last %},{% endif
%}
+ {% endfor %}
+ {% else %}
+ ({{ b.num_changes }} changes)
+ {% endif %}
+
+ </li>
+ {% endfor %}
+ </ul>
+
+ {% if authz.advertiseAction('cancelPendingBuild') %}
+ {{ forms.cancel_pending_build(builder_url+"/cancelbuild", authz,
short=False, id='all') }}
+ {% endif %}
+
+{% else %}
+ <h2>No Pending Build Requests</h2>
+{% endif %}
+
+<h2>Recent Builds:</h2>
+
+{{ build_table(recent) }}
+
+</div>
+<div class="column">
+
+<h2>Buildslaves:</h2>
+<table class="info">
+{% if slaves %}
+<tr>
+ <th>Name</th>
+ <th>Status</th>
+ <th>Admin</th>
+</tr>
+{% endif %}
+{% for s in slaves %}
+ <tr class="{{ loop.cycle('alt', '') }}">
+ <td><b><a href="{{ s.link|e }}">{{ s.name|e }}</a></b></td>
+ {% if s.connected %}
+ <td class="idle">connected</td>
+ <td>{{ s.admin|email if s.admin else ""}}</td>
+ {% else %}
+ <td class="offline">offline</td>
+ <td/>
+ {% endif %}
+ </tr>
+{% else %}
+ <td>no slaves attached</td>
+{% endfor %}
+</table>
+
+{% if authz.advertiseAction('pingBuilder') %}
+ <h2>Ping slaves</h2>
+ {{ forms.ping_builder(builder_url+"/ping", authz) }}
+{% endif %}
+
+{% if authz.advertiseAction('forceBuild') %}
+ <h2>Force build</h2>
+ {{ forms.force_build(builder_url+"/force", authz, False) }}
+{% endif %}
+
+</div>
+
+{% endblock %}
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit