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

@ -17,19 +17,19 @@ $createDbBackend = Url::fromPath(
$errors = $this->form->getErrorMessages(); $errors = $this->form->getErrorMessages();
if (!empty($errors)): if (!empty($errors)):
?> ?>
<div class="alert alert-danger"> <div class="alert alert-danger">
<h4>There are errors in your configuration</h4> <h4>There are errors in your configuration</h4>
<br/> <br/>
<ul> <ul>
<?php foreach($errors as $error): ?> <?php foreach($errors as $error): ?>
<li><?= $error ?></li> <li><?= $error ?></li>
<?php endforeach;?> <?php endforeach;?>
</ul> </ul>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div> <div>
<a href="<?= $createLdapBackend ?>">Create a new LDAP authentication backend</a><br/> <a href="<?= $createLdapBackend ?>">Create a new LDAP authentication backend</a><br/>
<a href="<?= $createDbBackend ?>">Create a new DB authentication backend</a> <a href="<?= $createDbBackend ?>">Create a new DB authentication backend</a>
</div> </div>
<?= $this->form ?> <?= $this->form ?>

View File

@ -4,15 +4,15 @@
<?php if (!empty($errors)) : ?> <?php if (!empty($errors)) : ?>
<div class="alert alert-danger"> <div class="alert alert-danger">
<h4>Errors occured when trying to save the project</h4> <h4>Errors occured when trying to save the project</h4>
<p> <p>
The following errors occured when trying to save the configuration: The following errors occured when trying to save the configuration:
</p> </p>
<ul> <ul>
<?php foreach($errors as $error): ?> <?php foreach($errors as $error): ?>
<li><?= $this->escape($error) ?></li> <li><?= $this->escape($error) ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
<?php endif; ?> <?php endif; ?>

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->loaded ? 'enabled' : 'failed') : 'disabled' ?>)
$module->enabled </td>
? ($module->loaded ? 'enabled' : 'failed') </tr>
: 'disabled' <? endforeach ?>
?>)</td> </tbody>
</tr>
<? endforeach ?>
</tbody>
</table> </table>

View File

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

View File

@ -1,30 +1,29 @@
<?= $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/>
This could have one or more of the following reasons: This could have one or more of the following reasons:
</p> </p>
<ul> <ul>
<li>You don't have file-system permissions to write to the <?= $this->escape($this->file); ?>.ini file</li> <li>You don't have file-system permissions to write to the <?= $this->escape($this->file); ?>.ini file</li>
<li>Something went wrong while writing the file</li> <li>Something went wrong while writing the file</li>
<li>There's an application error preventing you from persisting the configuration</li> <li>There's an application error preventing you from persisting the configuration</li>
</ul> </ul>
</div> </div>
<p> <p>
Details can be seen in your application log (if you don't have access to this file, call your administrator in this case). Details can be seen in your application log (if you don't have access to this file, call your administrator in this case).
<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>
</pre> </pre>
</p> </p>

View File

@ -1,24 +1,23 @@
<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
of the following reasons: of the following reasons:
</p> </p>
<ul> <ul>
<li>You don't have permissions to write to the dashboard file</li> <li>You don't have permissions to write to the dashboard file</li>
<li>Something went wrong while writing the file</li> <li>Something went wrong while writing the file</li>
<li>There's an application error preventing you from persisting the configuration</li> <li>There's an application error preventing you from persisting the configuration</li>
</ul> </ul>
</div> </div>
<p> <p>
Details can be seen in your application log (if you don't have access to this file, call your administrator in this case). Details can be seen in your application log (if you don't have access to this file, call your administrator in this case).
<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,32 +1,36 @@
<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 ?>
</p>
<?php if (isset($this->exception)): ?>
<div style="text-align:left;">
<h3>Exception information:</h3>
<p>
<b>Message:</b>
<?= $this->exception->getMessage(); ?>
<?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>
<?php if (isset($this->exception)): ?> <h3>Stack trace:</h3>
<div style="text-align:left;"> <pre>
<h3>Exception information:</h3> <?= $this->exception->getTraceAsString(); ?>
</pre>
<p> <h3>Request Parameters:</h3>
<b>Message:</b> <?php echo $this->exception->getMessage() ?> <pre><?= var_export(\Zend_Controller_Front::getInstance()->getParams(), true) ?>
<?php if (isset($this->exception->action)): ?> </pre>
<br/><b>Action</b>: <?= $this->exception->action; ?> </div>
<?php endif ?> <?php endif ?>
<?php if (isset($this->exception->action)): ?>
<br/><b>Target</b>: <?= $this->exception->target; ?>
<?php endif ?>
</p>
<h3>Stack trace:</h3>
<pre style="font-family: monospace"><?php echo $this->exception->getTraceAsString() ?>
</pre>
<h3>Request Parameters:</h3>
<pre><?php echo var_export(\Zend_Controller_Front::getInstance()->getParams(), true) ?>
</pre>
</div>
<?php endif ?>
</div> </div>

View File

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

View File

@ -2,13 +2,13 @@
<?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; ?>
<?php if (isset($this->exceptionMessage)): ?> <?php if (isset($this->exceptionMessage)): ?>
<div class="alert alert-danger"> <div class="alert alert-danger">
<h4>Could not update preferences due to an internal exception (<?= $this->exceptionMessage ?>)</h4> <h4>Could not update preferences due to an internal exception (<?= $this->exceptionMessage ?>)</h4>
</div> </div>
<?php endif; ?> <?php endif; ?>

View File

@ -16,68 +16,81 @@ 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>
'sort', <br/>
$this->sort, <?=
array('class' => 'autosubmit'), $this->formSelect(
array( 'sort',
'downtime_is_in_effect' => 'Is In Effect', $this->sort,
'object_type' => 'Service/Host', array('class' => 'autosubmit'),
'host_name' => 'Host Name', array(
'service_description' => 'Service Name', 'downtime_is_in_effect' => 'Is In Effect',
'downtime_entry_time' => 'Entry Time', 'object_type' => 'Service/Host',
'downtime_author_name' => 'Author', 'host_name' => 'Host Name',
'downtime_comment_data' => 'Comment', 'service_description' => 'Service Name',
'downtime_scheduled_start_time' => 'Start', 'downtime_entry_time' => 'Entry Time',
'downtime_scheduled_end_time' => 'End', 'downtime_author_name' => 'Author',
'downtime_trigger_time' => 'Trigger Time', 'downtime_comment_data' => 'Comment',
'downtime_internal_downtime_id' => 'Downtime ID', 'downtime_scheduled_start_time' => 'Start',
'downtime_duration' => 'Duration', 'downtime_scheduled_end_time' => 'End',
) 'downtime_trigger_time' => 'Trigger Time',
) ?> 'downtime_internal_downtime_id' => 'Downtime ID',
<button class="btn btn-small"><i class="icon-refresh"></i></button> 'downtime_duration' => 'Duration',
)
)
?>
<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,106 +6,91 @@ $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>
</tr> </tr>
</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>
</td>
<td class="icons indicator">
<div class="icon-box"><?php $trimArea->start(); ?>
<?php if (!$host->host_handled && $host->host_state > 0): ?>
<a href="#" title="<?= 'Unhandled host' ?>">
<i class="icon-warning-sign"></i>
</a>
<?php endif; ?>
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
<a href="#" title="<?= 'Acknowledged' ?>">
<i class="icon-ok-sign"></i>
</a>
<?php endif; ?>
<?php if ($host->host_is_flapping): ?>
<a href="#" title="<?= 'Flapping' ?>">
<i class="icon-random"></i>
</a>
<?php endif; ?>
<?php if (!$host->host_notifications_enabled): ?>
<a href="#" title="<?= 'Notifications disabled' ?>">
<i class="icon-volume-off"></i>
</a>
<?php endif; ?>
<?php if ($host->host_in_downtime): ?>
<a href="#" title="<?= 'In downtime' ?>">
<i class="icon-wrench"></i>
</a>
<?php endif; ?>
<?php $trimArea->end(); ?>
</div>
</td>
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
<div class="statetext">
<a href="<?= $this->href('monitoring/show/history', array('host' => $host->host_name)); ?>">
<b> <?= ucfirst($viewHelper->monitoringState($host, 'host')); ?> </b>
<div class="nowrap"> since&nbsp;
<?= $this->timeSince($host->host_last_state_change); ?>
<?php if ($host->host_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>">
<i class="icon-gears"></i>
</a>
<?php endif; ?>
</div> </div>
</div> </td>
</td> <td>
<div>
<td class="hostname"> <?php if (!$host->host_handled && $host->host_state > 0): ?>
<?php if ($host->host_last_comment !== null): ?> <a href="#" title="<?= 'Unhandled host' ?>">
<a href="#" title="<?= 'Comments' ?>"> <i>UNHANDLED ICON</i>
<i class="icon-comment"> </i> </a>
</a> <?php endif; ?>
<?php endif; ?> <?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
<a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>" <a href="#" title="<?= 'Acknowledged' ?>">
class="row-action"> <i>ACKNOWLEDGED ICON</i>
<b><?= $host->host_name; ?></b> </a>
<br/> <?php endif; ?>
<i><?= $host->host_address; ?></i> <?php if ($host->host_is_flapping): ?>
</a> <a href="#" title="<?= 'Flapping' ?>">
<i>FLAPPING ICON</i>
<?php if ($host->host_action_url != ''): ?> </a>
<a href="<?= $host->host_action_url; ?>">Action</a> <?php endif; ?>
<?php endif; ?> <?php if (!$host->host_notifications_enabled): ?>
<a href="#" title="<?= 'Notifications disabled' ?>">
<?php if ($host->host_notes_url != ''): ?> <i>NOTIFICATIONS DISABLED ICON</i>
<a href="<?= $host->host_notes_url; ?>">Notes</a> </a>
<?php endif; ?> <?php endif; ?>
</td> <?php if ($host->host_in_downtime): ?>
<td class="expand-full"> <a href="#" title="<?= 'In downtime' ?>">
<?= $this->escape(substr(strip_tags($host->host_output), 0, 500)); ?> <i>IN DOWNTIME ICON</i>
</td> </a>
</tr> <?php endif; ?>
<?php endforeach; ?> </div>
</td>
<td title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
<div>
<a href="<?= $this->href('monitoring/show/history', array('host' => $host->host_name)); ?>">
<b> <?= ucfirst($viewHelper->monitoringState($host, 'host')); ?> </b>
<div> since&nbsp;
<?= $this->timeSince($host->host_last_state_change); ?>
<?php if ($host->host_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>">
<i>SOFTSTATE ICON</i>
</a>
<?php endif; ?>
</div>
</a>
</div>
</td>
<td>
<?php if ($host->host_last_comment !== null): ?>
<a href="#" title="<?= 'Comments' ?>">
<i>COMMENT ICON</i>
</a>
<?php endif; ?>
<a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>">
<b><?= $host->host_name; ?></b>
<br/>
<i><?= $host->host_address; ?></i>
</a>
<?php if ($host->host_action_url != ''): ?>
<a href="<?= $host->host_action_url; ?>">Action</a>
<?php endif; ?>
<?php if ($host->host_notes_url != ''): ?>
<a href="<?= $host->host_notes_url; ?>">Notes</a>
<?php endif; ?>
</td>
<td>
<?= $this->escape(substr(strip_tags($host->host_output), 0, 500)); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody> </tbody>
</table> </table>

View File

@ -3,129 +3,124 @@
<?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>
</tr> </tr>
</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"> <div>
<?php $trimArea->start(); ?> <?php if ($host->host_icon_image) : ?>
<img src="<?= $host->host_icon_image; ?>"/>
<?php endif; ?>
</div>
</td>
<?php if ($host->host_icon_image) : ?> <td>
<img src="<?= $host->host_icon_image; ?>"/> <div>
<?php endif; ?> <?php if (!$host->host_handled && $host->host_state > 0): ?>
<a href="#" title="<?= 'Unhandled host' ?>">
<i>UNHANDLED ICON</i>
</a>
<?php endif; ?>
<?php $trimArea->end(); ?> <?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
</div> <a href="#" title="<?= 'Acknowledged' ?>">
</td> <i>ACKNOWLEDGED ICON</i>
<td class="icons indicator"> </a>
<div class="icon-box"> <?php endif; ?>
<?php $trimArea->start(); ?>
<?php if (!$host->host_handled && $host->host_state > 0): ?> <?php if ($host->host_is_flapping): ?>
<a href="#" title="<?= 'Unhandled host' ?>"> <a href="#" title="<?= 'Flapping' ?>">
<i class="icon-warning-sign"></i> <i>FLAPPING ICON</i>
</a>
<?php endif; ?>
<?php if (!$host->host_notifications_enabled): ?>
<a href="#" title="<?= 'Notifications disabled' ?>">
<i>NOTIFICATIONS DISABLED ICON</i>
</a>
<?php endif; ?>
<?php if ($host->host_in_downtime): ?>
<a href="#" title="<?= 'In downtime' ?>">
<i>IN DOWNTIME ICON</i>
</a>
<?php endif; ?>
</div>
</td>
<td title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
<div >
<b><?= ucfirst($viewHelper->monitoringState($host, 'host')); ?></b>
<div> since&nbsp;
<?= $this->timeSince($host->host_last_state_change); ?>
<?php if ($host->host_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>">
<i>SOFTSTATE ICON</i>
</a>
<?php endif; ?>
</div>
</div>
</td>
<td>
<?php if ($host->host_last_comment !== null): ?>
<a href="#" title="<?= 'Comments' ?>">
<i>COMMENT ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?> <a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>">
<a href="#" title="<?= 'Acknowledged' ?>"> <b> <?= $host->host_name ?></b><br/>
<i class="icon-ok-sign"></i> <i> <?= $host->host_address ?></i>
</a>
<?php endif; ?>
<?php if ($host->host_is_flapping): ?>
<a href="#" title="<?= 'Flapping' ?>">
<i class="icon-random"></i>
</a>
<?php endif; ?>
<?php if (!$host->host_notifications_enabled): ?>
<a href="#" title="<?= 'Notifications disabled' ?>">
<i class="icon-volume-off"></i>
</a>
<?php endif; ?>
<?php if ($host->host_in_downtime): ?>
<a href="#" title="<?= 'In downtime' ?>">
<i class="icon-wrench"></i>
</a> </a>
<?php if ($host->host_action_url != ""): ?>
<a href="<?= $host->host_action_url; ?>">Action</a>
<?php endif; ?> <?php endif; ?>
<?php $trimArea->end(); ?>
</div> <?php if ($host->host_notes_url != ""): ?>
</td> <a href="<?= $host->host_notes_url; ?>">Notes</a>
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>"> <?php endif; ?>
<div class="statetext">
<b><?= ucfirst($viewHelper->monitoringState($host, 'host')); ?></b>
<div class="nowrap"> since&nbsp; </td>
<?= $this->timeSince($host->host_last_state_change); ?>
<td>
<?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?>
</td>
<?php if ($host->host_state_type == 0): ?> </tr>
<a href="#" title="<?= 'Soft state' ?>">
<i class="icon-gears"></i>
</a>
<?php endif; ?>
</div>
</div>
</td>
<td class="hostname">
<?php if ($host->host_last_comment !== null): ?>
<a href="#" title="<?= 'Comments' ?>">
<i class="icon-comment"> </i>
</a>
<?php endif; ?>
<a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>" class="row-action">
<b> <?= $host->host_name ?></b><br/>
<i> <?= $host->host_address ?></i>
</a>
<?php if ($host->host_action_url != ""): ?>
<a href="<?= $host->host_action_url; ?>">Action</a>
<?php endif; ?>
<?php if ($host->host_notes_url != ""): ?>
<a href="<?= $host->host_notes_url; ?>">Notes</a>
<?php endif; ?>
</td>
<td class="expand-full">
<?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?>
</td>
</tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>

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,19 +10,23 @@ $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,
array( array(
'class' => 'autosubmit' 'class' => 'autosubmit'
), ),
array( array(
'notification_start_time' => 'Time' 'notification_start_time' => 'Time'
) )
); );
?> ?>
<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,42 +34,42 @@ $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>
<th>Service</th> <th>Service</th>
<th>Type</th> <th>Type</th>
<th>Time</th> <th>Time</th>
<th>Contact</th> <th>Contact</th>
<th>Notification command</th> <th>Notification command</th>
<th>Information</th> <th>Information</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($notifications as $notification): ?> <?php foreach ($notifications as $notification): ?>
<tr> <tr>
<td> <td>
<?= $notification->host_name ?> <?= $notification->host_name ?>
</td> </td>
<td> <td>
<?= empty($notification->service_description) ? '' : $notification->service_description; ?> <?= empty($notification->service_description) ? '' : $notification->service_description; ?>
</td> </td>
<td><?= $formatter->getNotificationType($notification); ?> <td><?= $formatter->getNotificationType($notification); ?>
</td> </td>
<td> <td>
<?= $notification->notification_start_time ?> <?= $notification->notification_start_time ?>
</td> </td>
<td> <td>
<?= $notification->notification_contact ?> <?= $notification->notification_contact ?>
</td> </td>
<td> <td>
<?= $notification->notification_command ?> <?= $notification->notification_command ?>
</td> </td>
<td> <td>
<?= $this->escape(substr(strip_tags($notification->notification_information), 0, 10000)); ?> <?= $this->escape(substr(strip_tags($notification->notification_information), 0, 10000)); ?>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>

View File

@ -1,130 +1,104 @@
<?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) : ?>
<img src="<?= $service->service_icon_image; ?>"/>
<?php if ($service->service_icon_image) : ?> <?php endif; ?>
<img src="<?= $service->service_icon_image; ?>"/> </div>
<?php endif; ?> </td>
<td>
<?php $trimArea->end(); ?> <div>
</div> <?php if (!$service->service_handled && $service->service_state > 0): ?>
</td> <a href="#" title="<?= 'Unhandled service' ?>">
<td class="icons indicator"> <i>UNHANDLED ICON</i>
<div class="icon-box"><?php $trimArea->start(); ?> </a>
<?php if (!$service->service_handled && $service->service_state > 0): ?>
<a href="#" title="<?= 'Unhandled service' ?>">
<i class="icon-warning-sign"></i>
</a>
<?php endif; ?>
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
<a href="#" title="<?= 'Acknowledged' ?>">
<i class="icon-ok-sign"></i>
</a>
<?php endif; ?>
<?php if ($service->service_is_flapping): ?>
<a href="#" title="<?= 'Flapping' ?>">
<i class="icon-random"></i>
</a>
<?php endif; ?>
<?php if (!$service->service_notifications_enabled): ?>
<a href="#" title="<?= 'Notifications disabled' ?>">
<i class="icon-volume-off"></i>
</a>
<?php endif; ?>
<?php if ($service->service_in_downtime): ?>
<a href="#" title="<?= 'In downtime' ?>">
<i class="icon-wrench"></i>
</a>
<?php endif; ?>
<?php $trimArea->end(); ?>
</div>
</td>
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
<div class="statetext">
<?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b>
<div class="nowrap"> since&nbsp;'
<?= $this->timeSince($service->service_last_state_change); ?>
<?php if ($service->service_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>">
<i class="icon-gears"></i>
</a>
<?php endif; ?> <?php endif; ?>
</div>
</div>
</td>
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
<a href="#" title="<?= 'Acknowledged' ?>">
<i>ACKNOWLEDGED ICON</i>
</a>
<?php endif; ?>
<td class="servicename"> <?php if ($service->service_is_flapping): ?>
<a href="#" title="<?= 'Flapping' ?>">
<i>FLAPPING ICON</i>
</a>
<?php endif; ?>
<?php if ($service->service_last_comment !== null): ?> <?php if (!$service->service_notifications_enabled): ?>
<a href="#" title="<?= 'Comments' ?>"> <a href="#" title="<?= 'Notifications disabled' ?>">
<i class="icon-comment"> </i> <i>NOTIFICATIONS DISABLED ICON</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($service->service_in_downtime): ?>
<a href="#" title="<?= 'In downtime' ?>">
<i>IN DOWNTIME ICON</i>
</a>
<?php endif; ?>
<b> <?= $service->service_display_name; ?></b> </div>
<br/> </td>
<?= $service->host_name; ?> <td title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
<div>
<?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b>
<div> since&nbsp;'
<?= $this->timeSince($service->service_last_state_change); ?>
<?php if ($service->service_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>">
<i>SOFTSTATE ICON</i>
</a>
<?php endif; ?>
</div>
</div>
</td>
<td class="servicename">
<?php if ($service->service_last_comment !== null): ?>
<a href="#" title="<?= 'Comments' ?>">
<i>COMMENT ICON</i>
</a>
<?php endif; ?>
<b> <?= $service->service_display_name; ?></b>
<br/>
<?= $service->host_name; ?>
<?php if ($service->service_action_url != ""): ?> <?php if ($service->service_action_url != ""): ?>
<a href="<?= $service->service_action_url; ?>">Action</a> <a href="<?= $service->service_action_url; ?>">Action</a>
<?php endif; ?> <?php endif; ?>
<?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; ?>
</td>
<?php if ($service->service_state_type == 0): ?> <td>
<a href="#" title="<?= 'Soft state' ?>"> <?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
<i class="icon-gears"></i> </td>
</a> </tr>
<?php endif; ?>
</td>
<td class="expand-full">
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
</td>
</tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>

View File

@ -2,156 +2,148 @@
<?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>
'sort', <?= $this->formSelect(
$this->sort, 'sort',
array('class' => 'autosubmit'), $this->sort,
array( array('class' => 'autosubmit'),
'service_severity' => 'Severity', array(
'service_last_state_change' => 'Last state change', 'service_severity' => 'Severity',
'service_last_time_unknown' => 'Last UNKNOWN', 'service_last_state_change' => 'Last state change',
'service_last_time_critical' => 'Last CRITICAL', 'service_last_time_unknown' => 'Last UNKNOWN',
'service_last_time_warning' => 'Last WARNING', 'service_last_time_critical' => 'Last CRITICAL',
'service_last_time_ok' => 'Last OK', 'service_last_time_warning' => 'Last WARNING',
'service_description' => 'Service', 'service_last_time_ok' => 'Last OK',
) '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>
<th></th> <th></th>
</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>
</td>
<td class="icons indicator">
<div class="icon-box"><?php $trimArea->start(); ?>
<?php if (!$service->service_handled && $service->service_state > 0): ?>
<a href="#" title="<?= 'Unhandled service' ?>">
<i class="icon-warning-sign"></i>
</a>
<?php endif; ?>
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
<a href="#" title="<?= 'Acknowledged' ?>">
<i class="icon-ok-sign"></i>
</a>
<?php endif; ?>
<?php if ($service->service_is_flapping): ?>
<a href="#" title="<?= 'Flapping' ?>">
<i class="icon-random"></i>
</a>
<?php endif; ?>
<?php if (!$service->service_notifications_enabled): ?>
<a href="#" title="<?= 'Notifications disabled' ?>">
<i class="icon-volume-off"></i>
</a>
<?php endif; ?>
<?php if ($service->service_in_downtime): ?>
<a href="#" title="<?= 'In downtime' ?>">
<i class="icon-wrench"></i>
</a>
<?php endif; ?>
<?php $trimArea->end(); ?>
</div>
</td>
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
<div class="statetext">
<b><?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b>
<div class="nowrap"> since&nbsp;
<?= $this->timeSince($service->service_last_state_change); ?>
<?php if ($service->service_state_type == 0): ?>
<a href="#" title="<?= 'Soft state' ?>">
<i class="icon-gears"></i>
</a>
<?php endif; ?>
</div> </div>
</div> </td>
</td> <td>
<div>
<?php if (!$service->service_handled && $service->service_state > 0): ?>
<a href="#" title="<?= 'Unhandled service' ?>">
<i>UNHANDLED ICON</i>
</a>
<?php endif; ?>
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
<a href="#" title="<?= 'Acknowledged' ?>">
<i>ACKNOWLEDGED ICON</i>
</a>
<?php endif; ?>
<?php if ($service->service_is_flapping): ?>
<a href="#" title="<?= 'Flapping' ?>">
<i>FLAPPING ICON</i>
</a>
<?php endif; ?>
<?php if (!$service->service_notifications_enabled): ?>
<a href="#" title="<?= 'Notifications disabled' ?>">
<i>NOTIFICATIONS DISABLED ICON</i>
</a>
<?php endif; ?>
<?php if ($service->service_in_downtime): ?>
<a href="#" title="<?= 'In downtime' ?>">
<i>IN DOWNTIME ICON</i>
</a>
<?php endif; ?>
</div>
</td>
<td class="servicename"> <td title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
<?php if ($service->service_last_comment !== null): ?> <div>
<a href="#" title="<?= 'Comments' ?>"> <b><?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b>
<i class="icon-comment"> </i> <div> since&nbsp;
</a> <?= $this->timeSince($service->service_last_state_change); ?>
<?php endif; ?>
<b> <?= $service->service_display_name; ?></b> <?php if ($service->service_state_type == 0): ?>
<br/> <a href="#" title="<?= 'Soft state' ?>">
<i>SOFTSTATE ICON</i>
</a>
<?php endif; ?>
</div>
</div>
</td>
<?php if ($service->service_action_url != ""): ?>
<a href="<?= $service->service_action_url; ?>">Action</a>
<?php endif; ?>
<?php if ($service->service_notes_url != ""): ?> <td>
<a href="<?= $service->service_notes_url; ?>">Notes</a> <?php if ($service->service_last_comment !== null): ?>
<?php endif; ?> <a href="#" title="<?= 'Comments' ?>">
<i>COMMENT ICON</i>
</a>
<?php endif; ?>
<?php if ($service->service_state_type == 0): ?> <b> <?= $service->service_display_name; ?></b>
<a href="#" title="<?= 'Soft state' ?>"> <br/>
<i class="icon-gears"></i>
</a>
<?php endif; ?>
</td>
<td class="hostname" title="<?= $viewHelper->getStateTitle($service, 'host'); ?>"> <?php if ($service->service_action_url != ""): ?>
<?= $service->host_name; ?> <a href="<?= $service->service_action_url; ?>">Action</a>
<?php endif; ?>
<div class="statetext"> <?php if ($service->service_notes_url != ""): ?>
(<?= ucfirst($viewHelper->monitoringState($service, 'host')); ?>) <a href="<?= $service->service_notes_url; ?>">Notes</a>
</div> <?php endif; ?>
<span class="host_address">
<?= $service->host_address ?>
</span>
</td>
<td class="expand-full"> </td>
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
</td> <td title="<?= $viewHelper->getStateTitle($service, 'host'); ?>">
</tr> <?= $service->host_name; ?>
<div>
(<?= ucfirst($viewHelper->monitoringState($service, 'host')); ?>)
</div>
<span>
<?= $service->host_address ?>
</span>
</td>
<td>
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
</td>
</tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>