Updated runspage
This commit is contained in:
parent
c2533f13c2
commit
260f13c554
7
runs.php
7
runs.php
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
require_once "include/initialize.inc.php";
|
require_once "include/initialize.inc.php";
|
||||||
|
|
||||||
$jobnameqry = $db->prepare("SELECT name, user FROM jobs WHERE jobID = ?");
|
$jobnameqry = $db->prepare("SELECT name, user, url FROM jobs WHERE jobID = ?");
|
||||||
$jobnameqry->execute(array($_GET['jobID']));
|
$jobnameqry->execute(array($_GET['jobID']));
|
||||||
$jobnameResult = $jobnameqry->fetchAll(PDO::FETCH_ASSOC);
|
$jobnameResult = $jobnameqry->fetchAll(PDO::FETCH_ASSOC);
|
||||||
if ($jobnameResult[0]["user"] != $_SESSION["userID"]) {
|
if ($jobnameResult[0]["user"] != $_SESSION["userID"]) {
|
||||||
|
@ -34,8 +34,9 @@ if ($jobnameResult[0]["user"] != $_SESSION["userID"]) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$jobName = $jobnameResult[0]['name'];
|
$jobName = $jobnameResult[0]['name'];
|
||||||
|
$rebootjob = $jobnameResult[0]['name'] ? true : false;
|
||||||
|
|
||||||
$runsForJobQry = "SELECT runs.*, jobs.name FROM runs, jobs WHERE runs.job = jobs.jobID AND runs.job = ?";
|
$runsForJobQry = "SELECT runs.*, FROM runs, jobs WHERE runs.job = jobs.jobID AND runs.job = ?";
|
||||||
$allruns = true;
|
$allruns = true;
|
||||||
if(!(isset($_GET['allruns']) && $_GET['allruns'] == 1)) {
|
if(!(isset($_GET['allruns']) && $_GET['allruns'] == 1)) {
|
||||||
$runsForJobQry .= " AND runs.statuscode <> jobs.expected";
|
$runsForJobQry .= " AND runs.statuscode <> jobs.expected";
|
||||||
|
@ -61,7 +62,7 @@ foreach($runsForJobResult as $key=>$value) {
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$twig_vars = array('jobID' => $_GET['jobID'], 'runs' => $runsForJobRendered, 'allruns' => $allruns, "title" => $jobName);
|
$twig_vars = array('jobID' => $_GET['jobID'], 'rebootjob' => $rebootjob, 'runs' => $runsForJobRendered, 'allruns' => $allruns, "title" => $jobName);
|
||||||
|
|
||||||
//echo $twig->render('overview.html.twig', array('the' => 'variables', 'go' => 'here'));
|
//echo $twig->render('overview.html.twig', array('the' => 'variables', 'go' => 'here'));
|
||||||
echo $twig->render('runs.html.twig', $twig_vars);
|
echo $twig->render('runs.html.twig', $twig_vars);
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
{% block title %}Overview of run for {{ title }}{% endblock %}
|
{% block title %}Overview of run for {{ title }}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Overview of runs for {{ title }}</h2>
|
<h2>Overview of runs for {{ title }}</h2>
|
||||||
{% if allruns %}
|
{% if rebootjob %}
|
||||||
|
{% elseif allruns %}
|
||||||
<p><a href="runs.php?jobID={{ jobID }}&allruns=0">Only show failed runs</a></p>
|
<p><a href="runs.php?jobID={{ jobID }}&allruns=0">Only show failed runs</a></p>
|
||||||
{% elseif not allruns %}
|
{% elseif not allruns %}
|
||||||
<p><a href="runs.php?jobID={{ jobID }}&allruns=1">Show all runs</a></p>
|
<p><a href="runs.php?jobID={{ jobID }}&allruns=1">Show all runs</a></p>
|
||||||
|
@ -12,7 +13,7 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h4 class="panel-title">
|
<h4 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapse{{ loop.index }}">({{ run.statuscode }}) {{ run.timestamp }}</a>
|
<a data-toggle="collapse" data-parent="#accordion" href="#collapse{{ loop.index }}">{% if not rebootjob %}({{ run.statuscode }}){% endif %} {{ run.timestamp }}</a>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div id="collapse{{ loop.index }}" class="panel-collapse collapse">
|
<div id="collapse{{ loop.index }}" class="panel-collapse collapse">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user