This repository has been archived on 2023-02-19. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-buildbot/templates/forms.html

284 lines
12 KiB
HTML

{% macro cancel_pending_build(cancel_url, authz, short=False, id='all') %}
<form method="post" name="cancel" action="{{ cancel_url }}" class='form-horizontal cancelbuild'
{{ 'style="display:inline"' if short else '' }}>
{% if not short %}
{% if id == 'all' %}
<p>To cancel all builds, push the 'Cancel' button</p>
<p>To cancel individual builds, click the 'Cancel' buttons above.</p>
{% else %}
<p>To cancel this build, push the 'Cancel' button</p>
{% endif %}
{% endif %}
<input type="hidden" name="id" value="{{ id }}" />
<input class="btn btn-default btn-success btn-squishy" type="submit" value="Cancel" />
</form>
{% endmacro %}
{% macro stop_change_builds(stopchange_url, changenum, authz) %}
{% if not changenum %}
<form method="post" action="{{ stopchange_url }}" class='form-horizontal stopchange'>
{% if changenum %}
<p>To cancel all builds for this change, push the 'Cancel' button</p>
{% else %}
<p>To cancel builds for this builder for a given change, fill out the
following field and push the 'Cancel' button</p>
{% endif %}
{% if changenum %}
<input type="hidden" name="change" value="{{ changenum }}" />
{% else %}
<div class="row">
<span class="label">Change #:</span>
<input type="text" name="change"/>
</div>
{% endif %}
<input class="btn btn-default btn-success btn-squishy" type="submit" value="Cancel" />
</form>
{% endif %}
{% endmacro %}
{% macro stop_build(stop_url, authz, on_all=False, on_selected=False, builders=[], short=False, label="Build") %}
{% if not short %}
<div class="box">
<form method="post" name="stop_build" action="{{ stop_url }}" class='form-horizontal stopbuild'
{{ 'style="display:inline"' if short else '' }}>
{% if not short %}
{% if on_all %}
<p>To stop all builds, fill out the following field and
push the <i>Stop {{ label }}</i> button</p>
{% elif on_selected %}
<p>To stop selected builds, select the builders, fill out the
following field and push the <i>Stop {{ label }}</i> button</p>
<table>
{% for b in builders %}
<tr>
<td align="center"><input type="checkbox" name="selected" value="{{ b.name }}"></td>
<td class="box"><a href="{{ b.link }}">{{ b.name|e }}</a></td>
</tr>
{% endfor %}
</table>
{% else %}
<p>To stop this build, fill out the following field and
push the <i>Stop {{ label }}</i> button</p>
{% endif %}
{% endif %}
{% if not short %}
<p>
<span style="display: inline-block; width: 120pt;">Reason:</span>
<input type="text" name="comments"/>
</p>
<hr>
<p><input class="btn btn-default btn-success btn-squishy btn-block" type="submit" value="Stop {{ label }}" /></p>
{% else %}
<input class="btn btn-default btn-success btn-squishy" type="submit" value="Stop {{ label }}" />
{% endif %}
</form>
</div>
{% endif %}
{% endmacro %}
{% macro cancel_build(cancel_url, authz, on_all=False, on_selected=False, builders=[], short=False, label="Build") %}
{% if not short %}
<form method="post" name="cancel_build" action="{{ cancel_url }}" class='form-horizontal cancelbuild'
{{ 'style="display:inline"' if short else '' }}>
{% if not short %}
{% if on_all %}
<p>To cancel all pending builds, fill out the following field and
push the <i>Cancel {{ label }}</i> button</p>
{% elif on_selected %}
<p>To cancel selected pending builds, select the builders, fill out the
following field and push the <i>Cancel {{ label }}</i> button</p>
<table>
{% for b in builders %}
<tr>
<td align="center"><input type="checkbox" name="selected" value="{{ b.name }}"></td>
<td class="box"><a href="{{ b.link }}">{{ b.name|e }}</a></td>
</tr>
{% endfor %}
</table>
{% else %}
<p>To cancel this pending build, fill out the following field and
push the <i>Cancel {{ label }}</i> button</p>
{% endif %}
{% endif %}
{% if not short %}
<div class="row">
<span class="label">Reason:</span>
<input type="text" name="comments"/>
</div>
{% endif %}
<input class="btn btn-default btn-success btn-squishy" type="submit" value="Cancel {{ label }}" />
</form>
{% endif %}
{% endmacro %}
{# TODO(sergey): Move hardcoded span with inline-block into a CSS class. #}
{% macro force_build_scheduler_parameter(f, authz, request, sch, default_props) %}
{% if f and not f.hide and (f.fullName != "username" or not authz.authenticated(request)) %}
<div class="{% for subtype in f.type %} force-{{subtype}}{%endfor%}"{% if f.name %} id="force-{{sch.name}}-{{f.fullName}}"{% endif %}><p>
{% if 'text' in f.type or 'int' in f.type %}
<span style="display: inline-block; width: 20%;">{{f.label}}</span>
<input type='text' size='{{f.size}}' name='{{f.fullName}}' value='{{default_props[sch.name+"."+f.fullName]}}' />
{% elif 'bool' in f.type%}
<input type='checkbox' name='checkbox' value='{{f.fullName}}' {{default_props[sch.name+"."+f.fullName]}} />
<span class="label">{{f.label}}</span>
{% elif 'textarea' in f.type %}
<span class="label">{{f.label}}</span>
<textarea name='{{f.fullName}}' rows={{f.rows}} cols={{f.cols}}>{{default_props[sch.name+"."+f.fullName]}}</textarea>
{% elif 'list' in f.type %}
<span style="display: inline-block; width: 20%;">{{f.label}}</span>
<span class="select">
<select name='{{f.fullName}}' {{ f.multiple and "multiple" or ""}}>
{% for c in default_props[sch.name+"."+f.fullName+".choices"] %}
<option {{(c in default_props[sch.name+"."+f.fullName]) and "selected" or ""}}>{{c}}</option>
{% endfor %}
</select>
</span>
{% elif 'nested' in f.type %}
{% if f.label %}<span>{{f.label}}</span>{% endif %}
{% for subfield in f.fields %}
{{ force_build_scheduler_parameter(subfield, authz, request, sch, default_props) }}
{% endfor %}
{% endif %}
</p></div>
{% endif %}
{% endmacro %}
{% macro force_build_one_scheduler(force_url, authz, request, on_all, on_selected, builders, sch, default_props) %}
<form method="post" name="force_build" action="{{ force_url }}" class="command_forcebuild">
<h3>{{ sch.name|e }}</h3>
{% if on_all %}
<p>To force a build on <strong>all Builders</strong>, fill out the following fields
and push the 'Force Build' button</p>
{% elif on_selected %}
<p>To force a build on <strong>certain Builders</strong>, select the
builders, fill out the following fields and push the
'Force Build' button</p>
<table>
{% for b in builders %}
{% if b.name in sch.builderNames %}
<tr>
<td align="center"><input type="checkbox" name="selected" value="{{ b.name }}"></td>
<td class="box"><a href="{{ b.link }}">{{ b.name|e }}</a></td>
</tr>
{% endif %}
{% endfor %}
</table>
{% else %}
<p>To force a build, fill out the following fields and
push the 'Force Build' button</p>
{% endif %}
<input type='hidden' name='forcescheduler' value='{{sch.name}}' />
{% for f in sch.all_fields %}
{{ force_build_scheduler_parameter(f, authz, request, sch, default_props) }}
{% endfor %}
<hr>
<p><input class="btn btn-default btn-success btn-squishy btn-block" type="submit" value="{{ sch.buttonName }}" /></p>
</form>
{% endmacro %}
{% macro force_build(force_url, authz, request, on_all=False, on_selected=False, builders=[], force_schedulers={},default_props={}) %}
<div class="box">
{% for name, sch in force_schedulers.items() | sort %}
{{ force_build_one_scheduler(force_url, authz, request, on_all, on_selected, builders, sch, default_props=default_props) }}
{% endfor %}
</div>
{% endmacro %}
{% macro graceful_shutdown(shutdown_url, authz) %}
<form method="post" action="{{ shutdown_url }}" class='form-horizontal graceful_shutdown'>
<p>To cause this slave to shut down gracefully when it is idle,
push the 'Graceful Shutdown' button</p>
<input class="btn btn-default btn-success btn-squishy" type="submit" value="Graceful Shutdown" />
</form>
{% endmacro %}
{% macro pause_slave(pause_url, authz, paused) %}
<form method="post" action="{{ pause_url }}" class='form-horizontal pause_slave'>
{% if paused %}
<p>To cause this slave to start running new builds again,
push the 'Unpause Slave' button</p>
{% else %}
<p>To cause this slave to stop running new builds,
push the 'Pause Slave' button</p>
{% endif %}
{% if paused %}
<input class="btn btn-default btn-success btn-squishy" type="submit" value="Unpause Slave" />
{% else %}
<input class="btn btn-default btn-success btn-squishy" type="submit" value="Pause Slave" />
{% endif %}
</form>
{% endmacro %}
{% macro clean_shutdown(shutdown_url, authz) %}
<form method="post" action="{{ shutdown_url }}" class='form-horizontal clean_shutdown'>
<p>To cause this master to shut down cleanly, push the 'Clean Shutdown' button.</p>
<p>No other builds will be started on this master, and the master will
stop once all current builds are finished.</p>
<input class="btn btn-default btn-success btn-squishy" type="submit" value="Clean Shutdown" />
</form>
{% endmacro %}
{% macro cancel_clean_shutdown(cancel_shutdown_url, authz) %}
<form method="post" action="{{ cancel_shutdown_url }}" class='form-horizontal cancel_clean_shutdown'>
<p>To cancel a previously initiated shutdown, push the 'Cancel Shutdown' button.</p>
<input class="btn btn-default btn-success btn-squishy" type="submit" value="Cancel Shutdown" />
</form>
{% endmacro %}
{% macro ping_builder(ping_url, authz) %}
<form method="post" action="{{ ping_url }}" class='form-horizontal ping_builder'>
<p>To ping the buildslave(s), push the 'Ping' button</p>
<input class="btn btn-default btn-success btn-squishy" type="submit" value="Ping Builder" />
</form>
{% endmacro %}
{% macro rebuild_build(rebuild_url, authz, ss) %}
<form method="post" action="{{ rebuild_url }}" class="form-horizontal rebuild">
<div class="box">
{% if on_all %}
<p>To force a build on <strong>all Builders</strong>, fill out the following fields
and push the 'Force Build' button</p>
{% else %}
<p>To force a build, fill out the following fields and
push the 'Rebuild' button</p>
{% endif %}
<p>
<span style="display: inline-block; width: 20%;">Reason for re-running build:</span>
<input type='text' name='comments' />
</p>
<p>
<span style="display: inline-block; width: 20%;">Rebuild using:</span>
<select name="useSourcestamp">
<option value='exact' selected>Exact same revisions</option>
<option value='updated'>Same sourcestamps (ignoring 'got revision')</option>
</select>
</p>
<hr>
<p><input class="btn btn-default btn-success btn-squishy btn-block" type="submit" value="Rebuild" /></p>
</div>
</form>
{% endmacro %}
{% macro show_users(users_url, authz) %}
<form method="post" action="{{ users_url }}" class='form-horizontal show_users'>
<p>To show users, press the 'Show Users' button</p>
<input class="btn btn-default btn-success btn-squishy" type="submit" value="Show Users" />
</form>
{% endmacro %}