2013-02-21 01:33:57 +00:00
[% WRAPPER layout.tt title="Jobset $project.name:$jobset.name" %]
2009-04-02 16:15:57 +00:00
[% PROCESS common.tt %]
2013-09-21 14:47:52 +00:00
[% USE format %]
2009-04-02 16:15:57 +00:00
2013-03-19 15:14:47 +00:00
[% BLOCK renderJobsetInput %]
2009-04-02 16:15:57 +00:00
<tr class="input [% extraClass %]" [% IF id %]id="[% id %]"[% END %]>
<td>
2013-02-21 01:33:57 +00:00
<tt>[% HTML.escape(input.name) %]</tt>
2009-04-02 16:15:57 +00:00
</td>
<td>
[% INCLUDE renderSelection curValue=input.type param="$baseName-type" options=inputTypes %]
</td>
<td class="inputalts" id="[% baseName %]">
2013-10-03 18:03:57 +00:00
[% FOREACH alt IN input.search_related('jobsetinputalts', {}, { order_by => 'altnr' }) %]
2009-04-02 16:15:57 +00:00
<tt class="inputalt">
2013-02-21 01:33:57 +00:00
[% IF input.type == "string" %]
2014-08-13 15:25:08 +00:00
"<span class="keep-whitespace">[% HTML.escape(alt.value) %]</span>"
2009-04-02 16:15:57 +00:00
[% ELSE %]
2013-02-21 01:33:57 +00:00
[% HTML.escape(alt.value) %]
2009-04-02 16:15:57 +00:00
[% END %]
</tt>
[% END %]
</td>
</tr>
[% END %]
2013-03-19 15:14:47 +00:00
[% BLOCK renderJobsetInputs %]
2013-02-21 01:33:57 +00:00
<h3>Inputs</h3>
2013-04-26 12:49:11 +00:00
<table class="table table-striped table-condensed">
2013-02-21 01:33:57 +00:00
<thead>
<tr><th>Input name</th><th>Type</th><th>Values</th></tr>
</thead>
<tbody class="inputs">
[% FOREACH input IN jobset.jobsetinputs %]
2013-03-19 15:14:47 +00:00
[% INCLUDE renderJobsetInput input=input baseName="input-$input.name" %]
2013-02-21 01:33:57 +00:00
[% END %]
</tbody>
</table>
2009-04-02 16:15:57 +00:00
[% END %]
2013-02-21 01:33:57 +00:00
<ul class="nav nav-tabs">
2013-10-02 23:17:52 +00:00
[% IF c.user_exists %]
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Actions
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
2013-10-14 15:43:31 +00:00
[% INCLUDE menuItem title="Edit configuration" icon="icon-edit" uri=c.uri_for(c.controller('Jobset').action_for('edit'), c.req.captures) %]
2013-10-03 15:54:40 +00:00
[% INCLUDE menuItem title="Delete this jobset" icon="icon-trash" uri="javascript:deleteJobset()" %]
2015-07-14 07:39:29 +00:00
[% INCLUDE menuItem title="Clone this jobset" uri=c.uri_for(c.controller('Jobset').action_for('edit'), c.req.captures, { cloneJobset => 1 }) %]
2013-10-03 15:54:40 +00:00
[% INCLUDE menuItem title="Evaluate this jobset" uri="javascript:confirmEvaluateJobset()" %]
2013-10-02 23:17:52 +00:00
</ul>
</li>
[% END %]
2013-02-21 12:30:14 +00:00
<li class="active"><a href="#tabs-evaluations" data-toggle="tab">Evaluations</a></li>
2013-09-25 14:21:16 +00:00
[% IF jobset.errormsg || jobset.fetcherrormsg %]
2013-08-28 09:59:02 +00:00
<li><a href="#tabs-errors" data-toggle="tab"><span class="text-warning">Evaluation errors</span></a></li>
2013-02-21 01:33:57 +00:00
[% END %]
2013-08-28 12:22:16 +00:00
<li><a href="#tabs-jobs" data-toggle="tab">Jobs</a></li>
2013-06-24 23:00:59 +00:00
<li><a href="#tabs-configuration" data-toggle="tab">Configuration</a></li>
2013-11-11 13:49:39 +00:00
<li><a href="#tabs-links" data-toggle="tab">Links</a></li>
2015-04-14 06:58:55 +00:00
<li><a href="#tabs-channels" data-toggle="tab">Channels</a></li>
2013-02-21 01:33:57 +00:00
</ul>
2013-01-22 13:41:02 +00:00
2012-04-12 18:12:07 +00:00
<div id="generic-tabs" class="tab-content">
2013-01-22 13:41:02 +00:00
2013-02-21 12:30:14 +00:00
<div id="tabs-evaluations" class="tab-pane active">
2013-02-21 12:42:44 +00:00
<table class="info-table">
2013-02-21 12:30:14 +00:00
<tr>
<th>Last checked:</th>
<td>
[% IF jobset.lastcheckedtime %]
2013-09-25 14:21:16 +00:00
[% INCLUDE renderDateTime timestamp = jobset.lastcheckedtime %], [% IF jobset.errormsg || jobset.fetcherrormsg %]<em class="text-warning">with errors!</em>[% ELSE %]<em>no errors</em>[% END %]
2013-02-22 10:37:35 +00:00
[% ELSE %]
<em>never</em>
[% END %]
</td>
</tr>
<tr>
<th>Last evaluation:</th>
<td>
[% IF latestEval %]
[% INCLUDE renderDateTime timestamp = latestEval.timestamp %]
2013-02-21 12:30:14 +00:00
[% ELSE %]
<em>never</em>
[% END %]
</td>
</tr>
2013-02-26 15:10:36 +00:00
[% IF jobset.triggertime %]
<tr>
<th>Evaluation pending since:</th>
<td>[% INCLUDE renderDateTime timestamp = jobset.triggertime %]</td>
</tr>
[% END %]
2013-02-21 12:30:14 +00:00
</table>
<br/>
2013-02-21 01:33:57 +00:00
[% IF evals.size() > 0 %]
[% INCLUDE renderEvals linkToAll=c.uri_for(c.controller('Jobset').action_for('evals'), [project.name, jobset.name]) %]
[% END %]
2013-02-21 12:30:14 +00:00
</div>
2013-09-25 14:21:16 +00:00
[% IF jobset.errormsg || jobset.fetcherrormsg %]
2013-02-21 01:33:57 +00:00
<div id="tabs-errors" class="tab-pane">
2013-02-22 10:37:35 +00:00
<p>Errors occurred at [% INCLUDE renderDateTime timestamp=jobset.errortime %].</p>
2013-09-25 14:21:16 +00:00
<pre class="alert alert-error">[% HTML.escape(jobset.fetcherrormsg || jobset.errormsg) %]</pre>
2013-02-21 01:33:57 +00:00
</div>
[% END %]
2010-02-05 14:48:22 +00:00
2013-06-24 23:00:59 +00:00
<div id="tabs-configuration" class="tab-pane">
2013-02-21 01:33:57 +00:00
2013-02-21 12:42:44 +00:00
<table class="info-table">
2013-10-11 10:01:52 +00:00
<tr>
<th>State:</th>
<td>[% IF jobset.enabled == 0; "Disabled"; ELSIF jobset.enabled == 1; "Enabled"; ELSIF jobset.enabled == 2; "One-shot"; END %]</td>
</tr>
2013-02-21 01:33:57 +00:00
<tr>
<th>Description:</th>
<td>[% HTML.escape(jobset.description) %]</td>
</tr>
<tr>
<th>Nix expression:</th>
<td>
<tt>[% HTML.escape(jobset.nixexprpath) %]</tt> in input
<tt>[% HTML.escape(jobset.nixexprinput) %]</tt>
</td>
</tr>
2013-05-02 15:51:38 +00:00
<tr>
<th>Check interval:</th>
<td>[% jobset.checkinterval || "<em>disabled</em>" %]</td>
</tr>
2013-09-21 14:47:52 +00:00
<tr>
<th>Scheduling shares:</th>
<td>[% jobset.schedulingshares %] [% IF totalShares %] ([% f = format("%.2f"); f(jobset.schedulingshares / totalShares * 100) %]% out of [% totalShares %] shares)[% END %]</td>
</tr>
2013-02-21 01:33:57 +00:00
<tr>
<th>Enable email notification:</th>
<td>[% jobset.enableemail ? "Yes" : "No" %]</td>
</tr>
<tr>
<th>Email override:</th>
<td>[% HTML.escape(jobset.emailoverride) %]</td>
</tr>
<tr>
2013-08-16 14:21:30 +00:00
<th>Number of evaluations to keep:</th>
2013-02-21 01:33:57 +00:00
<td>[% jobset.keepnr %]</td>
</tr>
</table>
2010-02-05 14:48:22 +00:00
2013-03-19 15:14:47 +00:00
[% INCLUDE renderJobsetInputs %]
2013-02-21 01:33:57 +00:00
</div>
2009-04-02 16:15:57 +00:00
2013-02-22 13:29:12 +00:00
[% INCLUDE makeLazyTab tabName="tabs-jobs" uri=c.uri_for('/jobset' project.name jobset.name "jobs-tab") %]
2009-04-02 16:15:57 +00:00
2013-11-11 13:49:39 +00:00
<div id="tabs-links" class="tab-pane">
<ul>
<li><a href="[% c.uri_for(c.controller('Jobset').action_for('latest_eval'), c.req.captures) %]">Latest finished evaluation</a></li>
</ul>
</div>
2015-04-14 06:58:55 +00:00
[% INCLUDE makeLazyTab tabName="tabs-channels" uri=c.uri_for('/jobset' project.name jobset.name "channels-tab") %]
2013-02-21 01:33:57 +00:00
</div>
2009-04-02 16:15:57 +00:00
2013-10-02 23:17:52 +00:00
<script>
function confirmEvaluateJobset() {
bootbox.confirm(
'Are you sure you want to force evaluation of this jobset?',
function(c) {
if (!c) return;
2013-10-03 15:54:40 +00:00
requestJSON({
url: "[% HTML.escape(c.uri_for('/api/push', { jobsets = project.name _ ':' _ jobset.name, force = "1" })) %]",
success: function(data) {
bootbox.alert("The jobset has been scheduled for evaluation.");
}
});
});
};
function deleteJobset() {
bootbox.confirm(
'Are you sure you want to delete this jobset?',
function(c) {
if (!c) return;
redirectJSON({
2013-10-14 15:43:31 +00:00
url: "[% c.uri_for(c.controller('Jobset').action_for('jobset'), c.req.captures) %]",
2013-10-03 15:54:40 +00:00
type: 'DELETE'
});
2013-10-02 23:17:52 +00:00
});
};
</script>
2009-04-02 16:15:57 +00:00
[% END %]