66 lines
1.5 KiB
PHTML
66 lines
1.5 KiB
PHTML
<div id="title">
|
|
<h1 style="display: inline-block">Dashboard</h1>
|
|
</div>
|
|
<div class="row">
|
|
<div class="span3">
|
|
<div class="well" style="padding: 8px 0">
|
|
<ul class="nav nav-list">
|
|
<li><a href="<?= PHPCI_URL ?>"><i class="icon-home"></i> Dashboard</a></li>
|
|
<li><a href="<?= PHPCI_URL ?>user"><i class="icon-user"></i> Users</a></li>
|
|
<li class="divider"></li>
|
|
<li class="nav-header">Projects</li>
|
|
|
|
<?php
|
|
foreach($projects as $project):
|
|
$status = 'icon-build-ok';
|
|
$build = $project->getLatestBuild('master');
|
|
|
|
if (isset($build)) {
|
|
switch($build->getStatus())
|
|
{
|
|
case 0:
|
|
$status = 'icon-build-pending';
|
|
break;
|
|
case 1:
|
|
$status = 'icon-build-running';
|
|
break;
|
|
case 3:
|
|
$status = 'icon-build-failed';
|
|
break;
|
|
case 2:
|
|
default:
|
|
$status = 'icon-build-ok';
|
|
break;
|
|
}
|
|
}
|
|
?>
|
|
<li><a href="<?= PHPCI_URL ?>project/view/<?php print $project->getId(); ?>"><i class="<?= $status; ?>"></i> <?php print $project->getTitle(); ?></a></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="span9">
|
|
<table class="table table-striped table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Project</th>
|
|
<th>Commit</th>
|
|
<th>Branch</th>
|
|
<th>Status</th>
|
|
<th style="width: 1%"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="latest-builds">
|
|
<?php print $builds; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
setInterval(function()
|
|
{
|
|
$('#latest-builds').load('<?= PHPCI_URL ?>index/latest');
|
|
}, 10000);
|
|
</script>
|