Various style fixes, changed icon size, fixed show/service

This commit is contained in:
Jannis Moßhammer 2013-10-22 15:57:30 +02:00
parent f2be16621b
commit 16124989dd
20 changed files with 204 additions and 160 deletions

View File

@ -21,7 +21,7 @@ $title_next = sprintf(
); );
?> ?>
<ul class="pagination pagination-sm"> <ul class="pagination">
<!-- Previous page link --> <!-- Previous page link -->
<?php if (isset($this->previous)): ?> <?php if (isset($this->previous)): ?>

View File

@ -64,8 +64,8 @@ class FilterBox implements Widget
*/ */
private static $TPL = <<<'EOT' private static $TPL = <<<'EOT'
<div class="row"> <div class="row">
<div class="col-md-12">{{FORM}}</div> {{FORM}}
<div class="col-md-12">{{BADGES}}</div> {{BADGES}}
</div> </div>
EOT; EOT;

View File

@ -52,7 +52,8 @@ class DashboardAction implements Tabextension
$tabs->addAsDropdown( $tabs->addAsDropdown(
'dashboard', 'dashboard',
array( array(
'title' => '{{DASHBOARD_ICON}} Add To Dashboard', 'iconCls' => 'icinga-icon-dashboard',
'title' => 'Add To Dashboard',
'url' => Url::fromPath('dashboard/addurl'), 'url' => Url::fromPath('dashboard/addurl'),
'urlParams' => array( 'urlParams' => array(
'url' => Url::fromRequest()->getRelativeUrl() 'url' => Url::fromRequest()->getRelativeUrl()

View File

@ -57,8 +57,8 @@ EOT;
*/ */
private $dropdownTpl = <<< 'EOT' private $dropdownTpl = <<< 'EOT'
<li class="dropdown pull-right "> <li class="dropdown pull-right ">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="margin-top:3px">
<b class="caret"></b> <i style="" class="caret"></i> Actions
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{TABS} {TABS}

View File

@ -63,7 +63,6 @@ class Monitoring_ListController extends MonitoringController
* @var Backend * @var Backend
*/ */
protected $backend; protected $backend;
/** /**
* Compact layout name * Compact layout name
* *
@ -72,7 +71,7 @@ class Monitoring_ListController extends MonitoringController
* *
* @var string * @var string
*/ */
private $compactView; protected $compactView;
/** /**
* Retrieve backend and hooks for this controller * Retrieve backend and hooks for this controller
@ -168,6 +167,7 @@ class Monitoring_ListController extends MonitoringController
'host_address' => 'Host Address', 'host_address' => 'Host Address',
'host_last_check' => 'Last Host Check' 'host_last_check' => 'Last Host Check'
)); ));
} }
/** /**
@ -379,39 +379,6 @@ class Monitoring_ListController extends MonitoringController
); );
} }
/**
* Handle the 'format' and 'view' parameter
*
* @param Query $query The current query
*/
private function handleFormatRequest($query)
{
if ($this->compactView !== null && ($this->_getParam('view', false) === 'compact')) {
$this->_helper->viewRenderer($this->compactView);
}
if ($this->getParam('format') === 'sql'
&& IcingaConfig::app()->global->get('environment', 'production') === 'development') {
echo '<pre>'
. htmlspecialchars(wordwrap($query->dump()))
. '</pre>';
exit;
}
if ($this->_getParam('format') === 'json'
|| $this->_request->getHeader('Accept') === 'application/json')
{
header('Content-type: application/json');
echo json_encode($query->fetchAll());
exit;
}
if ($this->_getParam('format') === 'csv'
|| $this->_request->getHeader('Accept') === 'text/csv') {
Csv::fromQuery($query)->dump();
exit;
}
}
/** /**
* Create a sort control box at the 'sortControl' view parameter * Create a sort control box at the 'sortControl' view parameter
* *
@ -446,7 +413,7 @@ class Monitoring_ListController extends MonitoringController
private function createTabs() private function createTabs()
{ {
$tabs = $this->getTabs(); $tabs = $this->getTabs();
$tabs->extend(new OutputFormat()) $tabs//->extend(new OutputFormat())
->extend(new DashboardAction()); ->extend(new DashboardAction());
} }
} }

View File

@ -3,14 +3,19 @@
/** @var Zend_View_Helper_CommandForm $commandHelper */ /** @var Zend_View_Helper_CommandForm $commandHelper */
$commandHelper = $this->getHelper('CommandForm'); $commandHelper = $this->getHelper('CommandForm');
?> $viewHelper = $this->getHelper('MonitoringState');
<?= $this->tabs->render($this); ?>
<?php
$viewHelper = $this->getHelper('MonitoringState');
?> ?>
<h1>Comments</h1> <div class="row">
<div class="pull-left">
<h1>Comments</h1>
</div>
<div class="pull-right">
<?= $this->tabs->render($this); ?>
</div>
</div>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single">

View File

@ -1,10 +1,17 @@
<?= $this->tabs->render($this); ?>
<?php <?php
$viewHelper = $this->getHelper('MonitoringState'); $viewHelper = $this->getHelper('MonitoringState');
$knownGroups = array() $knownGroups = array()
?> ?>
<div class="row">
<div class="pull-left">
<h1>Contact Groups</h1>
</div>
<div class="pull-right">
<?= $this->tabs->render($this); ?>
</div>
</div>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="none"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="none">
<?= $this->sortControl->render($this); ?> <?= $this->sortControl->render($this); ?>
<?= $this->paginationControl($contactgroups, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($contactgroups, null, null, array('preserve' => $this->preserve)); ?>

View File

@ -1,10 +1,15 @@
<?= $this->tabs->render($this); ?>
<?php <?php
$viewHelper = $this->getHelper('MonitoringState'); $viewHelper = $this->getHelper('MonitoringState');
$contactHelper = $this->getHelper('ContactFlags'); $contactHelper = $this->getHelper('ContactFlags');
?> ?>
<div class="row">
<div class="pull-left">
<h1>Contacts</h1>
</div>
<div class="pull-right">
<?= $this->tabs->render($this); ?>
</div>
</div>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="none"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="none">
<?= $this->sortControl->render($this); ?> <?= $this->sortControl->render($this); ?>
<?= $this->paginationControl($contacts, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($contacts, null, null, array('preserve' => $this->preserve)); ?>

View File

@ -1,7 +1,14 @@
<?php <?php
$commandHelper = $this->getHelper('CommandForm'); $commandHelper = $this->getHelper('CommandForm');
?> ?>
<div class="row">
<div class="pull-left">
<h1>Downtimes</h1>
</div>
<div class="pull-right">
<?= $this->tabs->render($this); ?>
</div>
</div>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single">
<div> <div>
<?= $this->sortControl->render($this); ?> <?= $this->sortControl->render($this); ?>

View File

@ -1,4 +1,11 @@
<h1>History</h1> <div class="row">
<div class="pull-left">
<h1>History</h1>
</div>
<div class="pull-right">
<?= $this->tabs->render($this); ?>
</div>
</div>
<?php if (!empty($history)): ?> <?php if (!empty($history)): ?>
<div data-icinga-component="app/mainDetailGrid"> <div data-icinga-component="app/mainDetailGrid">
<?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>

View File

@ -1,3 +1,11 @@
<div class="row">
<div class="pull-left">
<h1>Hostgroups</h1>
</div>
<div class="pull-right">
<?= $this->tabs->render($this); ?>
</div>
</div>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single">
<?= $this->sortControl->render($this); ?> <?= $this->sortControl->render($this); ?>
<?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?>

View File

@ -1,9 +1,15 @@
<?php <?php
$viewHelper = $this->getHelper('MonitoringState'); $viewHelper = $this->getHelper('MonitoringState');
?> ?>
<div class="row">
<div class="pull-left">
<h1>Hosts Status</h1>
</div>
<div class="pull-right">
<?= $this->tabs->render($this); ?>
</div>
</div>
<?= $this->tabs->render($this); ?>
<h1>Hosts Status</h1>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="multi"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="multi">
<div class="container pull-left"> <div class="container pull-left">

View File

@ -1,4 +1,11 @@
<h1>Notifications</h1> <div class="row">
<div class="pull-left">
<h1>Notifications</h1>
</div>
<div class="pull-right">
<?= $this->tabs->render($this); ?>
</div>
</div>
<?php if (!empty($notifications)): ?> <?php if (!empty($notifications)): ?>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single">

View File

@ -1,3 +1,12 @@
<div class="row">
<div class="pull-left">
<h1>Servicegroups</h1>
</div>
<div class="pull-right">
<?= $this->tabs->render($this); ?>
</div>
</div>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single">
<?= $this->sortControl->render($this); ?> <?= $this->sortControl->render($this); ?>
<?= $this->paginationControl($servicegroups, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($servicegroups, null, null, array('preserve' => $this->preserve)); ?>

View File

@ -2,102 +2,106 @@
$viewHelper = $this->getHelper('MonitoringState'); $viewHelper = $this->getHelper('MonitoringState');
?> ?>
<?php if (empty($services)): ?> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="multi">
<div>
Sorry, no services found for this search
</div>
<?php return; endif ?>
<?= $this->paginationControl($services, null, null, array('preserve' => $this->preserve)) ?> <table class="table table-condensed pull-left">
<table class="table table-condensed">
<thead>
<tr>
<th colspan="2">Status</th>
<th>Service</th>
<th>Output</th>
<th></th>
</tr>
</thead>
<tbody> <tbody>
<?php foreach ($services as $service): ?> <?php foreach ($services as $service): ?>
<tr> <?php
<td> $serviceLink = $this->href(
<div> 'monitoring/show/service',
<?php if ($service->service_icon_image) : ?> array(
<img src="<?= $service->service_icon_image; ?>"/> 'host' => $service->host_name,
<?php endif; ?> 'service' => $service->service_description
</div> )
);
$hostLink = $this->href(
'monitoring/show/host',
array(
'host' => $service->host_name,
)
);
$serviceStateName = strtolower($this->util()->getServiceStateName($service->service_state));
?>
<tr <?= ($this->activeRowHref === $serviceLink) ? 'class="active"' : ''; ?>>
<!-- Color column -->
<td class="tacheader-status-<?= $serviceStateName; ?>">
<a style="visibility:hidden" href="<?= $serviceLink; ?>"></a>
</td> </td>
<td> <td>
<div> <a style="visibility:hidden" href="<?= $serviceLink; ?>"></a>
<?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">
<i>{{UNHANDLED_ICON}}</i> <i class="icon-table icinga-icon-unhandled"></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>{{ACKNOWLEDGED_ICON}}</i> <i class="icon-table icinga-icon-acknowledgement"></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>{{FLAPPING_ICON}}</i> <i class="icon-table icinga-icon-flapping"></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>{{NOTIFICATIONS_DISABLED_ICON}}</i> <i class="icon-table icinga-icon-notification-disabled"></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>{{IN_DOWNTIME_ICON}}</i> <i class="icon-table icinga-icon-in-downtime"></i>
</a> </a>
<?php endif; ?> <?php endif; ?>
</div> <?php if (!$service->service_active_checks_enabled): ?>
</td> <?php if (!$service->service_passive_checks_enabled): ?>
<td title="<?= $viewHelper->getStateTitle($service, 'service'); ?>"> <a href="#" title="Active And Passive Checks Disabled">
<div> <i class="icon-table icinga-icon-active-passive-checks-disabled"></i>
<?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b> </a>
<div> Since&nbsp;' <?php else: ?>
<?= $this->timeSince($service->service_last_state_change); ?> <a href="#" title="Active Checks Disabled">
<?php if ($service->service_state_type == 0): ?> <i class="icon-table icinga-icon-active-checks-disabled"></i>
<a href="#" title="<?= 'Soft state' ?>">
<i>{{SOFTSTATE_ICON}}</i>
</a> </a>
<?php endif; ?> <?php endif; ?>
</div> <?php endif; ?>
</div>
</td>
<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>{{COMMENT_ICON}}</i> <i class="icon-table icinga-icon-comment"></i>
</a> </a>
<?php endif; ?> <?php endif; ?>
<b> <?= $service->service_display_name; ?></b>
<br/>
<?= $service->host_name; ?>
<?php if ($service->service_action_url != ""): ?>
<a href="<?= $service->service_action_url; ?>">Action</a>
<?php endif; ?>
<?php if ($service->service_notes_url != ""): ?>
<a href="<?= $service->service_notes_url; ?>">Notes</a>
<?php endif; ?>
</td> </td>
<td>
<td title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
<strong><?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></strong><br />
<div class="small-row">
Since <?= $this->timeSince($service->service_last_state_change); ?>
<?php if ($service->service_state): ?>
<br />
<strong>Attempt:</strong>
<?= $service->service_attempt; ?>
(<?= ($service->service_state_type === '1') ? 'Hard' : 'Soft'; ?>)
<?php endif; ?>
</div>
</div>
</td>
<td title="<?= $viewHelper->getStateTitle($service, 'host'); ?>">
<div class="output-text">
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?> <?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
</td> </div>
</tr> </td>
<?php endforeach; ?> </tr>
</tbody> <?php endforeach; ?>
</tbody>
</table> </table>
</div>

View File

@ -1,9 +1,14 @@
<?php <?php
$viewHelper = $this->getHelper('MonitoringState'); $viewHelper = $this->getHelper('MonitoringState');
?> ?>
<div class="row">
<?= $this->tabs->render($this); ?> <div class="pull-left">
<h1>Services Status</h1> <h1>Services Status</h1>
</div>
<div class="pull-right">
<?= $this->tabs->render($this); ?>
</div>
</div>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="multi"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="multi">
<div class="container pull-left"> <div class="container pull-left">

View File

@ -1,6 +1,6 @@
<?php <?php
$object = $this->object;
$type = (isset($object->service_description) === true) ? 'service' : 'host'; $type = $object->type === 2 ? 'service' : 'host';
/** @var Zend_View_Helper_CommandForm $cf */ /** @var Zend_View_Helper_CommandForm $cf */
$cf = $this->getHelper('CommandForm'); $cf = $this->getHelper('CommandForm');
@ -16,6 +16,7 @@
<div> <div>
<div class="panel-heading border-status-<?= $objectStateName ?>"> <div class="panel-heading border-status-<?= $objectStateName ?>">
<div class="panel-hostname"> <div class="panel-hostname">
<?= $type ; ?>
<?php if ($type === 'host'): ?> <?php if ($type === 'host'): ?>
<a title="View all services for this host" <a title="View all services for this host"
href="<?= $this->href('monitoring/list/services', array('host' => $object->host_name)); ?>"> href="<?= $this->href('monitoring/list/services', array('host' => $object->host_name)); ?>">

View File

@ -71,8 +71,13 @@ class Controller extends ActionController
return $query->paginate(); return $query->paginate();
} }
private function handleFormatRequest($query) protected function handleFormatRequest($query)
{ {
if ($this->compactView !== null && ($this->_getParam('view', false) === 'compact')) {
$this->_helper->viewRenderer($this->compactView);
}
if ($this->_getParam('format') === 'sql' if ($this->_getParam('format') === 'sql'
&& IcingaConfig::app()->global->get('environment', 'production') === 'development') { && IcingaConfig::app()->global->get('environment', 'production') === 'development') {
echo '<pre>' echo '<pre>'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 823 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 779 B

After

Width:  |  Height:  |  Size: 2.9 KiB