Template cleanup and validation part 1

refs #4550
This commit is contained in:
Jannis Moßhammer 2013-08-21 16:12:06 +02:00 committed by Marius Hein
parent dc2aad75d1
commit bff45a1eb2
17 changed files with 598 additions and 641 deletions

View File

@ -17,6 +17,7 @@
<!-- Bootstrap and components --> <!-- Bootstrap and components -->
<link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/bootstrap/bootstrap.min.css') ?>" media="screen"> <link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/bootstrap/bootstrap.min.css') ?>" media="screen">
<link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/bootstrap/bootstrap-theme.min.css') ?>" media="screen">
<link rel="stylesheet" href="<?= $this->baseUrl('css/main.css') ?>"> <link rel="stylesheet" href="<?= $this->baseUrl('css/main.css') ?>">
<link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/bootstrap/datetimepicker.min.css') ?>"> <link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/bootstrap/datetimepicker.min.css') ?>">

View File

@ -1,10 +1,12 @@
<div class="well" style="margin:auto;width: 40%;max-width:25em;margin-top:10%;">
<h1> Login </h1> <div class="well">
<?php echo $this->form->render() ?> <h1>Login</h1>
<?php if (isset($this->errorInfo)): ?>
<?= $this->form->render(); ?>
<?php if (isset($this->errorInfo)): ?>
<div class="alert alert-error"> <div class="alert alert-error">
<?= $this->errorInfo ?> <?= $this->errorInfo ?>
</div> </div>
<?php endif ?> <?php endif ?>
</div> </div>

View File

@ -6,33 +6,32 @@ $modules = $this->modules->paginate();
?> ?>
<?= $this->tabs->render($this); ?> <?= $this->tabs->render($this); ?>
<h3>Installed Modules</h3> <h3>Installed Modules</h3>
<?= $this->paginationControl($modules, null, null, array( <?= $this->paginationControl($modules, null, null, array(
'preserve' => $this->preserve 'preserve' => $this->preserve
)); ?> ));
<table > ?>
<tbody> <table class="table">
<? foreach ($modules as $module): ?> <tbody>
<? foreach ($modules as $module): ?>
<?php <?php
$enableUrl = Url::fromPath('config/moduleenable/',array('name' => $module->name))->getAbsoluteUrl(); $enableUrl = Url::fromPath('config/moduleenable/',array('name' => $module->name))->getAbsoluteUrl();
$disableUrl = Url::fromPath('config/moduledisable/',array('name' => $module->name))->getAbsoluteUrl(); $disableUrl = Url::fromPath('config/moduledisable/',array('name' => $module->name))->getAbsoluteUrl();
?> ?>
<tr> <tr>
<td> <td>
<? if ($module->enabled): ?> <? if ($module->enabled): ?>
<i class="icon-ok-sign"></i> <i class="icon-ok-sign"></i>
<a href="<?= $disableUrl ?>"><?= $this->escape($module->name); ?></a> <a href="<?= $disableUrl ?>"><?= $this->escape($module->name); ?></a>
<? else: ?>
<? else: ?>
<i class="icon-remove-sign"></i> <i class="icon-remove-sign"></i>
<a href="<?= $enableUrl ?>"><?= $this->escape($module->name); ?></a> <a href="<?= $enableUrl ?>"><?= $this->escape($module->name); ?></a>
<? endif ?> <? endif ?>
(<?= (<?=
$module->enabled $module->enabled ? ($module->loaded ? 'enabled' : 'failed') : 'disabled' ?>)
? ($module->loaded ? 'enabled' : 'failed') </td>
: 'disabled' </tr>
?>)</td> <? endforeach ?>
</tr> </tbody>
<? endforeach ?>
</tbody>
</table> </table>

View File

@ -1,7 +1,4 @@
<?php $container = $this->container('modules-container',array( <table class="table table-bordered" >
"class" => "expanded_absolute"
))->beginContent() ?>
<table class="table table-bordered" style="width:100%">
<thead> <thead>
<tr style="text-align:left"> <tr style="text-align:left">
<th width="70%">Module</th> <th width="70%">Module</th>
@ -12,13 +9,10 @@
<tbody> <tbody>
<?php foreach($this->modules as $module): ?> <?php foreach($this->modules as $module): ?>
<tr> <tr>
<td><?= $module["name"] ?></td> <td><?= $module["name"]; ?></td>
<td><?= $module["type"] ?></td> <td><?= $module["type"]; ?></td>
<td><?= $module["active"] ?></td> <td><?= $module["active"]; ?></td>
</tr> </tr>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody> </tbody>
</table> </table>
<?= $container; ?>

View File

@ -1,7 +1,7 @@
<?= $this->tabs->render($this); ?> <?= $this->tabs->render($this); ?>
<br/> <br/>
<div class="alert alert-error"> <div class="alert alert-error">
<h4><i class="icon-warning-sign"> </i>Saving <?= $this->escape($this->file); ?>.ini failed</h4> <h4><i>WARNING ICON</i>Saving <?= $this->escape($this->file); ?>.ini failed</h4>
<br/> <br/>
<p> <p>
Your <?= $this->escape($this->file); ?> configuration couldn't be stored (error: "<?= $this->exceptionMessage; ?>").<br/> Your <?= $this->escape($this->file); ?> configuration couldn't be stored (error: "<?= $this->exceptionMessage; ?>").<br/>
@ -19,10 +19,9 @@
<br/> <br/>
In case you can access the configuration file (config/<?= $this->escape($this->file); ?>.ini) by yourself, you can open it and In case you can access the configuration file (config/<?= $this->escape($this->file); ?>.ini) by yourself, you can open it and
insert the config manually: insert the config manually:
</p> </p>
<p> <p>
<pre> <pre>
<code> <code>
<?= $this->escape($this->iniConfigurationString); ?> <?= $this->escape($this->iniConfigurationString); ?>
</code> </code>

View File

@ -1,6 +1,6 @@
<br/> <br/>
<div class="alert alert-error"> <div class="alert alert-error">
<h4><i class="icon-warning-sign"> </i>Saving dashboard failed</h4> <h4><i>ICON WARNING</i>Saving dashboard failed</h4>
<br/> <br/>
<p> <p>
Your dashboard couldn't be stored (error: "<?= $this->exceptionMessage; ?>"). This could have one or more Your dashboard couldn't be stored (error: "<?= $this->exceptionMessage; ?>"). This could have one or more
@ -18,7 +18,6 @@
<br/> <br/>
In case you can access the configuration file (config/dashboard/dashboard.ini) by yourself, you can open it and In case you can access the configuration file (config/dashboard/dashboard.ini) by yourself, you can open it and
insert the config manually: insert the config manually:
</p> </p>
<p> <p>
<pre> <pre>

View File

@ -1,5 +1,4 @@
<div class="alert alert-error fullpage_infobox"> <div class="alert alert-error">
<h1>An error occurred</h1> <h1>An error occurred</h1>
<p> <p>
<?php echo $this->message ?> <?php echo $this->message ?>
@ -10,22 +9,27 @@
<h3>Exception information:</h3> <h3>Exception information:</h3>
<p> <p>
<b>Message:</b> <?php echo $this->exception->getMessage() ?> <b>Message:</b>
<?php if (isset($this->exception->action)): ?> <?= $this->exception->getMessage(); ?>
<br/><b>Action</b>: <?= $this->exception->action; ?>
<?php endif ?>
<?php if (isset($this->exception->action)): ?>
<br/><b>Target</b>: <?= $this->exception->target; ?>
<?php endif ?>
<?php if (isset($this->exception->action)): ?>
<br/>
<b>Action</b>: <?= $this->exception->action; ?>
<?php endif; ?>
<?php if (isset($this->exception->action)): ?>
<br/>
<b>Target</b>: <?= $this->exception->target; ?>
<?php endif; ?>
</p> </p>
<h3>Stack trace:</h3> <h3>Stack trace:</h3>
<pre style="font-family: monospace"><?php echo $this->exception->getTraceAsString() ?> <pre>
<?= $this->exception->getTraceAsString(); ?>
</pre> </pre>
<h3>Request Parameters:</h3> <h3>Request Parameters:</h3>
<pre><?php echo var_export(\Zend_Controller_Front::getInstance()->getParams(), true) ?> <pre><?= var_export(\Zend_Controller_Front::getInstance()->getParams(), true) ?>
</pre> </pre>
</div> </div>
<?php endif ?> <?php endif ?>

View File

@ -1,3 +1,2 @@
<?= $this->layout()->moduleStart ?>
<?= $this->layout()->content ?> <?= $this->layout()->content ?>
<?= $this->layout()->moduleEnd ?>

View File

@ -2,7 +2,7 @@
<?php if (isset($this->success)) : ?> <?php if (isset($this->success)) : ?>
<div class="alert alert-success"> <div class="alert alert-success">
<h4>Preferences updated sucessfully</h4> <h4>Preferences updated successfully</h4>
</div> </div>
<?php endif; ?> <?php endif; ?>

View File

@ -16,13 +16,16 @@ function formatDateString($self,$dateString){
$paginator = $downtimes->paginate(); $paginator = $downtimes->paginate();
$downtimes = $downtimes->fetchAll(); $downtimes = $downtimes->fetchAll();
?> ?>
<form method="get" action="<?= $this->href( <form method="get" class="form-inline" action="<?= $this->href(
'monitoring/list/downtimes?', 'monitoring/list/downtimes?',
array( array(
'action' => 'downtimes' 'action' => 'downtimes'
)); ));
?>"> ?>">
Sort by <?= $this->formSelect( <label>Sort by</label>
<br/>
<?=
$this->formSelect(
'sort', 'sort',
$this->sort, $this->sort,
array('class' => 'autosubmit'), array('class' => 'autosubmit'),
@ -40,44 +43,54 @@ $downtimes = $downtimes->fetchAll();
'downtime_internal_downtime_id' => 'Downtime ID', 'downtime_internal_downtime_id' => 'Downtime ID',
'downtime_duration' => 'Duration', 'downtime_duration' => 'Duration',
) )
) ?> )
<button class="btn btn-small"><i class="icon-refresh"></i></button> ?>
<noscript>
<button class="btn btn-small btn-default" >
<i>REFRESH ICON</i>
</button>
</noscript>
</form> </form>
<?= <?=
$this->paginationControl( $this->paginationControl(
$paginator, $paginator,
null, null,
array( array(
'mixedPagination.phtml', 'mixedPagination.phtml',
'default'), 'default'
array('preserve' => $this->preserve)) ),
array('preserve' => $this->preserve)
)
?> ?>
<table class="statustable action"> <table class="table table-condensed">
<thead> <thead>
<th> Is In Effect</th> <tr>
<th> Object</th> <th>Is In Effect</th>
<th> Host Name</th> <th>Object</th>
<th> Service Name</th> <th>Host Name</th>
<th> Entry Time</th> <th>Service Name</th>
<th> Author</th> <th>Entry Time</th>
<th> Comment</th> <th>Author</th>
<th> Start Time</th> <th>Comment</th>
<th> End Time</th> <th>Start Time</th>
<th> Type</th> <th>End Time</th>
<th> Trigger Time</th> <th>Type</th>
<th> Downtime ID</th> <th>Trigger Time</th>
<th> Trigger ID</th> <th>Downtime ID</th>
<th> Duration</th> <th>Trigger ID</th>
<th>Duration</th>
</tr>
</thead> </thead>
<?php foreach ($downtimes as $downtime): ?> <?php foreach ($downtimes as $downtime): ?>
<tr class="<?= $downtime->downtime_is_in_effect == 0 ? 'ok' : 'warning' ?>">
<tr>
<td> <td>
<?= $downtime->downtime_is_in_effect == 0 ? 'False' : '<b>True</b>'; ?> <?= ($downtime->downtime_is_in_effect == 0 ? 'False' : '<b>True</b>'); ?>
</td> </td>
<td> <td>
<div class="img-box"> <div >
<?php if ($downtime->object_type == 'service'): ?> <?php if ($downtime->object_type == 'service'): ?>
<img title="Service" src="<?='../../img/classic/service.png'?>"/> <img title="Service" src="<?='../../img/classic/service.png'?>"/>
@ -86,7 +99,6 @@ array('preserve' => $this->preserve))
<?php if ($downtime->object_type == 'host'): ?> <?php if ($downtime->object_type == 'host'): ?>
<img title="Host" src="<?='../../img/classic/server.png'?>"/> <img title="Host" src="<?='../../img/classic/server.png'?>"/>
<?php endif; ?> <?php endif; ?>
</div> </div>
</td> </td>
<td> <td>

View File

@ -6,10 +6,10 @@ $trimArea = $this->getHelper('Trim');
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?> <?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
<table class="statustable action hosts"> <table class="table table-condensed">
<thead> <thead>
<tr> <tr>
<th colspan="3">Status</th> <th colspan="2">Status</th>
<th>Host</th> <th>Host</th>
<th>Output</th> <th>Output</th>
<th></th> <th></th>
@ -17,92 +17,77 @@ $trimArea = $this->getHelper('Trim');
</thead> </thead>
<tbody> <tbody>
<?php foreach ($hosts as $host): ?> <?php foreach ($hosts as $host): ?>
<tr class="<?= implode(' ', $viewHelper->getStateFlags($host, 'host')); ?>"> <tr>
<td class="icons indicator"> <td>
<div class="img-box"><?php $trimArea->start(); ?> <div>
<?php if ($host->host_icon_image) : ?> <?php if ($host->host_icon_image) : ?>
<img src="<?= $host->host_icon_image; ?>"/> <img src="<?= $host->host_icon_image; ?>"/>
<?php endif; ?> <?php endif; ?>
<?php $trimArea->end(); ?>
</div> </div>
</td> </td>
<td class="icons indicator"> <td>
<div class="icon-box"><?php $trimArea->start(); ?> <div>
<?php if (!$host->host_handled && $host->host_state > 0): ?> <?php if (!$host->host_handled && $host->host_state > 0): ?>
<a href="#" title="<?= 'Unhandled host' ?>"> <a href="#" title="<?= 'Unhandled host' ?>">
<i class="icon-warning-sign"></i> <i>UNHANDLED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?> <?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
<a href="#" title="<?= 'Acknowledged' ?>"> <a href="#" title="<?= 'Acknowledged' ?>">
<i class="icon-ok-sign"></i> <i>ACKNOWLEDGED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($host->host_is_flapping): ?> <?php if ($host->host_is_flapping): ?>
<a href="#" title="<?= 'Flapping' ?>"> <a href="#" title="<?= 'Flapping' ?>">
<i class="icon-random"></i> <i>FLAPPING ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if (!$host->host_notifications_enabled): ?> <?php if (!$host->host_notifications_enabled): ?>
<a href="#" title="<?= 'Notifications disabled' ?>"> <a href="#" title="<?= 'Notifications disabled' ?>">
<i class="icon-volume-off"></i> <i>NOTIFICATIONS DISABLED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($host->host_in_downtime): ?> <?php if ($host->host_in_downtime): ?>
<a href="#" title="<?= 'In downtime' ?>"> <a href="#" title="<?= 'In downtime' ?>">
<i class="icon-wrench"></i> <i>IN DOWNTIME ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php $trimArea->end(); ?>
</div> </div>
</td> </td>
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>"> <td title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
<div class="statetext"> <div>
<a href="<?= $this->href('monitoring/show/history', array('host' => $host->host_name)); ?>"> <a href="<?= $this->href('monitoring/show/history', array('host' => $host->host_name)); ?>">
<b> <?= ucfirst($viewHelper->monitoringState($host, 'host')); ?> </b> <b> <?= ucfirst($viewHelper->monitoringState($host, 'host')); ?> </b>
<div> since&nbsp;
<div class="nowrap"> since&nbsp;
<?= $this->timeSince($host->host_last_state_change); ?> <?= $this->timeSince($host->host_last_state_change); ?>
<?php if ($host->host_state_type == 0): ?> <?php if ($host->host_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>"> <a href="#" title="<?= 'Soft state' ?>">
<i class="icon-gears"></i> <i>SOFTSTATE ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
</div> </div>
</a>
</div> </div>
</td> </td>
<td>
<td class="hostname">
<?php if ($host->host_last_comment !== null): ?> <?php if ($host->host_last_comment !== null): ?>
<a href="#" title="<?= 'Comments' ?>"> <a href="#" title="<?= 'Comments' ?>">
<i class="icon-comment"> </i> <i>COMMENT ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>" <a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>">
class="row-action">
<b><?= $host->host_name; ?></b> <b><?= $host->host_name; ?></b>
<br/> <br/>
<i><?= $host->host_address; ?></i> <i><?= $host->host_address; ?></i>
</a> </a>
<?php if ($host->host_action_url != ''): ?> <?php if ($host->host_action_url != ''): ?>
<a href="<?= $host->host_action_url; ?>">Action</a> <a href="<?= $host->host_action_url; ?>">Action</a>
<?php endif; ?> <?php endif; ?>
<?php if ($host->host_notes_url != ''): ?> <?php if ($host->host_notes_url != ''): ?>
<a href="<?= $host->host_notes_url; ?>">Notes</a> <a href="<?= $host->host_notes_url; ?>">Notes</a>
<?php endif; ?> <?php endif; ?>
</td> </td>
<td class="expand-full"> <td>
<?= $this->escape(substr(strip_tags($host->host_output), 0, 500)); ?> <?= $this->escape(substr(strip_tags($host->host_output), 0, 500)); ?>
</td> </td>
</tr> </tr>

View File

@ -3,28 +3,33 @@
<?php <?php
$hosts = $this->hosts->paginate(); $hosts = $this->hosts->paginate();
$viewHelper = $this->getHelper('MonitoringState'); $viewHelper = $this->getHelper('MonitoringState');
$trimArea = $this->getHelper('Trim');
?> ?>
<form method="get" action="<?= $this->href('monitoring/list/hosts', $this->hosts->getAppliedFilter()->toParams());?>">
Sort by <?= $this->formSelect( <form method="get" class="form-inline" action="<?= $this->href('monitoring/list/hosts', $this->hosts->getAppliedFilter()->toParams());?>">
<label>Sort by</label>
<?= $this->formSelect(
'sort', 'sort',
$this->sort, $this->sort,
array('class' => 'autosubmit'), array('class' => array('autosubmit')),
array( array(
'host_severity' => 'Severity', 'host_severity' => 'Severity',
'host_last_state_change' => 'Last state change', 'host_last_state_change' => 'Last state change',
'host_name' => 'Host', 'host_name' => 'Host',
) )
); ?> ); ?>
<button class="btn btn-small"><i class="icon-refresh"></i></button> <noscript>
<button class="btn btn-small btn-default">
<i>REFRESH ICON</i>
</button>
</noscript>
</form> </form>
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?> <?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?>
<table class="statustable action hosts"> <table class="table table-condensed">
<thead> <thead>
<tr> <tr>
<th colspan="3">Status</th> <th colspan="2">Status</th>
<th>Host</th> <th>Host</th>
<th>Output</th> <th>Output</th>
<th></th> <th></th>
@ -33,82 +38,70 @@ $trimArea = $this->getHelper('Trim');
<tbody> <tbody>
<?php foreach($hosts as $host): ?> <?php foreach($hosts as $host): ?>
<tr class="<?= implode(' ', $viewHelper->getStateFlags($host, 'host')); ?>"> <tr>
<td class="icons indicator"> <td>
<div class="img-box"> <div>
<?php $trimArea->start(); ?>
<?php if ($host->host_icon_image) : ?> <?php if ($host->host_icon_image) : ?>
<img src="<?= $host->host_icon_image; ?>"/> <img src="<?= $host->host_icon_image; ?>"/>
<?php endif; ?> <?php endif; ?>
<?php $trimArea->end(); ?>
</div> </div>
</td> </td>
<td class="icons indicator">
<div class="icon-box">
<?php $trimArea->start(); ?>
<td>
<div>
<?php if (!$host->host_handled && $host->host_state > 0): ?> <?php if (!$host->host_handled && $host->host_state > 0): ?>
<a href="#" title="<?= 'Unhandled host' ?>"> <a href="#" title="<?= 'Unhandled host' ?>">
<i class="icon-warning-sign"></i> <i>UNHANDLED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?> <?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
<a href="#" title="<?= 'Acknowledged' ?>"> <a href="#" title="<?= 'Acknowledged' ?>">
<i class="icon-ok-sign"></i> <i>ACKNOWLEDGED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($host->host_is_flapping): ?> <?php if ($host->host_is_flapping): ?>
<a href="#" title="<?= 'Flapping' ?>"> <a href="#" title="<?= 'Flapping' ?>">
<i class="icon-random"></i> <i>FLAPPING ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if (!$host->host_notifications_enabled): ?> <?php if (!$host->host_notifications_enabled): ?>
<a href="#" title="<?= 'Notifications disabled' ?>"> <a href="#" title="<?= 'Notifications disabled' ?>">
<i class="icon-volume-off"></i> <i>NOTIFICATIONS DISABLED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($host->host_in_downtime): ?> <?php if ($host->host_in_downtime): ?>
<a href="#" title="<?= 'In downtime' ?>"> <a href="#" title="<?= 'In downtime' ?>">
<i class="icon-wrench"></i> <i>IN DOWNTIME ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php $trimArea->end(); ?>
</div> </div>
</td> </td>
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>"> <td title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
<div class="statetext"> <div >
<b><?= ucfirst($viewHelper->monitoringState($host, 'host')); ?></b> <b><?= ucfirst($viewHelper->monitoringState($host, 'host')); ?></b>
<div> since&nbsp;
<div class="nowrap"> since&nbsp;
<?= $this->timeSince($host->host_last_state_change); ?> <?= $this->timeSince($host->host_last_state_change); ?>
<?php if ($host->host_state_type == 0): ?> <?php if ($host->host_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>"> <a href="#" title="<?= 'Soft state' ?>">
<i class="icon-gears"></i> <i>SOFTSTATE ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
</td> </td>
<td>
<td class="hostname">
<?php if ($host->host_last_comment !== null): ?> <?php if ($host->host_last_comment !== null): ?>
<a href="#" title="<?= 'Comments' ?>"> <a href="#" title="<?= 'Comments' ?>">
<i class="icon-comment"> </i> <i>COMMENT ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>" class="row-action">
<a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>">
<b> <?= $host->host_name ?></b><br/> <b> <?= $host->host_name ?></b><br/>
<i> <?= $host->host_address ?></i> <i> <?= $host->host_address ?></i>
</a> </a>
@ -122,9 +115,11 @@ $trimArea = $this->getHelper('Trim');
<?php endif; ?> <?php endif; ?>
</td> </td>
<td class="expand-full">
<td>
<?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?> <?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>

View File

@ -1,8 +1,6 @@
<?= $this->tabs->render($this); ?> <?= $this->tabs->render($this); ?>
<?php <?php
use Icinga\Web\Url;
$formatter = $this->getHelper('MonitoringProperties'); $formatter = $this->getHelper('MonitoringProperties');
?> ?>
@ -12,7 +10,7 @@ $formatter = $this->getHelper('MonitoringProperties');
$this->notifications->getAppliedFilter()->toParams() $this->notifications->getAppliedFilter()->toParams()
); );
?>"> ?>">
Sort by <?= <label>Sort by</label> <?=
$this->formSelect( $this->formSelect(
'sort', 'sort',
$this->sort, $this->sort,
@ -24,7 +22,11 @@ $formatter = $this->getHelper('MonitoringProperties');
) )
); );
?> ?>
<button class="btn btn-small"><i class="icon-refresh"></i></button> <noscript>
<button class="btn btn-small btn-default">
<i>REFRESH ICON</i>
</button>
</noscript>
</form> </form>
<?php <?php
@ -32,7 +34,7 @@ $notifications = $this->notifications->paginate();
echo $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)); echo $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve));
?> ?>
<table class="statustable action table-hover"> <table class="table table-condensed">
<thead> <thead>
<tr> <tr>
<th>Host</th> <th>Host</th>

View File

@ -1,105 +1,88 @@
<?php <?php
$paginator = $services->paginate(); $paginator = $services->paginate();
$viewHelper = $this->getHelper('MonitoringState'); $viewHelper = $this->getHelper('MonitoringState');
$trimArea = $this->getHelper('Trim');
?> ?>
<?php if (empty($services)): ?> <?php if (empty($services)): ?>
<div class="alert alert-info fullpage_infobox"> <div>
Sorry, no services found for this search Sorry, no services found for this search
</div> </div>
<?php return; endif ?> <?php return; endif ?>
<?= $this->paginationControl($paginator, null, null, array('preserve' => $this->preserve)) ?> <?= $this->paginationControl($paginator, null, null, array('preserve' => $this->preserve)) ?>
<table class="statustable action services"> <table class="table table-condensed">
<thead> <thead>
<tr> <tr>
<th colspan="3">Status</th> <th colspan="2">Status</th>
<th>Service</th> <th>Service</th>
<th>Output</th> <th>Output</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($services->fetchAll() as $service): ?> <?php foreach ($services->fetchAll() as $service): ?>
<tr>
<tr class="<?= implode(' ', $viewHelper->getStateFlags($service, 'service')); ?>"> <td>
<td class="icons indicator"> <div>
<div class="img-box"><?php $trimArea->start(); ?>
<?php if ($service->service_icon_image) : ?> <?php if ($service->service_icon_image) : ?>
<img src="<?= $service->service_icon_image; ?>"/> <img src="<?= $service->service_icon_image; ?>"/>
<?php endif; ?> <?php endif; ?>
<?php $trimArea->end(); ?>
</div> </div>
</td> </td>
<td class="icons indicator"> <td>
<div class="icon-box"><?php $trimArea->start(); ?> <div>
<?php if (!$service->service_handled && $service->service_state > 0): ?> <?php if (!$service->service_handled && $service->service_state > 0): ?>
<a href="#" title="<?= 'Unhandled service' ?>"> <a href="#" title="<?= 'Unhandled service' ?>">
<i class="icon-warning-sign"></i> <i>UNHANDLED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?> <?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
<a href="#" title="<?= 'Acknowledged' ?>"> <a href="#" title="<?= 'Acknowledged' ?>">
<i class="icon-ok-sign"></i> <i>ACKNOWLEDGED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($service->service_is_flapping): ?> <?php if ($service->service_is_flapping): ?>
<a href="#" title="<?= 'Flapping' ?>"> <a href="#" title="<?= 'Flapping' ?>">
<i class="icon-random"></i> <i>FLAPPING ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if (!$service->service_notifications_enabled): ?> <?php if (!$service->service_notifications_enabled): ?>
<a href="#" title="<?= 'Notifications disabled' ?>"> <a href="#" title="<?= 'Notifications disabled' ?>">
<i class="icon-volume-off"></i> <i>NOTIFICATIONS DISABLED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($service->service_in_downtime): ?> <?php if ($service->service_in_downtime): ?>
<a href="#" title="<?= 'In downtime' ?>"> <a href="#" title="<?= 'In downtime' ?>">
<i class="icon-wrench"></i> <i>IN DOWNTIME ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php $trimArea->end(); ?>
</div> </div>
</td> </td>
<td title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
<div>
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
<div class="statetext">
<?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b> <?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b>
<div class="nowrap"> since&nbsp;' <div> since&nbsp;'
<?= $this->timeSince($service->service_last_state_change); ?> <?= $this->timeSince($service->service_last_state_change); ?>
<?php if ($service->service_state_type == 0): ?> <?php if ($service->service_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>"> <a href="#" title="<?= 'Soft state' ?>">
<i class="icon-gears"></i> <i>SOFTSTATE ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
</td> </td>
<td class="servicename"> <td class="servicename">
<?php if ($service->service_last_comment !== null): ?> <?php if ($service->service_last_comment !== null): ?>
<a href="#" title="<?= 'Comments' ?>"> <a href="#" title="<?= 'Comments' ?>">
<i class="icon-comment"> </i> <i>COMMENT ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<b> <?= $service->service_display_name; ?></b> <b> <?= $service->service_display_name; ?></b>
<br/> <br/>
<?= $service->host_name; ?> <?= $service->host_name; ?>
@ -111,19 +94,10 @@ $trimArea = $this->getHelper('Trim');
<?php if ($service->service_notes_url != ""): ?> <?php if ($service->service_notes_url != ""): ?>
<a href="<?= $service->service_notes_url; ?>">Notes</a> <a href="<?= $service->service_notes_url; ?>">Notes</a>
<?php endif; ?> <?php endif; ?>
<?php if ($service->service_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>">
<i class="icon-gears"></i>
</a>
<?php endif; ?>
</td> </td>
<td>
<td class="expand-full">
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?> <?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>

View File

@ -2,20 +2,19 @@
<?php <?php
$paginator = $services->paginate(); $paginator = $services->paginate();
$viewHelper = $this->getHelper('MonitoringState'); $viewHelper = $this->getHelper('MonitoringState');
$trimArea = $this->getHelper('Trim'); $trimArea = $this->getHelper('Trim');
?> ?>
<?php if (empty($services)): ?> <?php if (empty($services)): ?>
<div class="alert alert-info fullpage_infobox"> <div>
Sorry, no services found for this search Sorry, no services found for this search
</div> </div>
<?php return; endif ?> <?php return; endif ?>
<form method="get" action="<?= $this->href('monitoring/list/services', $this->services->getAppliedFilter()->toParams()); ?>"> <form method="get" action="<?= $this->href('monitoring/list/services', $this->services->getAppliedFilter()->toParams()); ?>">
Sort by <?= $this->formSelect( <label>Sort by</label>
<?= $this->formSelect(
'sort', 'sort',
$this->sort, $this->sort,
array('class' => 'autosubmit'), array('class' => 'autosubmit'),
@ -28,16 +27,20 @@ $trimArea = $this->getHelper('Trim');
'service_last_time_ok' => 'Last OK', 'service_last_time_ok' => 'Last OK',
'service_description' => 'Service', 'service_description' => 'Service',
) )
) ?> ); ?>
<button class="btn btn-small"><i class="icon-refresh"></i></button> <noscript>
<button class="btn btn-small btn-default">
<i>ICON REFRESH</i>
</button>
</noscript>
</form> </form>
<?= $this->paginationControl($paginator, null, null, array('preserve' => $this->preserve)) ?> <?= $this->paginationControl($paginator, null, null, array('preserve' => $this->preserve)) ?>
<table class="statustable action services"> <table class="table table-condensed">
<thead> <thead>
<tr> <tr>
<th colspan="3">Status</th> <th colspan="2">Status</th>
<th>Service</th> <th>Service</th>
<th>Host</th> <th>Host</th>
<th>Output</th> <th>Output</th>
@ -45,66 +48,60 @@ $trimArea = $this->getHelper('Trim');
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($services->fetchAll() as $service): ?> <?php foreach ($services->fetchAll() as $service): ?>
<tr class="<?= implode(' ', $viewHelper->getStateFlags($service, 'service')); ?>"> <tr>
<td class="icons indicator"> <td>
<div class="img-box"><?php $trimArea->start(); ?> <div>
<?php if ($service->service_icon_image) : ?> <?php if ($service->service_icon_image) : ?>
<img src="<?= $service->service_icon_image; ?>"/> <img src="<?= $service->service_icon_image; ?>"/>
<?php endif; ?> <?php endif; ?>
<?php $trimArea->end(); ?>
</div> </div>
</td> </td>
<td class="icons indicator"> <td>
<div class="icon-box"><?php $trimArea->start(); ?> <div>
<?php if (!$service->service_handled && $service->service_state > 0): ?> <?php if (!$service->service_handled && $service->service_state > 0): ?>
<a href="#" title="<?= 'Unhandled service' ?>"> <a href="#" title="<?= 'Unhandled service' ?>">
<i class="icon-warning-sign"></i> <i>UNHANDLED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?> <?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
<a href="#" title="<?= 'Acknowledged' ?>"> <a href="#" title="<?= 'Acknowledged' ?>">
<i class="icon-ok-sign"></i> <i>ACKNOWLEDGED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($service->service_is_flapping): ?> <?php if ($service->service_is_flapping): ?>
<a href="#" title="<?= 'Flapping' ?>"> <a href="#" title="<?= 'Flapping' ?>">
<i class="icon-random"></i> <i>FLAPPING ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if (!$service->service_notifications_enabled): ?> <?php if (!$service->service_notifications_enabled): ?>
<a href="#" title="<?= 'Notifications disabled' ?>"> <a href="#" title="<?= 'Notifications disabled' ?>">
<i class="icon-volume-off"></i> <i>NOTIFICATIONS DISABLED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($service->service_in_downtime): ?> <?php if ($service->service_in_downtime): ?>
<a href="#" title="<?= 'In downtime' ?>"> <a href="#" title="<?= 'In downtime' ?>">
<i class="icon-wrench"></i> <i>IN DOWNTIME ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php $trimArea->end(); ?>
</div> </div>
</td> </td>
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>"> <td title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
<div class="statetext"> <div>
<b><?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b> <b><?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b>
<div class="nowrap"> since&nbsp; <div> since&nbsp;
<?= $this->timeSince($service->service_last_state_change); ?> <?= $this->timeSince($service->service_last_state_change); ?>
<?php if ($service->service_state_type == 0): ?> <?php if ($service->service_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>"> <a href="#" title="<?= 'Soft state' ?>">
<i class="icon-gears"></i> <i>SOFTSTATE ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
</div> </div>
@ -112,10 +109,10 @@ $trimArea = $this->getHelper('Trim');
</td> </td>
<td class="servicename"> <td>
<?php if ($service->service_last_comment !== null): ?> <?php if ($service->service_last_comment !== null): ?>
<a href="#" title="<?= 'Comments' ?>"> <a href="#" title="<?= 'Comments' ?>">
<i class="icon-comment"> </i> <i>COMMENT ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
@ -130,25 +127,20 @@ $trimArea = $this->getHelper('Trim');
<a href="<?= $service->service_notes_url; ?>">Notes</a> <a href="<?= $service->service_notes_url; ?>">Notes</a>
<?php endif; ?> <?php endif; ?>
<?php if ($service->service_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>">
<i class="icon-gears"></i>
</a>
<?php endif; ?>
</td> </td>
<td class="hostname" title="<?= $viewHelper->getStateTitle($service, 'host'); ?>"> <td title="<?= $viewHelper->getStateTitle($service, 'host'); ?>">
<?= $service->host_name; ?> <?= $service->host_name; ?>
<div class="statetext"> <div>
(<?= ucfirst($viewHelper->monitoringState($service, 'host')); ?>) (<?= ucfirst($viewHelper->monitoringState($service, 'host')); ?>)
</div> </div>
<span class="host_address"> <span>
<?= $service->host_address ?> <?= $service->host_address ?>
</span> </span>
</td> </td>
<td class="expand-full"> <td>
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?> <?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
</td> </td>
</tr> </tr>