Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Modifications and some new features
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed Nov 2, 2013
1 parent 4fd3a23 commit c2fd3de
Show file tree
Hide file tree
Showing 46 changed files with 1,266 additions and 179 deletions.
3 changes: 2 additions & 1 deletion config/application.config.php
Expand Up @@ -6,8 +6,9 @@
'Application',
'Dashboard',
'Director',
'Fileset',
'Pool',
'Volume',
'Media',
'Storage',
'Client',
'Job',
Expand Down
6 changes: 5 additions & 1 deletion module/Application/config/module.config.php
Expand Up @@ -130,13 +130,17 @@
'label' => 'Director',
'route' => 'director',
),
array(
'label' => 'Fileset',
'route' => 'fileset',
),
array(
'label' => 'Pool',
'route' => 'pool',
),
array(
'label' => 'Volume',
'route' => 'volume',
'route' => 'media',
),
array(
'label' => 'Storage',
Expand Down
4 changes: 2 additions & 2 deletions module/Application/view/layout/layout.phtml
Expand Up @@ -70,15 +70,15 @@

<div class="container">

<!-- Breadcrumbs start -->
<!-- Breadcrumbs start
<p>
<?php echo $this->navigation('navigation')
->breadcrumbs()
->setMinDepth(0)
->setPartial(array('partial/breadcrumb.phtml', 'Home'));
?>
</p>
<!-- Breadcrumbs end -->
Breadcrumbs end -->

<?php echo $this->content; ?>

Expand Down
9 changes: 9 additions & 0 deletions module/Client/view/client/client/details.phtml
@@ -0,0 +1,9 @@
<?php

$title = 'Client details';
$this->headTitle($title);

?>

<h2><?php echo $title; ?></h2>
<hr />
9 changes: 6 additions & 3 deletions module/Client/view/client/client/index.phtml
Expand Up @@ -5,7 +5,10 @@ $this->headTitle($title);

?>

<table class="table">
<h2><?php echo $title; ?></h2>
<hr />

<table class="table table-striped table-hover">

<tr>
<th>Client</th>
Expand All @@ -24,8 +27,8 @@ $this->headTitle($title);
<td><?php echo $this->escapeHtml($client->name); ?></td>
<td><?php echo $this->escapeHtml($client->uname); ?></td>
<td><?php echo $this->escapeHtml($client->autoprune); ?></td>
<td><?php echo $this->escapeHtml($client->fileretention); ?></td>
<td><?php echo $this->escapeHtml($client->jobretention); ?></td>
<td><?php echo $this->printRetention($client->fileretention) . " days"; ?></td>
<td><?php echo $this->printRetention($client->jobretention) . " days"; ?></td>

</tr>

Expand Down
40 changes: 34 additions & 6 deletions module/Dashboard/src/Dashboard/Controller/DashboardController.php
Expand Up @@ -11,14 +11,19 @@ class DashboardController extends AbstractActionController
protected $jobTable;
protected $clientTable;
protected $poolTable;
protected $volumeTable;
protected $mediaTable;
protected $fileTable;
protected $logTable;
protected $filesetTable;

public function indexAction()
{
return new ViewModel(
array(

'lastSuccessfulJobs' => $this->getJobTable()->getLast24HoursSuccessfulJobs(),
'lastUnsuccessfulJobs' => $this->getJobTable()->getLast24HoursUnsuccessfulJobs(),

'jobsCreatedNotRunning' => $this->getJobTable()->getJobCountLast24HoursByStatus("C"),
'jobsBlocked' => $this->getJobTable()->getJobCountLast24HoursByStatus("B"),
'jobsRunning' => $this->getJobTable()->getJobCountLast24HoursByStatus("R"),
Expand All @@ -43,8 +48,11 @@ public function indexAction()

'clientNum' => $this->getClientTable()->getClientNum(),
'poolNum' => $this->getPoolTable()->getPoolNum(),
'volumeNum' => $this->getVolumeTable()->getVolumeNum(),
'volumeNum' => $this->getMediaTable()->getMediaNum(),
'fileNum' => $this->getFileTable()->getFileNum(),
'jobNum' => $this->getJobTable()->getJobNum(),
'logNum' => $this->getLogTable()->getLogNum(),
'filesetNum' => $this->getFilesetTable()->getFilesetNum(),

)
);
Expand Down Expand Up @@ -80,14 +88,14 @@ public function getPoolTable()
return $this->poolTable;
}

public function getVolumeTable()
public function getMediaTable()
{
if(!$this->volumeTable)
if(!$this->mediaTable)
{
$sm = $this->getServiceLocator();
$this->volumeTable = $sm->get('Volume\Model\VolumeTable');
$this->mediaTable = $sm->get('Media\Model\MediaTable');
}
return $this->volumeTable;
return $this->mediaTable;
}

public function getFileTable()
Expand All @@ -100,5 +108,25 @@ public function getFileTable()
return $this->fileTable;
}

public function getLogTable()
{
if(!$this->logTable)
{
$sm = $this->getServiceLocator();
$this->logTable = $sm->get('Log\Model\LogTable');
}
return $this->logTable;
}

public function getFilesetTable()
{
if(!$this->filesetTable)
{
$sm = $this->getServiceLocator();
$this->filesetTable = $sm->get('Fileset\Model\FilesetTable');
}
return $this->filesetTable;
}

}

Empty file.
141 changes: 133 additions & 8 deletions module/Dashboard/view/dashboard/dashboard/index.phtml
Expand Up @@ -5,6 +5,9 @@ $this->headTitle($title);

?>

<h2><?php echo $title; ?></h2>
<hr />

<script type="text/javascript">

function chart1() {
Expand Down Expand Up @@ -60,20 +63,142 @@ $this->headTitle($title);

</script>

<!-- UNSUCCESSFUL JOBS -->
<?php if(count($this->lastUnsuccessfulJobs) > 0) : ?>

<div class="row">

<div class="col-md-12">

<div class="panel panel-default">

<div class="panel-heading">
<h3 class="panel-title"><?php echo $this->translate('Unsuccessful jobs (last 24 hours)') ?></h3>
</div>

<div class="panel-body">

<table class="table table-striped table-hover" style="font-size: 9pt;">

<tr>
<th>Job</th>
<th>Name</th>
<th>Client</th>
<th>Type</th>
<th>Level</th>
<th>Start</th>
<th>End</th>
<th>Duration</th>
<th>Status</th>
<th>Log</th>
</tr>

<?php foreach ($this->lastUnsuccessfulJobs as $jobUnsuccess) : ?>

<tr>

<td><a href="<?php echo $this->url('job', array('action' => 'details', 'id' => $jobUnsuccess->jobid)); ?>"><?php echo $this->escapeHtml($jobUnsuccess->jobid); ?></a></td>
<td><?php echo $this->escapeHtml($jobSuccess->jobname); ?></td>
<td><a href="<?php echo $this->url('client', array('action' => 'details', 'clientid' => $jobUnsuccess->clientid)); ?>"><?php echo $this->escapeHtml($jobUnsuccess->clientname); ?></a></td>
<td><?php echo $this->printJobType($jobUnsuccess->type); ?></td>
<td><?php echo $this->printJobLevel($jobUnsuccess->level); ?></td>
<td><?php echo $this->escapeHtml($jobUnsuccess->starttime); ?></td>
<td><?php echo $this->escapeHtml($jobUnsuccess->endtime); ?></td>
<td><?php echo $this->printJobDuration($jobUnsuccess->starttime, $jobUnsuccess->endtime); ?></td>
<td><?php echo $this->printJobStatus($jobUnsuccess->jobstatus); ?></td>
<td><a href="<?php echo $this->url('log', array('action' => 'job', 'jobid' => $jobUnsuccess->clientid)); ?>">View</a></td>

</tr>

<?php endforeach; ?>
</table>

</div>

</div>

</div>

</div>

<?php endif; ?>


<!-- SUCCESSFUL JOBS -->
<?php if(count($this->lastSuccessfulJobs) > 0) : ?>

<div class="row">

<div class="col-md-12">

<div class="panel panel-default">

<div class="panel-heading">
<h3 class="panel-title"><?php echo $this->translate('Successful jobs (last 24 hours)') ?></h3>
</div>

<div class="panel-body">

<table class="table table-striped table-hover" style="font-size: 9pt;">

<tr>
<th>Job</th>
<th>Name</th>
<th>Client</th>
<th>Type</th>
<th>Level</th>
<th>Start</th>
<th>End</th>
<th>Duration</th>
<th>Status</th>
<th>Log</th>
</tr>

<?php foreach ($this->lastSuccessfulJobs as $jobSuccess) : ?>

<tr>

<td><a href="<?php echo $this->url('job', array('action' => 'details', 'id' => $jobSuccess->jobid)); ?>"><?php echo $this->escapeHtml($jobSuccess->jobid); ?></a></td>
<td><?php echo $this->escapeHtml($jobSuccess->jobname); ?></td>
<td><a href="<?php echo $this->url('client', array('action' => 'details', 'clientid' => $jobSuccess->clientid)); ?>"><?php echo $this->escapeHtml($jobSuccess->clientname); ?></a></td>
<td><?php echo $this->printJobType($jobSuccess->type); ?></td>
<td><?php echo $this->printJobLevel($jobSuccess->level); ?></td>
<td><?php echo $this->escapeHtml($jobSuccess->starttime); ?></td>
<td><?php echo $this->escapeHtml($jobSuccess->endtime); ?></td>
<td><?php echo $this->printJobDuration($jobSuccess->starttime, $jobSuccess->endtime); ?></td>
<td><?php echo $this->printJobStatus($jobSuccess->jobstatus); ?></td>
<td><a href="<?php echo $this->url('log', array('action' => 'job', 'jobid' => $jobSuccess->clientid)); ?>">View</a></td>

</tr>

<?php endforeach; ?>
</table>

</div>

</div>

</div>

</div>
<?php endif; ?>


<!-- JOB STATISTICS -->
<div class="row">

<div class="col-md-9">

<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><?php echo $this->translate('Last 24 hours job statistic') ?></h3>
<h3 class="panel-title"><?php echo $this->translate('Job statistic (last 24 hours)') ?></h3>
</div>

<div class="panel-body">

<div class="col-md-4">

<table class="table" style="font-size: 9pt;">
<table class="table table-striped table-hover" style="font-size: 9pt;">
<tr><td>Running</td><td><?php echo $this->jobsRunning; ?></td></tr>
<tr><td>Completed successful</td><td><?php echo $this->jobsTerminated; ?></td></tr>
<tr><td>Terminated with errors</td><td><?php echo $this->jobsTerminatedWithErrors; ?></td></tr>
Expand Down Expand Up @@ -120,12 +245,12 @@ $this->headTitle($title);

<div class="panel-body">

<table class="table">
<tr><td>Clients</td><td><?php echo $this->clientNum; ?></td></tr>
<tr><td>Filesets</td><td><?php echo $this->filesetNum; ?></td></tr>
<tr><td>Pools</td><td><?php echo $this->poolNum; ?></td></tr>
<tr><td>Volumes</td><td><?php echo $this->volumeNum; ?></td></tr>
<tr><td>Total Jobs</td><td><?php echo $this->jobNum; ?></td></tr>
<table class="table table-striped table-hover" style="font-size: 9pt;">
<tr><td>Total clients</td><td><?php echo $this->clientNum; ?></td></tr>
<tr><td>Total filesets</td><td><?php echo $this->filesetNum; ?></td></tr>
<tr><td>Total pools</td><td><?php echo $this->poolNum; ?></td></tr>
<tr><td>Total volumes</td><td><?php echo $this->volumeNum; ?></td></tr>
<tr><td>Total jobs</td><td><?php echo $this->jobNum; ?></td></tr>
<tr><td>Total files</td><td><?php echo $this->fileNum; ?></td></tr>
<tr><td>Total logs</td><td><?php echo $this->logNum; ?></td></tr>
</table>
Expand Down

0 comments on commit c2fd3de

Please sign in to comment.