Merge branch 'feature/link-labels-8458'

resolves #8458
This commit is contained in:
Johannes Meyer 2015-02-24 11:35:56 +01:00
commit decab543b0
80 changed files with 2191 additions and 1350 deletions

View File

@ -39,28 +39,34 @@ class ConfigController extends ActionController
$allowedActions = array(); $allowedActions = array();
if ($auth->hasPermission('system/config/application')) { if ($auth->hasPermission('system/config/application')) {
$tabs->add('application', array( $tabs->add('application', array(
'title' => $this->translate('Application'), 'title' => $this->translate('Adjust the general configuration of Icinga Web 2'),
'label' => $this->translate('Application'),
'url' => 'config/application' 'url' => 'config/application'
)); ));
$allowedActions[] = 'application'; $allowedActions[] = 'application';
} }
if ($auth->hasPermission('system/config/authentication')) { if ($auth->hasPermission('system/config/authentication')) {
$tabs->add('authentication', array( $tabs->add('authentication', array(
'title' => $this->translate('Authentication'), 'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'),
'label' => $this->translate('Authentication'),
'url' => 'config/authentication' 'url' => 'config/authentication'
)); ));
$allowedActions[] = 'authentication'; $allowedActions[] = 'authentication';
} }
if ($auth->hasPermission('system/config/resources')) { if ($auth->hasPermission('system/config/resources')) {
$tabs->add('resource', array( $tabs->add('resource', array(
'title' => $this->translate('Resources'), 'title' => $this->translate('Configure which resources are being utilized by Icinga Web 2'),
'label' => $this->translate('Resources'),
'url' => 'config/resource' 'url' => 'config/resource'
)); ));
$allowedActions[] = 'resource'; $allowedActions[] = 'resource';
} }
if ($auth->hasPermission('system/config/roles')) { if ($auth->hasPermission('system/config/roles')) {
$tabs->add('roles', array( $tabs->add('roles', array(
'title' => $this->translate('Roles'), 'title' => $this->translate(
'Configure roles to permit or restrict users and groups accessing Icinga Web 2'
),
'label' => $this->translate('Roles'),
'url' => 'roles' 'url' => 'roles'
)); ));
$allowedActions[] = 'roles'; $allowedActions[] = 'roles';

View File

@ -23,7 +23,7 @@ class ListController extends Controller
protected function addTitleTab($action) protected function addTitleTab($action)
{ {
$this->getTabs()->add($action, array( $this->getTabs()->add($action, array(
'title' => ucfirst($action), 'label' => ucfirst($action),
'url' => Url::fromPath( 'url' => Url::fromPath(
'list/' 'list/'
. str_replace(' ', '', $action) . str_replace(' ', '', $action)

View File

@ -25,8 +25,9 @@ class PreferenceController extends BasePreferenceController
return array( return array(
'preferences' => new Tab( 'preferences' => new Tab(
array( array(
'title' => t('Preferences'), 'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'),
'url' => Url::fromPath('/preference') 'label' => t('Preferences'),
'url' => Url::fromPath('/preference')
) )
) )
); );

View File

@ -25,24 +25,30 @@ class RolesController extends ActionController
$auth = $this->Auth(); $auth = $this->Auth();
if ($auth->hasPermission('system/config/application')) { if ($auth->hasPermission('system/config/application')) {
$tabs->add('application', array( $tabs->add('application', array(
'title' => $this->translate('Application'), 'title' => $this->translate('Adjust the general configuration of Icinga Web 2'),
'label' => $this->translate('Application'),
'url' => 'config' 'url' => 'config'
)); ));
} }
if ($auth->hasPermission('system/config/authentication')) { if ($auth->hasPermission('system/config/authentication')) {
$tabs->add('authentication', array( $tabs->add('authentication', array(
'title' => $this->translate('Authentication'), 'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'),
'label' => $this->translate('Authentication'),
'url' => 'config/authentication' 'url' => 'config/authentication'
)); ));
} }
if ($auth->hasPermission('system/config/resources')) { if ($auth->hasPermission('system/config/resources')) {
$tabs->add('resource', array( $tabs->add('resource', array(
'title' => $this->translate('Resources'), 'title' => $this->translate('Configure which resources are being utilized by Icinga Web 2'),
'label' => $this->translate('Resources'),
'url' => 'config/resource' 'url' => 'config/resource'
)); ));
} }
$tabs->add('roles', array( $tabs->add('roles', array(
'title' => $this->translate('Roles'), 'title' => $this->translate(
'Configure roles to permit or restrict users and groups accessing Icinga Web 2'
),
'label' => $this->translate('Roles'),
'url' => 'roles' 'url' => 'roles'
)); ));
$this->getTabs()->setTitle($this->translate('Role Configuration')); $this->getTabs()->setTitle($this->translate('Role Configuration'));

View File

@ -3,7 +3,7 @@
</div> </div>
<div class="content"> <div class="content">
<h1 tabindex="-1" id="application-configuration"> <h1 tabindex="-1" id="application-configuration">
<?= $this->translate('Generic Configuration'); ?> <?= $this->translate('General Configuration'); ?>
</h1> </h1>
<?php if (isset($this->messageBox)): ?> <?php if (isset($this->messageBox)): ?>
<?= $this->messageBox->render() ?> <?= $this->messageBox->render() ?>

View File

@ -22,14 +22,20 @@
<tr> <tr>
<th><?= $this->translate('State') ?></th> <th><?= $this->translate('State') ?></th>
<td><?= $state ?><?php if ($state === 'enabled'): ?> <td><?= $state ?><?php if ($state === 'enabled'): ?>
<?= $this->qlink($this->translate('disable'), 'config/moduledisable', array( <?= $this->qlink(
'name' => $module->getName() $this->translate('disable'),
)) ?> 'config/moduledisable',
array('name' => $module->getName()),
array('title' => sprintf($this->translate('Disable the %s module'), $module->getName()))
); ?>
<?php endif ?> <?php endif ?>
<?php if ($state === 'disabled'): ?> <?php if ($state === 'disabled'): ?>
<?= $this->qlink($this->translate('enable'), 'config/moduleenable', array( <?= $this->qlink(
'name' => $module->getName() $this->translate('enable'),
)) ?> 'config/moduleenable',
array('name' => $module->getName()),
array('title' => sprintf($this->translate('Enable the %s module'), $module->getName()))
); ?>
<?php endif ?> <?php endif ?>
</td> </td>
<tr> <tr>

View File

@ -11,22 +11,18 @@
<tr> <tr>
<td> <td>
<?php if ($module->enabled && $module->loaded) { <?php if ($module->enabled && $module->loaded) {
$icon = $this->icon('thumbs-up'); echo $this->icon('thumbs-up', sprintf($this->translate('Module %s is enabled'), $module->name));
$title = sprintf($this->translate('Module %s is enabled'), $module->name);
} elseif (! $module->enabled) { } elseif (! $module->enabled) {
$icon = $this->icon('thumbs-down'); echo $this->icon('thumbs-down', sprintf($this->translate('Module %s is disabled'), $module->name));
$title = sprintf($this->translate('Module %s is disabled'), $module->name);
} else { // ! $module->loaded } else { // ! $module->loaded
$icon = $this->icon('thumbs-down'); echo $this->icon('thumbs-down', sprintf($this->translate('Module %s has failed to load'), $module->name));
$title = sprintf($this->translate('Module %s has failed to load'), $module->name);
} }
echo $this->qlink( echo $this->qlink(
$icon . $this->escape($module->name), $module->name,
'config/module/', 'config/module/',
array('name' => $module->name), array('name' => $module->name),
array('title' => $title), array('title' => sprintf($this->translate('Show the overview of the %s module'), $module->name))
false
); ?> ); ?>
</td> </td>
</tr> </tr>

View File

@ -26,21 +26,25 @@
<tr> <tr>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($name), $name,
'config/editresource', 'config/editresource',
array('resource' => $name), array('resource' => $name),
array('title' => sprintf($this->translate('Edit resource %s'), $name)), array(
false 'icon' => 'edit',
'title' => sprintf($this->translate('Edit resource %s'), $name)
)
); ?> ); ?>
</td> </td>
<td> <td>
<center> <center>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'config/removeresource', 'config/removeresource',
array('resource' => $name), array('resource' => $name),
array('title' => sprintf($this->translate('Remove resource %s'), $name)), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove resource %s'), $name)
)
); ?> ); ?>
</center> </center>
</td> </td>

View File

@ -24,11 +24,13 @@
</th> </th>
<th> <th>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'dashboard/remove-pane', 'dashboard/remove-pane',
array('pane' => $pane->getName()), array('pane' => $pane->getName()),
array('title' => sprintf($this->translate('Remove pane %s'), $pane->getName())), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove pane %s'), $pane->getName())
)
); ?> ); ?>
</th> </th>
</tr> </tr>
@ -44,20 +46,30 @@
<?php if ($dashlet->getDisabled() === true) continue; ?> <?php if ($dashlet->getDisabled() === true) continue; ?>
<tr> <tr>
<td> <td>
<a href="<?= $this->href('dashboard/update-dashlet', array('pane' => $pane->getName(), 'dashlet' => $dashlet->getTitle())); ?>"> <?= $this->qlink(
<?= $dashlet->getTitle(); ?> $dashlet->getTitle(),
</a> 'dashboard/update-dashlet',
array('pane' => $pane->getName(), 'dashlet' => $dashlet->getTitle()),
array('title' => sprintf($this->translate('Edit dashlet %s'), $dashlet->getTitle()))
); ?>
</td> </td>
<td style="table-layout: fixed; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"> <td style="table-layout: fixed; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
<a href="<?= $this->href($dashlet->getUrl()); ?>"><?= $dashlet->getUrl(); ?></a> <?= $this->qlink(
$dashlet->getUrl(),
$dashlet->getUrl(),
null,
array('title' => sprintf($this->translate('Show dashlet %s'), $dashlet->getTitle()))
); ?>
</td> </td>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'dashboard/remove-dashlet', 'dashboard/remove-dashlet',
array('pane' => $pane->getName(), 'dashlet' => $dashlet->getTitle()), array('pane' => $pane->getName(), 'dashlet' => $dashlet->getTitle()),
array('title' => sprintf($this->translate('Remove dashlet %s from pane %s'), $dashlet->getTitle(), $pane->getName())), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove dashlet %s from pane %s'), $dashlet->getTitle(), $pane->getName())
)
); ?> ); ?>
</td> </td>
</tr> </tr>

View File

@ -11,20 +11,24 @@
<tr> <tr>
<td class="action"> <td class="action">
<?= $this->qlink( <?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($backendNames[$i]), $backendNames[$i],
'config/editAuthenticationBackend', 'config/editAuthenticationBackend',
array('auth_backend' => $backendNames[$i]), array('auth_backend' => $backendNames[$i]),
array('title' => sprintf($this->translate('Edit authentication backend %s'), $backendNames[$i])), array(
false 'icon' => 'edit',
'title' => sprintf($this->translate('Edit authentication backend %s'), $backendNames[$i])
)
); ?> ); ?>
</td> </td>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'config/removeAuthenticationBackend', 'config/removeAuthenticationBackend',
array('auth_backend' => $backendNames[$i]), array('auth_backend' => $backendNames[$i]),
array('title' => sprintf($this->translate('Remove authentication backend %s'), $backendNames[$i])), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove authentication backend %s'), $backendNames[$i])
)
); ?> ); ?>
</td> </td>
<td> <td>

View File

@ -6,7 +6,7 @@ if ($xAxisPaginator->count() <= 1 && $yAxisPaginator->count() <= 1) {
return; // Display this pagination only if there are multiple pages return; // Display this pagination only if there are multiple pages
} }
$fromTo = t('%s: %d to %d of %d (on the %s-axis)'); $showText = $this->translate('%s: Show %s %u to %u out of %u', 'pagination.joystick');
$xAxisPages = $xAxisPaginator->getPages('all'); $xAxisPages = $xAxisPaginator->getPages('all');
$yAxisPages = $yAxisPaginator->getPages('all'); $yAxisPages = $yAxisPaginator->getPages('all');
@ -28,16 +28,25 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
<?php if ($prevYAxisPage): ?> <?php if ($prevYAxisPage): ?>
<a target="_self" href="<?= Url::fromRequest()->overwriteParams(array( <?= $this->qlink(
'page' => $currentXAxisPage . ',' . $prevYAxisPage '',
))->getAbsoluteUrl(); ?>" title="<?= sprintf( Url::fromRequest(),
$fromTo, array(
t('Hosts'), 'page' => $currentXAxisPage . ',' . $prevYAxisPage
($prevYAxisPage - 1) * $yAxisPages->itemCountPerPage + 1, ),
$prevYAxisPage * $yAxisPages->itemCountPerPage, array(
$yAxisPages->totalItemCount, 'icon' => 'up-open',
'y' 'data-base-target' => '_self',
); ?>"><?= $this->icon('up-open'); ?></a> 'title' => sprintf(
$showText,
$this->translate('Y-Axis', 'pagination.joystick'),
$this->translate('hosts', 'pagination.joystick'),
($prevYAxisPage - 1) * $yAxisPages->itemCountPerPage + 1,
$prevYAxisPage * $yAxisPages->itemCountPerPage,
$yAxisPages->totalItemCount
)
)
); ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('up-open'); ?> <?= $this->icon('up-open'); ?>
<?php endif ?> <?php endif ?>
@ -47,16 +56,25 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<tr> <tr>
<td> <td>
<?php if ($prevXAxisPage): ?> <?php if ($prevXAxisPage): ?>
<a target="_self" href="<?= Url::fromRequest()->overwriteParams(array( <?= $this->qlink(
'page' => $prevXAxisPage . ',' . $currentYAxisPage '',
))->getAbsoluteUrl(); ?>" title="<?= sprintf( Url::fromRequest(),
$fromTo, array(
t('Services'), 'page' => $prevXAxisPage . ',' . $currentYAxisPage
($prevXAxisPage - 1) * $xAxisPages->itemCountPerPage + 1, ),
$prevXAxisPage * $xAxisPages->itemCountPerPage, array(
$xAxisPages->totalItemCount, 'icon' => 'left-open',
'x' 'data-base-target' => '_self',
); ?>"><?= $this->icon('left-open'); ?></a> 'title' => sprintf(
$showText,
$this->translate('X-Axis', 'pagination.joystick'),
$this->translate('services', 'pagination.joystick'),
($prevXAxisPage - 1) * $xAxisPages->itemCountPerPage + 1,
$prevXAxisPage * $xAxisPages->itemCountPerPage,
$xAxisPages->totalItemCount
)
)
); ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('left-open'); ?> <?= $this->icon('left-open'); ?>
<?php endif ?> <?php endif ?>
@ -64,16 +82,26 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
<?php if ($nextXAxisPage): ?> <?php if ($nextXAxisPage): ?>
<a target="_self" href="<?= Url::fromRequest()->overwriteParams(array( <?= $this->qlink(
'page' => $nextXAxisPage . ',' . $currentYAxisPage '',
))->getAbsoluteUrl(); ?>" title="<?= sprintf( Url::fromRequest(),
$fromTo, array(
t('Services'), 'page' => $nextXAxisPage . ',' . $currentYAxisPage
$currentXAxisPage * $xAxisPages->itemCountPerPage + 1, ),
$nextXAxisPage === $xAxisPages->last ? $xAxisPages->totalItemCount : $nextXAxisPage * $xAxisPages->itemCountPerPage, array(
$xAxisPages->totalItemCount, 'icon' => 'right-open',
'x' 'data-base-target' => '_self',
); ?>"><?= $this->icon('right-open'); ?></a> 'title' => sprintf(
$showText,
$this->translate('X-Axis', 'pagination.joystick'),
$this->translate('services', 'pagination.joystick'),
$currentXAxisPage * $xAxisPages->itemCountPerPage + 1,
$nextXAxisPage === $xAxisPages->last ? $xAxisPages->totalItemCount : $nextXAxisPage * $xAxisPages->itemCountPerPage,
$xAxisPages->totalItemCount
)
),
false
); ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('right-open'); ?> <?= $this->icon('right-open'); ?>
<?php endif ?> <?php endif ?>
@ -83,16 +111,25 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
<?php if ($nextYAxisPage): ?> <?php if ($nextYAxisPage): ?>
<a target="_self" href="<?= Url::fromRequest()->overwriteParams(array( <?= $this->qlink(
'page' => $currentXAxisPage . ',' . $nextYAxisPage '',
))->getAbsoluteUrl(); ?>" title="<?= sprintf( Url::fromRequest(),
$fromTo, array(
t('Hosts'), 'page' => $currentXAxisPage . ',' . $nextYAxisPage
$currentYAxisPage * $yAxisPages->itemCountPerPage + 1, ),
$nextYAxisPage === $yAxisPages->last ? $yAxisPages->totalItemCount : $nextYAxisPage * $yAxisPages->itemCountPerPage, array(
$yAxisPages->totalItemCount, 'icon' => 'down-open',
'y' 'data-base-target' => '_self',
); ?>"><?= $this->icon('down-open'); ?></a> 'title' => sprintf(
$showText,
$this->translate('Y-Axis', 'pagination.joystick'),
$this->translate('hosts', 'pagination.joystick'),
$currentYAxisPage * $yAxisPages->itemCountPerPage + 1,
$nextYAxisPage === $yAxisPages->last ? $yAxisPages->totalItemCount : $nextYAxisPage * $yAxisPages->itemCountPerPage,
$yAxisPages->totalItemCount
)
)
); ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('down-open'); ?> <?= $this->icon('down-open'); ?>
<?php endif ?> <?php endif ?>

View File

@ -13,7 +13,7 @@ if ($this->pageCount <= 1) return;
<ul class="pagination" aria-labelledby="paginationlabel" role="navigation" <ul class="pagination" aria-labelledby="paginationlabel" role="navigation"
<?php <?php
$fromto = t('Show rows %d to %d of %d'); $fromto = t('Show rows %u to %u out of %u');
$total = $this->totalItemCount; $total = $this->totalItemCount;
$limit = $this->itemCountPerPage; $limit = $this->itemCountPerPage;
$title_prev = sprintf( $title_prev = sprintf(
@ -29,9 +29,9 @@ $title_next = sprintf(
($this->current + 1) * $limit, ($this->current + 1) * $limit,
$total $total
); );
$li = ' ><li%s><span class="audible">' $li = ' ><li%1$s><span class="audible">'
. t('Page') . t('Page')
. ' </span><a href="%s" title="%s">%s</a></li . ' </span><a href="%2$s" aria-label="%3$s" title="%3$s">%4$s</a></li
'; ';
?> ?>

View File

@ -23,10 +23,12 @@
<?php foreach ($roles as $name => $role): /** @var object $role */ ?> <?php foreach ($roles as $name => $role): /** @var object $role */ ?>
<tr> <tr>
<td> <td>
<?= $this->escape($name) ?> <?= $this->qlink(
<div class="hidden"> $name,
<a href="<?= $this->url('roles/update', array('role' => $name)) ?>"></a> 'roles/update',
</div> array('role' => $name),
array('title' => sprintf($this->translate('Edit role %s'), $name))
); ?>
</td> </td>
<!-- <td>--><?//= $this->escape($role->permissions, 0, 50) ?><!--</td>--> <!-- <td>--><?//= $this->escape($role->permissions, 0, 50) ?><!--</td>-->
<!-- <td>--> <!-- <td>-->
@ -54,11 +56,13 @@
<td><?= $this->escape($role->groups) ?></td> <td><?= $this->escape($role->groups) ?></td>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'roles/remove', 'roles/remove',
array('role' => $name), array('role' => $name),
array('title' => sprintf($this->translate('Remove role %s'), $name)), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove role %s'), $name)
)
); ?> ); ?>
</td> </td>
</tr> </tr>
@ -70,7 +74,7 @@
<?= $this->translate('Create New Role'); ?> <?= $this->translate('Create New Role'); ?>
</h2> </h2>
<a data-base-target="_next" href="<?= $this->href('roles/new') ?>"> <a data-base-target="_next" href="<?= $this->href('roles/new') ?>">
<?= $this->translate('New Role') ?> <?= $this->translate('Create a New Role') ?>
</a> </a>
</div> </div>
</div> </div>

View File

@ -0,0 +1,15 @@
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Accessibility: Link Labels</title>
<meta name="description" content="Accessible links">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<a href="/monitoring/host/show?host=localhost"
title="Show detailed information about the host localhost"
aria-label="Show detailed information about the host localhost">localhost</a>
</body>
</html>

View File

@ -641,7 +641,7 @@ class Module
$tabs->add('info', array( $tabs->add('info', array(
'url' => 'config/module', 'url' => 'config/module',
'urlParams' => array('name' => $this->getName()), 'urlParams' => array('name' => $this->getName()),
'title' => 'Module: ' . $this->getName() 'label' => 'Module: ' . $this->getName()
)); ));
foreach ($this->configTabs as $name => $config) { foreach ($this->configTabs as $name => $config) {
$tabs->add($name, $config); $tabs->add($name, $config);

View File

@ -27,16 +27,24 @@ $this->addHelperFunction('url', function ($path = null, $params = null) {
return $url; return $url;
}); });
$this->addHelperFunction('qlink', function ($title, $url, $params = null, $properties = array(), $escape = true) use ($view) { $this->addHelperFunction('qlink', function ($title, $url, $params = null, $properties = null, $escape = true) use ($view) {
if (array_key_exists('title', $properties) && !array_key_exists('aria-label', $properties)) { $icon = '';
$properties['aria-label'] = $properties['title']; if ($properties) {
if (array_key_exists('title', $properties) && !array_key_exists('aria-label', $properties)) {
$properties['aria-label'] = $properties['title'];
}
if (array_key_exists('icon', $properties)) {
$icon = $view->icon($properties['icon']);
unset($properties['icon']);
}
} }
return sprintf( return sprintf(
'<a href="%s"%s>%s</a>', '<a href="%s"%s>%s</a>',
$view->url($url, $params), $view->url($url, $params),
$view->propertiesToString($properties), $view->propertiesToString($properties),
$escape ? $view->escape($title) : $title $icon . ($escape ? $view->escape($title) : $title)
); );
}); });

View File

@ -122,17 +122,18 @@ class HistoryColorGrid extends AbstractWidget {
{ {
if (array_key_exists($day, $this->data) && $this->data[$day]['value'] > 0) { if (array_key_exists($day, $this->data) && $this->data[$day]['value'] > 0) {
$entry = $this->data[$day]; $entry = $this->data[$day];
return'<a ' . return '<a ' .
'style="background-color:' . $this->calculateColor($entry['value']) . '; ' 'style="background-color: ' . $this->calculateColor($entry['value']) . ';'
. ' opacity: ' . $this->opacity . ';"' . . ' opacity: ' . $this->opacity . ';" ' .
'aria-label="' . $entry['caption'] . '" ' .
'title="' . $entry['caption'] . '" ' . 'title="' . $entry['caption'] . '" ' .
'href="' . $entry['url'] . '"' . 'href="' . $entry['url'] . '"' .
'>&nbsp;</a>';
} else {
return '<a ' .
'style="background-color:' . $this->calculateColor(0) . '; ' . ' opacity: ' . $this->opacity . ';" ' .
'title="No entries for ' . $day . '" ' .
'></a>'; '></a>';
} else {
return '<span ' .
'style="background-color: ' . $this->calculateColor(0) . '; opacity: ' . $this->opacity . ';" ' .
'title="No entries for ' . $day . '" ' .
'></span>';
} }
} }

View File

@ -211,7 +211,11 @@ class Dashboard extends AbstractWidget
$this->tabs->add( $this->tabs->add(
$key, $key,
array( array(
'title' => $pane->getTitle(), 'title' => sprintf(
t('Show %s', 'dashboard.pane.tooltip'),
$pane->getTitle()
),
'label' => $pane->getTitle(),
'url' => clone($url), 'url' => clone($url),
'urlParams' => array($this->tabParam => $key) 'urlParams' => array($this->tabParam => $key)
) )

View File

@ -51,7 +51,7 @@ class Dashlet extends UserWidget
private $template =<<<'EOD' private $template =<<<'EOD'
<div class="container" data-icinga-url="{URL}"> <div class="container" data-icinga-url="{URL}">
<h1><a href="{FULL_URL}" data-base-target="col1">{TITLE}</a></h1> <h1><a href="{FULL_URL}" aria-label="{TOOLTIP}" title="{TOOLTIP}" data-base-target="col1">{TITLE}</a></h1>
<noscript> <noscript>
<iframe <iframe
src="{IFRAME_URL}" src="{IFRAME_URL}"
@ -187,8 +187,8 @@ EOD;
'{URL}', '{URL}',
'{IFRAME_URL}', '{IFRAME_URL}',
'{FULL_URL}', '{FULL_URL}',
'{TOOLTIP}',
'{TITLE}', '{TITLE}',
'{REMOVE}',
'{TITLE_PREFIX}' '{TITLE_PREFIX}'
); );
@ -196,32 +196,14 @@ EOD;
$url, $url,
$iframeUrl, $iframeUrl,
$url->getUrlWithout(array('view', 'limit')), $url->getUrlWithout(array('view', 'limit')),
sprintf($view->translate('Show %s', 'dashboard.dashlet.tooltip'), $view->escape($this->getTitle())),
$view->escape($this->getTitle()), $view->escape($this->getTitle()),
$this->getRemoveLink(), $view->translate('Dashlet') . ': '
t('Dashlet') . ': '
); );
return str_replace($searchTokens, $replaceTokens, $this->template); return str_replace($searchTokens, $replaceTokens, $this->template);
} }
/**
* Render the form for removing a dashboard elemetn
*
* @return string The html representation of the form
*/
protected function getRemoveLink()
{
return sprintf(
'<a data-base-target="main" href="%s">%s</a>',
Url::fromPath('dashboard/remove-dashlet', array(
'dashlet' => $this->getTitle(),
'pane' => $this->pane->getTitle()
)),
t('Remove')
);
}
/** /**
* Create a @see Dashlet instance from the given Zend config, using the provided title * Create a @see Dashlet instance from the given Zend config, using the provided title
* *

View File

@ -310,8 +310,8 @@ class FilterEditor extends AbstractWidget
$this->preservedUrl()->with('removeFilter', $filter->getId()), $this->preservedUrl()->with('removeFilter', $filter->getId()),
null, null,
array( array(
'title' => t('Click to remove this part of your filter'), 'icon' => 'icon-cancel',
'class' => 'icon-cancel' 'title' => t('Remove this part of your filter')
) )
); );
} }
@ -323,8 +323,8 @@ class FilterEditor extends AbstractWidget
$this->preservedUrl()->with('addFilter', $filter->getId()), $this->preservedUrl()->with('addFilter', $filter->getId()),
null, null,
array( array(
'title' => t('Click to add another filter'), 'icon' => 'icon-plus',
'class' => 'icon-plus' 'title' => t('Add another filter')
) )
); );
} }
@ -336,8 +336,8 @@ class FilterEditor extends AbstractWidget
$this->preservedUrl()->with('stripFilter', $filter->getId()), $this->preservedUrl()->with('stripFilter', $filter->getId()),
null, null,
array( array(
'title' => t('Strip this filter'), 'icon' => 'icon-minus',
'class' => 'icon-minus' 'title' => t('Strip this filter')
) )
); );
} }
@ -349,8 +349,8 @@ class FilterEditor extends AbstractWidget
$this->preservedUrl()->without('addFilter'), $this->preservedUrl()->without('addFilter'),
null, null,
array( array(
'title' => t('Cancel this operation'), 'icon' => 'icon-cancel',
'class' => 'icon-cancel' 'title' => t('Cancel this operation')
) )
); );
} }
@ -666,6 +666,8 @@ class FilterEditor extends AbstractWidget
return $html return $html
. '<a href="' . '<a href="'
. $this->preservedUrl()->with('modifyFilter', true) . $this->preservedUrl()->with('modifyFilter', true)
. '" aria-label="'
. $title
. '" title="' . '" title="'
. $title . $title
. '">' . '">'

View File

@ -80,7 +80,7 @@ class Limiter extends AbstractWidget
$this->url->setParam('limit', $limit), $this->url->setParam('limit', $limit),
null, null,
array( array(
'title' => sprintf(t('Show %s rows on one page'), $caption) 'title' => sprintf($view->translate('Limit each page to a maximum of %u rows'), $caption)
) )
); );
} }

View File

@ -42,6 +42,8 @@ class Tab extends AbstractWidget
*/ */
private $title = ''; private $title = '';
private $label = '';
/** /**
* The Url this tab points to * The Url this tab points to
* *
@ -116,6 +118,11 @@ class Tab extends AbstractWidget
return $this->name; return $this->name;
} }
public function setLabel($label)
{
$this->label = $label;
}
/** /**
* @param mixed $title * @param mixed $title
*/ */
@ -210,9 +217,22 @@ class Tab extends AbstractWidget
if ($this->active) { if ($this->active) {
$classes[] = 'active'; $classes[] = 'active';
} }
$caption = $view->escape($this->title);
$caption = $view->escape($this->label);
$tagParams = $this->tagParams; $tagParams = $this->tagParams;
if ($this->title) {
if ($tagParams !== null) {
$tagParams['title'] = $this->title;
$tagParams['aria-label'] = $this->title;
} else {
$tagParams = array(
'title' => $this->title,
'aria-label' => $this->title
);
}
}
if ($this->icon !== null) { if ($this->icon !== null) {
if (strpos($this->icon, '.') === false) { if (strpos($this->icon, '.') === false) {
$caption = $view->icon($this->icon) . $caption; $caption = $view->icon($this->icon) . $caption;
@ -220,13 +240,16 @@ class Tab extends AbstractWidget
$caption = $view->img($this->icon, null, array('class' => 'icon')) . $caption; $caption = $view->img($this->icon, null, array('class' => 'icon')) . $caption;
} }
} }
if ($this->url !== null) { if ($this->url !== null) {
$this->url->overwriteParams($this->urlParams); $this->url->overwriteParams($this->urlParams);
if ($tagParams !== null) { if ($tagParams !== null) {
$params = $view->propertiesToString($tagParams); $params = $view->propertiesToString($tagParams);
} else { } else {
$params = ''; $params = '';
} }
$tab = sprintf( $tab = sprintf(
'<a href="%s"%s>%s</a>', '<a href="%s"%s>%s</a>',
$this->url, $this->url,
@ -236,6 +259,7 @@ class Tab extends AbstractWidget
} else { } else {
$tab = $caption; $tab = $caption;
} }
$class = empty($classes) ? '' : sprintf(' class="%s"', implode(' ', $classes)); $class = empty($classes) ? '' : sprintf(' class="%s"', implode(' ', $classes));
return '<li ' . $class . '>' . $tab . "</li>\n"; return '<li ' . $class . '>' . $tab . "</li>\n";
} }

View File

@ -24,7 +24,7 @@ class DashboardAction implements Tabextension
'dashboard', 'dashboard',
array( array(
'icon' => 'dashboard', 'icon' => 'dashboard',
'title' => 'Add To Dashboard', 'label' => 'Add To Dashboard',
'url' => Url::fromPath('dashboard/new-dashlet'), 'url' => Url::fromPath('dashboard/new-dashlet'),
'urlParams' => array( 'urlParams' => array(
'url' => rawurlencode(Url::fromRequest()->getRelativeUrl()) 'url' => rawurlencode(Url::fromRequest()->getRelativeUrl())

View File

@ -22,7 +22,7 @@ class DashboardSettings implements Tabextension
'dashboard_add', 'dashboard_add',
array( array(
'icon' => 'img/icons/dashboard.png', 'icon' => 'img/icons/dashboard.png',
'title' => t('Add To Dashboard'), 'label' => t('Add To Dashboard'),
'url' => Url::fromPath('dashboard/new-dashlet') 'url' => Url::fromPath('dashboard/new-dashlet')
) )
); );
@ -30,9 +30,9 @@ class DashboardSettings implements Tabextension
$tabs->addAsDropdown( $tabs->addAsDropdown(
'dashboard_settings', 'dashboard_settings',
array( array(
'icon' => 'img/icons/dashboard.png', 'icon' => 'img/icons/dashboard.png',
'title' => t('Settings'), 'label' => t('Settings'),
'url' => Url::fromPath('dashboard/settings') 'url' => Url::fromPath('dashboard/settings')
) )
); );
} }

View File

@ -85,7 +85,7 @@ class OutputFormat implements Tabextension
if (Platform::extensionLoaded('gd')) { if (Platform::extensionLoaded('gd')) {
$supportedTypes[self::TYPE_PDF] = array( $supportedTypes[self::TYPE_PDF] = array(
'name' => 'pdf', 'name' => 'pdf',
'title' => 'PDF', 'label' => 'PDF',
'icon' => 'file-pdf', 'icon' => 'file-pdf',
'urlParams' => array('format' => 'pdf'), 'urlParams' => array('format' => 'pdf'),
); );
@ -93,7 +93,7 @@ class OutputFormat implements Tabextension
$supportedTypes[self::TYPE_CSV] = array( $supportedTypes[self::TYPE_CSV] = array(
'name' => 'csv', 'name' => 'csv',
'title' => 'CSV', 'label' => 'CSV',
'icon' => 'file-excel', 'icon' => 'file-excel',
'urlParams' => array('format' => 'csv') 'urlParams' => array('format' => 'csv')
); );
@ -101,7 +101,7 @@ class OutputFormat implements Tabextension
if (Platform::extensionLoaded('json')) { if (Platform::extensionLoaded('json')) {
$supportedTypes[self::TYPE_JSON] = array( $supportedTypes[self::TYPE_JSON] = array(
'name' => 'json', 'name' => 'json',
'title' => 'JSON', 'label' => 'JSON',
'icon' => 'img/icons/json.png', 'icon' => 'img/icons/json.png',
'urlParams' => array('format' => 'json') 'urlParams' => array('format' => 'json')
); );

View File

@ -49,10 +49,10 @@ class Doc_ModuleController extends DocController
{ {
$moduleManager = Icinga::app()->getModuleManager(); $moduleManager = Icinga::app()->getModuleManager();
$modules = array(); $modules = array();
foreach (Icinga::app()->getModuleManager()->listEnabledModules() as $module) { foreach ($moduleManager->listEnabledModules() as $module) {
$path = $this->getPath($module, $moduleManager->getModuleDir($module, '/doc'), true); $path = $this->getPath($module, $moduleManager->getModuleDir($module, '/doc'), true);
if ($path !== null) { if ($path !== null) {
$modules[] = $module; $modules[] = $moduleManager->getModule($module);
} }
} }
$this->view->modules = $modules; $this->view->modules = $modules;

View File

@ -1,9 +1,19 @@
<div class="controls"></div> <div class="controls"></div>
<?= /** @type \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton() ?> <?= /** @type \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton(); ?>
<h1><?= $this->translate('Available documentations') ?></h1> <h1><?= $this->translate('Available documentations'); ?></h1>
<div class="content"> <div class="content">
<ul> <ul>
<li><a href="<?= $this->href('doc/icingaweb/toc') ?>">Icinga Web 2</a></li> <li><?= $this->qlink(
<li><a href="<?= $this->href('doc/module/') ?>"><?= $this->translate('Module documentations') ?></a></li> 'Icinga Web 2',
'doc/icingaweb/toc',
null,
array('title' => $this->translate('Show the documentation\'s table of contents for Icinga Web 2'))
); ?></li>
<li><?= $this->qlink(
$this->translate('Module documentations'),
'doc/module/',
null,
array('title' => $this->translate('List all modifications for which documentation is available'))
); ?></li>
</ul> </ul>
</div> </div>

View File

@ -1,15 +1,19 @@
<div class="controls"> <div class="controls">
<?= /** @type \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton() ?> <?= /** @type \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton(); ?>
<h1><?= $this->translate('Module documentations') ?></h1> <h1><?= $this->translate('Module documentations'); ?></h1>
</div> </div>
<div class="content"> <div class="content">
<ul> <ul>
<?php foreach ($modules as $module): ?> <?php foreach ($modules as $module): ?>
<li> <li><?= $this->qlink(
<a href="<?= $this->getHelper('Url')->url(array('moduleName' => $module), 'doc/module/toc', false, false) ?>"> $module->getTitle(),
<?= $module ?> 'doc/module/toc',
</a> array('moduleName' => $module->getName()),
</li> array('title' => sprintf(
<?php endforeach ?> $this->translate('Show the documentation\'s table of contents for the %s'),
$module->getTitle()
))
); ?></li>
<?php endforeach ?>
</ul> </ul>
</div> </div>

View File

@ -107,11 +107,30 @@ class DocSearchRenderer extends DocRenderer
); );
/** @type \Icinga\Web\Url $url */ /** @type \Icinga\Web\Url $url */
$url->setAnchor($this->encodeAnchor($section->getId())); $url->setAnchor($this->encodeAnchor($section->getId()));
$this->content[] = sprintf( $urlAttributes = array(
'<li><a data-base-target="_next" %shref="%s">%s</a>', 'data-base-target' => '_next',
$section->getNoFollow() ? 'rel="nofollow" ' : '', 'title' => sprintf(
$this->getView()->translate(
'Show all matches of "%s" in %sthe chapter "%s"',
'search.render.section.link'
),
$this->getInnerIterator()->getSearch()->getInput(),
$section->getId() !== $section->getChapter()->getId() ? sprintf(
$this->getView()->translate('the section "%s" of ', 'search.render.section.link'),
$section->getTitle()
) : '',
$section->getChapter()->getTitle()
)
);
if ($section->getNoFollow()) {
$urlAttributes['rel'] = 'nofollow';
}
$this->content[] = '<li>' . $this->getView()->qlink(
$title,
$url->getAbsoluteUrl(), $url->getAbsoluteUrl(),
$title null,
$urlAttributes,
false
); );
if (! empty($contentMatches)) { if (! empty($contentMatches)) {
$this->content = array_merge($this->content, $contentMatches); $this->content = array_merge($this->content, $contentMatches);

View File

@ -87,11 +87,25 @@ class DocTocRenderer extends DocRenderer
$url = $view->url($path); $url = $view->url($path);
/** @type \Icinga\Web\Url $url */ /** @type \Icinga\Web\Url $url */
$url->setAnchor($this->encodeAnchor($section->getId())); $url->setAnchor($this->encodeAnchor($section->getId()));
$this->content[] = sprintf( $urlAttributes = array(
'<li><a data-base-target="_next" %shref="%s">%s</a>', 'data-base-target' => '_next',
$section->getNoFollow() ? 'rel="nofollow" ' : '', 'title' => sprintf(
$this->getView()->translate('Show the %schapter "%s"', 'toc.render.section.link'),
$section->getId() !== $section->getChapter()->getId() ? sprintf(
$this->getView()->translate('section "%s" of the ', 'toc.render.section.link'),
$section->getTitle()
) : '',
$section->getChapter()->getTitle()
)
);
if ($section->getNoFollow()) {
$urlAttributes['rel'] = 'nofollow';
}
$this->content[] = '<li>' . $this->getView()->qlink(
$section->getTitle(),
$url->getAbsoluteUrl(), $url->getAbsoluteUrl(),
$view->escape($section->getTitle()) null,
$urlAttributes
); );
if (! $section->hasChildren()) { if (! $section->hasChildren()) {
$this->content[] = '</li>'; $this->content[] = '</li>';

View File

@ -10,11 +10,6 @@ use Icinga\Web\Url;
class Monitoring_AlertsummaryController extends Controller class Monitoring_AlertsummaryController extends Controller
{ {
/**
* @var string
*/
protected $url;
/** /**
* @var array * @var array
*/ */
@ -30,42 +25,28 @@ class Monitoring_AlertsummaryController extends Controller
*/ */
public function init() public function init()
{ {
$tabs = $this->getTabs();
if (in_array($this->_request->getActionName(), array('alertsummary'))) {
$tabs->extend(new OutputFormat())->extend(new DashboardAction());
}
$this->url = Url::fromRequest();
$this->notificationData = $this->createNotificationData(); $this->notificationData = $this->createNotificationData();
$this->problemData = $this->createProblemData(); $this->problemData = $this->createProblemData();
$tabs->setTitle($this->translate('Alertsummary Navigation'));
} }
/** /**
* @param string $action * Create full report
* @param bool $title
*/
protected function addTitleTab($action, $title = false)
{
$title = $title ?: ucfirst($action);
$this->getTabs()->add(
$action,
array(
'title' => $title,
'url' => $this->url
)
)->activate($action);
$this->view->title = $title;
}
/**
* Creat full report
*/ */
public function indexAction() public function indexAction()
{ {
$this->addTitleTab('alertsummary', $this->translate('Alert Summary')); $this->getTabs()->add(
'alertsummary',
array(
'title' => $this->translate(
'Show recent alerts and visualize notifications and problems'
. ' based on their amount and chronological distribution'
),
'label' => $this->translate('Alert Summary'),
'url' => Url::fromRequest()
)
)->activate('alertsummary')->setTitle($this->translate('Alertsummary Navigation'));
$this->view->title = $this->translate('Alert Summary');
$this->view->intervalBox = $this->createIntervalBox(); $this->view->intervalBox = $this->createIntervalBox();
$this->view->recentAlerts = $this->createRecentAlerts(); $this->view->recentAlerts = $this->createRecentAlerts();
$this->view->interval = $this->getInterval(); $this->view->interval = $this->getInterval();

View File

@ -72,8 +72,12 @@ class Monitoring_HostsController extends Controller
$this->getTabs()->add( $this->getTabs()->add(
'show', 'show',
array( array(
'title' => mt('monitoring', 'Hosts'), 'title' => sprintf(
'url' => Url::fromRequest() $this->translate('Show summarized information for %u hosts'),
count($this->hostList)
),
'label' => $this->translate('Hosts'),
'url' => Url::fromRequest()
) )
)->activate('show'); )->activate('show');
$this->setAutorefreshInterval(15); $this->setAutorefreshInterval(15);

View File

@ -6,7 +6,6 @@ use Icinga\Module\Monitoring\Backend;
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm; use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm; use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Web\Hook;
use Icinga\Web\Widget\Tabextension\DashboardAction; use Icinga\Web\Widget\Tabextension\DashboardAction;
use Icinga\Web\Widget\Tabextension\OutputFormat; use Icinga\Web\Widget\Tabextension\OutputFormat;
use Icinga\Web\Widget\Tabs; use Icinga\Web\Widget\Tabs;
@ -17,11 +16,7 @@ use Icinga\Module\Monitoring\Forms\StatehistoryForm;
class Monitoring_ListController extends Controller class Monitoring_ListController extends Controller
{ {
protected $url;
/** /**
* Retrieve backend and hooks for this controller
*
* @see ActionController::init * @see ActionController::init
*/ */
public function init() public function init()
@ -32,7 +27,6 @@ class Monitoring_ListController extends Controller
$this->view->compact = true; $this->view->compact = true;
$this->view->inline = true; $this->view->inline = true;
} }
$this->url = Url::fromRequest();
} }
/** /**
@ -56,7 +50,7 @@ class Monitoring_ListController extends Controller
protected function hasBetterUrl() protected function hasBetterUrl()
{ {
$request = $this->getRequest(); $request = $this->getRequest();
$url = clone($this->url); $url = Url::fromRequest();
if ($this->getRequest()->isPost()) { if ($this->getRequest()->isPost()) {
if ($request->getPost('sort')) { if ($request->getPost('sort')) {
@ -100,7 +94,7 @@ class Monitoring_ListController extends Controller
$stateChangeColumn = 'host_last_state_change'; $stateChangeColumn = 'host_last_state_change';
} }
$this->addTitleTab('hosts', $this->translate('Hosts')); $this->addTitleTab('hosts', $this->translate('Hosts'), $this->translate('List hosts'));
$this->setAutorefreshInterval(10); $this->setAutorefreshInterval(10);
$query = $this->backend->select()->from('hostStatus', array_merge(array( $query = $this->backend->select()->from('hostStatus', array_merge(array(
'host_icon_image', 'host_icon_image',
@ -174,7 +168,7 @@ class Monitoring_ListController extends Controller
$stateChangeColumn = 'service_last_state_change'; $stateChangeColumn = 'service_last_state_change';
} }
$this->addTitleTab('services', $this->translate('Services')); $this->addTitleTab('services', $this->translate('Services'), $this->translate('List services'));
$this->view->showHost = true; $this->view->showHost = true;
if ($host = $this->_getParam('host')) { if ($host = $this->_getParam('host')) {
if (strpos($host, '*') === false) { if (strpos($host, '*') === false) {
@ -272,7 +266,7 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('downtimes', $this->translate('Downtimes')); $this->addTitleTab('downtimes', $this->translate('Downtimes'), $this->translate('List downtimes'));
$this->setAutorefreshInterval(12); $this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('downtime', array( $query = $this->backend->select()->from('downtime', array(
'id' => 'downtime_internal_id', 'id' => 'downtime_internal_id',
@ -326,7 +320,11 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('notifications', $this->translate('Notifications')); $this->addTitleTab(
'notifications',
$this->translate('Notifications'),
$this->translate('List notifications')
);
$this->setAutorefreshInterval(15); $this->setAutorefreshInterval(15);
$query = $this->backend->select()->from('notification', array( $query = $this->backend->select()->from('notification', array(
'host', 'host',
@ -350,7 +348,7 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('contacts', $this->translate('Contacts')); $this->addTitleTab('contacts', $this->translate('Contacts'), $this->translate('List contacts'));
$query = $this->backend->select()->from('contact', array( $query = $this->backend->select()->from('contact', array(
'contact_name', 'contact_name',
'contact_id', 'contact_id',
@ -389,7 +387,7 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('eventgrid', $this->translate('Event Grid')); $this->addTitleTab('eventgrid', $this->translate('Event Grid'), $this->translate('Show the Event Grid'));
$form = new StatehistoryForm(); $form = new StatehistoryForm();
$form->setEnctype(Zend_Form::ENCTYPE_URLENCODED); $form->setEnctype(Zend_Form::ENCTYPE_URLENCODED);
@ -430,7 +428,11 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('contactgroups', $this->translate('Contact Groups')); $this->addTitleTab(
'contactgroups',
$this->translate('Contact Groups'),
$this->translate('List contact groups')
);
$query = $this->backend->select()->from('contactgroup', array( $query = $this->backend->select()->from('contactgroup', array(
'contactgroup_name', 'contactgroup_name',
'contactgroup_alias', 'contactgroup_alias',
@ -462,7 +464,7 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('comments', $this->translate('Comments')); $this->addTitleTab('comments', $this->translate('Comments'), $this->translate('List comments'));
$this->setAutorefreshInterval(12); $this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('comment', array( $query = $this->backend->select()->from('comment', array(
'id' => 'comment_internal_id', 'id' => 'comment_internal_id',
@ -501,7 +503,11 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('servicegroups', $this->translate('Service Groups')); $this->addTitleTab(
'servicegroups',
$this->translate('Service Groups'),
$this->translate('List service groups')
);
$this->setAutorefreshInterval(12); $this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('groupsummary', array( $query = $this->backend->select()->from('groupsummary', array(
'servicegroup', 'servicegroup',
@ -551,7 +557,7 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('hostgroups', $this->translate('Host Groups')); $this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups'));
$this->setAutorefreshInterval(12); $this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('groupsummary', array( $query = $this->backend->select()->from('groupsummary', array(
'hostgroup', 'hostgroup',
@ -601,7 +607,11 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('eventhistory', $this->translate('Event Overview')); $this->addTitleTab(
'eventhistory',
$this->translate('Event Overview'),
$this->translate('List event records')
);
$query = $this->backend->select()->from('eventHistory', array( $query = $this->backend->select()->from('eventHistory', array(
'host_name', 'host_name',
@ -632,7 +642,7 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('servicegrid', $this->translate('Service Grid')); $this->addTitleTab('servicegrid', $this->translate('Service Grid'), $this->translate('Show the Service Grid'));
$this->setAutorefreshInterval(15); $this->setAutorefreshInterval(15);
$query = $this->backend->select()->from('serviceStatus', array( $query = $this->backend->select()->from('serviceStatus', array(
'host_name', 'host_name',
@ -698,13 +708,12 @@ class Monitoring_ListController extends Controller
$this->view->sortControl->applyRequest($this->getRequest()); $this->view->sortControl->applyRequest($this->getRequest());
} }
protected function addTitleTab($action, $title = false) protected function addTitleTab($action, $title, $tip)
{ {
$title = $title ?: ucfirst($action);
$this->getTabs()->add($action, array( $this->getTabs()->add($action, array(
'title' => $title, 'title' => $tip,
// 'url' => Url::fromPath('monitoring/list/' . $action) 'label' => $title,
'url' => $this->url 'url' => Url::fromRequest()
))->activate($action); ))->activate($action);
$this->view->title = $title; $this->view->title = $title;
} }

View File

@ -22,7 +22,11 @@ class Monitoring_ProcessController extends Controller
->add( ->add(
'info', 'info',
array( array(
'title' => $this->translate('Monitoring Health'), 'title' => $this->translate(
'Show information about the current monitoring instance\'s process'
. ' and it\'s performance as well as available features'
),
'label' => $this->translate('Monitoring Health'),
'url' =>'monitoring/process/info' 'url' =>'monitoring/process/info'
) )
)->setTitle($this->translate('Process Information')); )->setTitle($this->translate('Process Information'));

View File

@ -93,8 +93,12 @@ class Monitoring_ServicesController extends Controller
$this->getTabs()->add( $this->getTabs()->add(
'show', 'show',
array( array(
'title' => mt('monitoring', 'Services'), 'title' => sprintf(
'url' => Url::fromRequest() $this->translate('Show summarized information for %u services'),
count($this->serviceList)
),
'label' => $this->translate('Services'),
'url' => Url::fromRequest()
) )
)->activate('show'); )->activate('show');
$this->setAutorefreshInterval(15); $this->setAutorefreshInterval(15);

View File

@ -189,10 +189,12 @@ class Monitoring_ShowController extends Controller
return; return;
} }
if ($object->getType() === $object::TYPE_HOST) { if ($object->getType() === $object::TYPE_HOST) {
$isService = false;
$params = array( $params = array(
'host' => $object->getName() 'host' => $object->getName()
); );
} else { } else {
$isService = true;
$params = array( $params = array(
'host' => $object->getHost()->getName(), 'host' => $object->getHost()->getName(),
'service' => $object->getName() 'service' => $object->getName()
@ -202,17 +204,26 @@ class Monitoring_ShowController extends Controller
$tabs->add( $tabs->add(
'host', 'host',
array( array(
'title' => $this->translate('Host'), 'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$isService ? $object->getHost()->getName() : $object->getName()
),
'label' => $this->translate('Host'),
'icon' => 'host', 'icon' => 'host',
'url' => 'monitoring/show/host', 'url' => 'monitoring/show/host',
'urlParams' => $params, 'urlParams' => $params,
) )
); );
if (isset($params['service'])) { if ($isService) {
$tabs->add( $tabs->add(
'service', 'service',
array( array(
'title' => $this->translate('Service'), 'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$object->getName(),
$object->getHost()->getName()
),
'label' => $this->translate('Service'),
'icon' => 'service', 'icon' => 'service',
'url' => 'monitoring/show/service', 'url' => 'monitoring/show/service',
'urlParams' => $params, 'urlParams' => $params,
@ -222,7 +233,11 @@ class Monitoring_ShowController extends Controller
$tabs->add( $tabs->add(
'services', 'services',
array( array(
'title' => $this->translate('Services'), 'title' => sprintf(
$this->translate('List all services on host %s'),
$isService ? $object->getHost()->getName() : $object->getName()
),
'label' => $this->translate('Services'),
'icon' => 'services', 'icon' => 'services',
'url' => 'monitoring/show/services', 'url' => 'monitoring/show/services',
'urlParams' => $params, 'urlParams' => $params,
@ -232,7 +247,15 @@ class Monitoring_ShowController extends Controller
$tabs->add( $tabs->add(
'history', 'history',
array( array(
'title' => $this->translate('History'), 'title' => $isService
? sprintf(
$this->translate('Show all event records of service %s on host %s'),
$object->getName(),
$object->getHost()->getName()
)
: sprintf($this->translate('Show all event records of host %s'), $object->getName())
,
'label' => $this->translate('History'),
'icon' => 'rewind', 'icon' => 'rewind',
'url' => 'monitoring/show/history', 'url' => 'monitoring/show/history',
'urlParams' => $params, 'urlParams' => $params,

View File

@ -11,7 +11,11 @@ class Monitoring_TacticalController extends MonitoringController
$this->getTabs()->add( $this->getTabs()->add(
'tactical_overview', 'tactical_overview',
array( array(
'title' => $this->translate('Tactical Overview'), 'title' => $this->translate(
'Show an overview of all hosts and services, their current'
. ' states and monitoring feature utilisation'
),
'label' => $this->translate('Tactical Overview'),
'url' => Url::fromRequest() 'url' => Url::fromRequest()
) )
)->activate('tactical_overview'); )->activate('tactical_overview');

View File

@ -13,20 +13,17 @@ use Icinga\Module\Monitoring\Web\Widget\SelectBox;
class Monitoring_TimelineController extends Controller class Monitoring_TimelineController extends Controller
{ {
protected function addTitleTab($action, $title = false)
{
$title = $title ? : ucfirst($action);
$this->getTabs()->add($action, array(
'title' => $title,
'url' => Url::fromRequest()
))->activate($action)
->setTitle($this->translate('Timeline Navigation'));
$this->view->title = $title;
}
public function indexAction() public function indexAction()
{ {
$this->addTitleTab('index', t('Timeline')); $this->getTabs()->add(
'timeline',
array(
'title' => $this->translate('Show the number of historical event records grouped by time and type'),
'label' => $this->translate('Timeline'),
'url' => Url::fromRequest()
)
)->activate('timeline')->setTitle($this->translate('Timeline Navigation'));
$this->view->title = $this->translate('Timeline');
// TODO: filter for hard_states (precedence adjustments necessary!) // TODO: filter for hard_states (precedence adjustments necessary!)
$this->setupIntervalBox(); $this->setupIntervalBox();
@ -144,7 +141,7 @@ class Monitoring_TimelineController extends Controller
case '1d': case '1d':
return $this->getDateFormat(); return $this->getDateFormat();
case '1w': case '1w':
return '\W\e\ek #W\<b\r\>\of Y'; return '\W\e\ek W\<b\r\>\of Y';
case '1m': case '1m':
return 'F Y'; return 'F Y';
case '1y': case '1y':

View File

@ -60,7 +60,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
if ((bool) $this->status->notifications_enabled) { if ((bool) $this->status->notifications_enabled) {
if ($this->hasPermission('monitoring/command/feature/instance')) { if ($this->hasPermission('monitoring/command/feature/instance')) {
$notificationDescription = sprintf( $notificationDescription = sprintf(
'<a title="%s" href="%s" data-base-target="_next">%s</a>', '<a aria-label="%1$s" title="%1$s" href="%2$s" data-base-target="_next">%3$s</a>',
$this->translate('Disable notifications for a specific time on a program-wide basis'), $this->translate('Disable notifications for a specific time on a program-wide basis'),
$this->getView()->href('monitoring/process/disable-notifications'), $this->getView()->href('monitoring/process/disable-notifications'),
$this->translate('Disable temporarily') $this->translate('Disable temporarily')

View File

@ -39,7 +39,8 @@ class CheckNowCommandForm extends ObjectsCommandForm
. $this->translate('Check now'), . $this->translate('Check now'),
'decorators' => array('ViewHelper'), 'decorators' => array('ViewHelper'),
'escape' => false, 'escape' => false,
'class' => 'link-like' 'class' => 'link-like',
'title' => $this->translate('Schedule the next active check to run immediately')
) )
) )
)); ));

View File

@ -54,7 +54,7 @@ class DeleteCommentCommandForm extends ObjectsCommandForm
array( array(
'ignore' => true, 'ignore' => true,
'label' => 'X', 'label' => 'X',
'title' => $this->translate('Delete comment'), 'title' => $this->translate('Delete this comment'),
'decorators' => array('ViewHelper') 'decorators' => array('ViewHelper')
) )
); );

View File

@ -54,7 +54,7 @@ class DeleteDowntimeCommandForm extends ObjectsCommandForm
array( array(
'ignore' => true, 'ignore' => true,
'label' => 'X', 'label' => 'X',
'title' => $this->translate('Delete downtime'), 'title' => $this->translate('Delete this downtime'),
'decorators' => array('ViewHelper') 'decorators' => array('ViewHelper')
) )
); );

View File

@ -230,7 +230,9 @@ class BackendConfigForm extends ConfigForm
) )
); );
$resourceElement = $this->createElement( $decorators = static::$defaultElementDecorators;
array_pop($decorators); // Removes the HtmlTag decorator
$this->addElement(
'select', 'select',
'resource', 'resource',
array( array(
@ -238,32 +240,35 @@ class BackendConfigForm extends ConfigForm
'label' => $this->translate('Resource'), 'label' => $this->translate('Resource'),
'description' => $this->translate('The resource to use'), 'description' => $this->translate('The resource to use'),
'multiOptions' => $this->resources[$resourceType], 'multiOptions' => $this->resources[$resourceType],
'value' => current($this->resources[$resourceType]),
'decorators' => $decorators,
'autosubmit' => true 'autosubmit' => true
) )
); );
$resourceName = isset($formData['resource']) ? $formData['resource'] : $this->getValue('resource');
if (empty($formData)) { $this->addElement(
$options = $resourceElement->options; 'note',
$resourceName = array_shift($options); 'resource_note',
} else { array(
$resourceName = (isset($formData['resource'])) ? $formData['resource'] : $this->getValue('resource'); 'escape' => false,
} 'decorators' => $decorators,
'value' => sprintf(
$this->addElement($resourceElement); '<a href="%1$s" data-base-target="_next" title="%2$s" aria-label="%2$s">%3$s</a>',
$this->getView()->url('config/editresource', array('resource' => $resourceName)),
if ($resourceElement) { sprintf($this->translate('Show the configuration of the %s resource'), $resourceName),
$this->addElement( $this->translate('Show resource configuration')
'note',
'resource_note',
array(
'value' => sprintf(
'<a href="%s" data-base-target="_main">%s</a>',
$this->getView()->url('config/editresource', array('resource' => $resourceName)),
$this->translate('Show resource configuration')
),
'escape' => false
) )
); )
} );
$this->addDisplayGroup(
array('resource', 'resource_note'),
'resource-group',
array(
'decorators' => array(
'FormElements',
array('HtmlTag', array('tag' => 'div', 'class' => 'element'))
)
)
);
} }
} }

View File

@ -32,7 +32,9 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract
{ {
return $this->view->qlink( return $this->view->qlink(
$linkText, $linkText,
$this->view->href('monitoring/host/show', array('host' => $host)) 'monitoring/host/show',
array('host' => $host),
array('title' => sprintf($this->view->translate('Show detailed information for host %s'), $host))
); );
} }
@ -52,7 +54,13 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract
$this->view->translate('%s on %s', 'Service running on host'), $this->view->translate('%s on %s', 'Service running on host'),
$this->view->qlink( $this->view->qlink(
$serviceLinkText, $serviceLinkText,
$this->view->href('monitoring/service/show', array('host' => $host, 'service' => $service)) 'monitoring/service/show',
array('host' => $host, 'service' => $service),
array('title' => sprintf(
$this->view->translate('Show detailed information for service %s on host %s'),
$service,
$host
))
), ),
$this->host($host, $hostLinkText) $this->host($host, $hostLinkText)
); );

View File

@ -19,11 +19,13 @@
<tr> <tr>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($backendName), $backendName,
'/monitoring/config/editbackend', '/monitoring/config/editbackend',
array('backend' => $backendName), array('backend' => $backendName),
array('title' => sprintf($this->translate('Edit monitoring backend %s'), $backendName)), array(
false 'icon' => 'edit',
'title' => sprintf($this->translate('Edit monitoring backend %s'), $backendName)
)
); ?> ); ?>
<small>(<?= sprintf( <small>(<?= sprintf(
$this->translate('Type: %s'), $this->translate('Type: %s'),
@ -32,11 +34,13 @@
</td> </td>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'/monitoring/config/removebackend', '/monitoring/config/removebackend',
array('backend' => $backendName), array('backend' => $backendName),
array('title' => sprintf($this->translate('Remove monitoring backend %s'), $backendName)), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove monitoring backend %s'), $backendName)
)
); ?> ); ?>
</td> </td>
</tr> </tr>
@ -59,11 +63,13 @@
<tr> <tr>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($instanceName), $instanceName,
'/monitoring/config/editinstance', '/monitoring/config/editinstance',
array('instance' => $instanceName), array('instance' => $instanceName),
array('title' => sprintf($this->translate('Edit monitoring instance %s'), $instanceName)), array(
false 'icon' => 'edit',
'title' => sprintf($this->translate('Edit monitoring instance %s'), $instanceName)
)
); ?> ); ?>
<small>(<?= sprintf( <small>(<?= sprintf(
$this->translate('Type: %s'), $this->translate('Type: %s'),
@ -72,11 +78,13 @@
</td> </td>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'/monitoring/config/removeinstance', '/monitoring/config/removeinstance',
array('instance' => $instanceName), array('instance' => $instanceName),
array('title' => sprintf($this->translate('Remove monitoring instance %s'), $instanceName)), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove monitoring instance %s'), $instanceName)
)
); ?> ); ?>
</td> </td>
</tr> </tr>

View File

@ -1,174 +1,116 @@
<div class="controls"> <div class="controls">
<?= $this->render('partials/host/objects-header.phtml') ?> <?= $this->render('partials/host/objects-header.phtml'); ?>
</div> </div>
<div class="content"> <div class="content">
<?php if (($hostCount = count($objects)) === 0): ?> <?php if (($hostCount = count($objects)) === 0): ?>
<?= $this->translate('No hosts matching the filter') ?> <?= $this->translate('No hosts matching the filter'); ?>
<?php else: ?> <?php else: ?>
<h3> <h3><?= sprintf($this->translatePlural('%u Host', '%u Hosts', $hostCount), $hostCount); ?></h3>
<?= sprintf( <div><?= $this->qlink(
$this->translatePlural( sprintf($this->translate('List all %u hosts'), $hostCount),
'%u Host', $listAllLink
'%u Hosts', ); ?></div>
$hostCount
),
$hostCount
) ?>
</h3>
<div> <div>
<a href="<?= $listAllLink ?>" title="<?= sprintf( <?= $checkNowForm; ?>
$this->translate('List all %u hosts'),
$hostCount
); ?>">
<?= $this->translate('List all') ?>
</a>
</div> </div>
<div><?= $this->qlink(
sprintf($this->translate('Reschedule the next check for all %u hosts'), $hostCount),
$rescheduleAllLink,
null,
array('icon' => 'reschedule')
); ?></div>
<div><?= $this->qlink(
sprintf($this->translate('Schedule a downtime for all %u hosts'), $hostCount),
$downtimeAllLink,
null,
array('icon' => 'plug')
); ?></div>
<div><?= $this->qlink(
sprintf($this->translate('Submit a passive check result for all %u hosts'), $hostCount),
$processCheckResultAllLink,
null,
array('icon' => 'reply')
); ?></div>
<?php if (($unhandledCount = count($unhandledObjects)) > 0): ?>
<div> <div>
<?= $checkNowForm ?> <h3><?= sprintf(
</div>
<div>
<a href="<?= $rescheduleAllLink ?>">
<?= $this->icon('reschedule'); ?>
<?= $this->translate('Reschedule host checks') ?>
</a>
</div>
<div>
<a href="<?= $downtimeAllLink ?>">
<?= $this->icon('plug'); ?>
<?= $this->translate('Schedule host downtimes') ?>
</a>
</div>
<div>
<a href="<?= $processCheckResultAllLink; ?>">
<?= $this->icon('reply'); ?>
<?= $this->translate('Submit passive check results'); ?>
</a>
</div>
<?php if (! empty($unhandledObjects)): ?>
<h3>
<?php $unhandledCount = count($unhandledObjects) ?>
<?= sprintf(
$this->translatePlural( $this->translatePlural(
'%u Unhandled Host Problem', '%u Unhandled Host Problem',
'%u Unhandled Host Problems', '%u Unhandled Host Problems',
$unhandledCount $unhandledCount
), ),
$unhandledCount $unhandledCount
) ?> ); ?></h3>
</h3> <div><?= $this->qlink(
<div> sprintf(
<a href="<?= $downtimeUnhandledLink ?>" title="<?= sprintf(
$this->translatePlural(
'Schedule downtime for %u unhandled host problem',
'Schedule downtimes for %u unhandled host problems',
$unhandledCount
),
$unhandledCount
) ?>">
<?= $this->icon('plug'); ?>
<?= sprintf(
$this->translatePlural( $this->translatePlural(
'Schedule downtime for unhandled host problem', 'Schedule a downtime for %u unhandled host problem',
'Schedule downtimes for unhandled host problems', 'Schedule a downtime for %u unhandled host problems',
$unhandledCount $unhandledCount
), ),
$unhandledCount $unhandledCount
) ?>
</a>
</div>
<div>
<a href="<?= $acknowledgeUnhandledLink ?>" title="<?= sprintf(
$this->translatePlural(
'Acknowledge %u unhandled host problem',
'Acknowledge %u unhandled host problems',
$unhandledCount
), ),
$unhandledCount $downtimeUnhandledLink,
) ?>"> null,
<?= $this->icon('ok'); ?> array('icon' => 'plug')
<?= sprintf( ); ?></div>
<div><?= $this->qlink(
sprintf(
$this->translatePlural( $this->translatePlural(
'Acknowledge unhandled host problem', 'Acknowledge %u unhandled host problem',
'Acknowledge unhandled host problems', 'Acknowledge %u unhandled host problems',
$unhandledCount $unhandledCount
), ),
$unhandledCount $unhandledCount
) ?> ),
</a> $acknowledgeUnhandledLink,
null,
array('icon' => 'ok')
); ?></div>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if (($acknowledgedCount = count($acknowledgedObjects)) > 0): ?>
<?php if (! empty($acknowledgedObjects)): ?> <div>
<h2> <h2><?= sprintf(
<?php $acknowledgedCount = count($acknowledgedObjects) ?> $this->translatePlural(
<?= sprintf( '%u Acknowledged Host Problem',
$this->translatePlural( '%u Acknowledged Host Problems',
'%u Acknowledged Host Problem',
'%u Acknowledged Host Problems',
$acknowledgedCount
),
$acknowledgedCount $acknowledgedCount
) ?> ),
</h2> $acknowledgedCount
<div> ); ?></h2>
<?= $removeAckForm ?> <?= $removeAckForm ?>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if (($inDowntimeCount = count($objectsInDowntime)) > 0): ?>
<?php if (! empty($objectsInDowntime)): ?> <h2><?= $this->qlink(
<h2> sprintf(
<?php $inDowntimeCount = count($objectsInDowntime) ?> $this->translatePlural(
<a href="<?= $inDowntimeLink ?>" 'List %u host currently in downtime',
title="<?= sprintf( 'List %u hosts currently in downtime',
$this->translatePlural( $inDowntimeCount
'List %u host which is in downtime', ),
'List %u hosts which are in downtime', $inDowntimeCount
$inDowntimeCount ),
), $inDowntimeLink,
$inDowntimeCount null,
) ?>"> array('icon' => 'plug')
<?= $this->icon('plug'); ?> ); ?></h2>
<?= sprintf( <?php endif ?>
$this->translatePlural( <?php if (($commentCount = count($objects->getComments())) > 0): ?>
'List %u host currently in downtime', <h2><?= $this->qlink(
'List %u hosts currently downtime', sprintf(
$inDowntimeCount $this->translatePlural(
), 'List %u host comment',
$inDowntimeCount 'List %u host comments',
) ?> $commentCount
</a> ),
</h2> $commentCount
<?php endif ?> ),
$commentsLink,
<?php $commentCount = count($objects->getComments()) ?> null,
<?php if ($commentCount): ?> array('icon' => 'comment')
<h2> ); ?></h2>
<a href="<?= $commentsLink ?>" <?php endif ?>
title="<?= sprintf(
$this->translatePlural(
'List %u host comment',
'List %u host comments',
$commentCount
),
$commentCount
) ?>">
<?= $this->icon('comment'); ?>
<?= sprintf(
$this->translatePlural(
'List %u host comment',
'List %u host comments',
$commentCount
),
$commentCount
) ?>
</a>
</h2>
<?php endif ?>
<?php endif ?> <?php endif ?>
</div> </div>

View File

@ -4,79 +4,133 @@ use Icinga\Web\Url;
$selfUrl = 'monitoring/list/hosts'; $selfUrl = 'monitoring/list/hosts';
$currentUrl = Url::fromRequest()->getRelativeUrl(); $currentUrl = Url::fromRequest()->getRelativeUrl();
?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>> ?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>>
<?= $this->qlink(sprintf($this->translate('%s hosts:'), $this->stats->hosts_total), $selfUrl); ?> <?= sprintf($this->translate('%s hosts:'), $this->stats->hosts_total); ?>
<span class="badges"> <span class="badges">
<?php if($this->stats->hosts_up): ?> <?php if ($this->stats->hosts_up): ?>
<span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 0))->getRelativeUrl() ? ' active' : '' ?>"> <span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 0))->getRelativeUrl() ? ' active' : ''; ?>">
<?= $this->qlink( <?= $this->qlink(
$this->stats->hosts_up, $this->stats->hosts_up,
$selfUrl, $selfUrl,
array('host_state' => 0), array('host_state' => 0),
array('title' => $this->translate('Hosts with state UP')) array('title' => sprintf(
) ?> $this->translatePlural(
'List %u host that is currently in state UP',
'List %u hosts which are currently in state UP',
$this->stats->hosts_up
),
$this->stats->hosts_up
))
); ?>
</span> </span>
<?php endif; ?> <?php endif; ?>
<?php if($this->stats->hosts_down_unhandled): ?> <?php if ($this->stats->hosts_down_unhandled): ?>
<span class="state critical<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 1, 'host_unhandled' => 1))->getRelativeUrl() ? ' active' : '' ?>"> <span class="state critical<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 1, 'host_unhandled' => 1))->getRelativeUrl() ? ' active' : ''; ?>">
<?= $this->qlink( <?= $this->qlink(
$this->stats->hosts_down_unhandled, $this->stats->hosts_down_unhandled,
$selfUrl, $selfUrl,
array('host_state' => 1, 'host_unhandled' => 1), array(
array('title' => $this->translate('Unhandled hosts with state DOWN')) 'host_state' => 1,
) ?> 'host_unhandled' => 1
),
array('title' => sprintf(
$this->translatePlural(
'List %u host that is currently in state DOWN',
'List %u hosts which are currently in state DOWN',
$this->stats->hosts_down_unhandled
),
$this->stats->hosts_down_unhandled
))
); ?>
<?php endif; ?> <?php endif; ?>
<?php if($this->stats->hosts_down_handled > 0): ?> <?php if ($this->stats->hosts_down_handled): ?>
<span class="state handled critical<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 1, 'host_unhandled' =>0))->getRelativeUrl() ? ' active' : '' ?>"> <span class="state handled critical<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 1, 'host_unhandled' =>0))->getRelativeUrl() ? ' active' : ''; ?>">
<?= $this->qlink( <?= $this->qlink(
$this->stats->hosts_down_handled, $this->stats->hosts_down_handled,
$selfUrl, $selfUrl,
array('host_state' => 1, 'host_unhandled' => 0), array(
array('title' => $this->translate('Handled hosts with state DOWN')) 'host_state' => 1,
) ?> 'host_unhandled' => 0
</span> ),
<?php endif; ?> array('title' => sprintf(
$this->translatePlural(
'List %u host that is currently in state DOWN (Acknowledged)',
'List %u hosts which are currently in state DOWN (Acknowledged)',
$this->stats->hosts_down_handled
),
$this->stats->hosts_down_handled
))
); ?>
</span>
<?php endif; ?>
<?php if($this->stats->hosts_down): ?> <?php if($this->stats->hosts_down): ?>
</span> </span>
<?php endif; ?> <?php endif; ?>
<?php if($this->stats->hosts_unreachable_unhandled): ?> <?php if($this->stats->hosts_unreachable_unhandled): ?>
<span class="state unknown<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 2, 'host_unhandled' => 1))->getRelativeUrl() ? ' active' : '' ?>"> <span class="state unknown<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 2, 'host_unhandled' => 1))->getRelativeUrl() ? ' active' : ''; ?>">
<?= $this->qlink( <?= $this->qlink(
$this->stats->hosts_unreachable_unhandled, $this->stats->hosts_unreachable_unhandled,
$selfUrl, $selfUrl,
array('host_state' => 2, 'host_unhandled' => 1), array(
array('title' => $this->translate('Unhandled hosts with state UNREACHABLE')) 'host_state' => 2,
) ?> 'host_unhandled' => 1
),
array('title' => sprintf(
$this->translatePlural(
'List %u host that is currently in state UNREACHABLE',
'List %u hosts which are currently in state UNREACHABLE',
$this->stats->hosts_unreachable_unhandled
),
$this->stats->hosts_unreachable_unhandled
))
); ?>
<?php endif; ?> <?php endif; ?>
<?php if($this->stats->hosts_unreachable_handled > 0): ?> <?php if($this->stats->hosts_unreachable_handled > 0): ?>
<span class="state handled unknown<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 2, 'host_unhandled' => 0))->getRelativeUrl() ? ' active' : '' ?>"> <span class="state handled unknown<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 2, 'host_unhandled' => 0))->getRelativeUrl() ? ' active' : '' ?>">
<?= $this->qlink( <?= $this->qlink(
$this->stats->hosts_unreachable_handled, $this->stats->hosts_unreachable_handled,
$selfUrl, $selfUrl,
array('host_state' => 2, 'host_unhandled' => 0), array(
array('title' => $this->translate('Handled hosts with state UNREACHABLE')) 'host_state' => 2,
) ?> 'host_unhandled' => 0
</span> ),
<?php endif; ?> array('title' => sprintf(
$this->translatePlural(
'List %u host that is currently in state UNREACHABLE (Acknowledged)',
'List %u hosts which are currently in state UNREACHABLE (Acknowledged)',
$this->stats->hosts_unreachable_handled
),
$this->stats->hosts_unreachable_handled
))
); ?>
</span>
<?php endif; ?>
<?php if($this->stats->hosts_unreachable): ?> <?php if($this->stats->hosts_unreachable): ?>
</span> </span>
<?php endif; ?> <?php endif; ?>
<?php if($this->stats->hosts_pending): ?> <?php if($this->stats->hosts_pending): ?>
<span class="state pending<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 99))->getRelativeUrl() ? ' active' : '' ?>"> <span class="state pending<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 99))->getRelativeUrl() ? ' active' : ''; ?>">
<?= $this->qlink( <?= $this->qlink(
$this->stats->hosts_pending, $this->stats->hosts_pending,
$selfUrl, $selfUrl,
array('host_state' => 99), array('host_state' => 99),
array('title' => $this->translate('Hosts with state PENDING')) array('title' => sprintf(
) ?> $this->translatePlural(
'List %u host that is currently in state PENDING',
'List %u hosts which are currently in state PENDING',
$this->stats->hosts_pending
),
$this->stats->hosts_pending
))
); ?>
</span> </span>
<?php endif; ?> <?php endif; ?>
</span> </span>
</div> </div>

View File

@ -1,19 +1,29 @@
<?php <?php
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Module\Monitoring\Object\Service;
$selfUrl = 'monitoring/list/services'; $selfUrl = 'monitoring/list/services';
$currentUrl = Url::fromRequest()->getRelativeUrl(); $currentUrl = Url::fromRequest()->getRelativeUrl();
?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>> ?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>>
<?= $this->qlink(sprintf($this->translate('%s services:'), $this->stats->services_total), $selfUrl) ?> <?= sprintf($this->translate('%s services:'), $this->stats->services_total); ?>
<span class="badges"> <span class="badges">
<?php if ($this->stats->services_ok): ?> <?php if ($this->stats->services_ok): ?>
<span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('service_state' => 0))->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink( <span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('service_state' => 0))->getRelativeUrl() ? ' active' : ''; ?>">
$this->stats->services_ok, <?= $this->qlink(
$selfUrl, $this->stats->services_ok,
array('service_state' => 0), $selfUrl,
array('title' => sprintf($this->translate('Services with state %s'), $this->translate('OK'))) array('service_state' => 0),
) ?></span> array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state OK',
'List %u services which are currently in state OK',
$this->stats->services_ok
),
$this->stats->services_ok
))
); ?>
</span>
<?php endif ?> <?php endif ?>
<?php <?php
foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $state) { foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $state) {
@ -42,7 +52,15 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
$this->stats->$unhandled, $this->stats->$unhandled,
$selfUrl, $selfUrl,
$paramsUnhandled, $paramsUnhandled,
array('title' => sprintf($this->translate('Unhandled services with state %s'), $this->translate(strtoupper($state)))) array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state %s',
'List %u services which are currently in state %s',
$this->stats->$unhandled
),
$this->stats->$unhandled,
Service::getStateText($stateId, true)
))
); );
} }
if ($this->stats->$handled) { if ($this->stats->$handled) {
@ -59,7 +77,15 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
$this->stats->$handled, $this->stats->$handled,
$selfUrl, $selfUrl,
$paramsHandled, $paramsHandled,
array('title' => sprintf($this->translate('Handled services with state %s'), $this->translate(strtoupper($state)))) array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state %s (Acknowledged)',
'List %u services which are currently in state %s (Acknowledged)',
$this->stats->$handled
),
$this->stats->$handled,
Service::getStateText($stateId, true)
))
); );
if ($this->stats->$unhandled) { if ($this->stats->$unhandled) {
echo "</span>\n"; echo "</span>\n";
@ -70,12 +96,21 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
} }
?> ?>
<?php if ($this->stats->services_pending): ?> <?php if ($this->stats->services_pending): ?>
<span class="state pending<?= $currentUrl === Url::fromPath($selfUrl, array('service_state' => 99))->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink( <span class="state pending<?= $currentUrl === Url::fromPath($selfUrl, array('service_state' => 99))->getRelativeUrl() ? ' active' : ''; ?>">
$this->stats->services_pending, <?= $this->qlink(
$selfUrl, $this->stats->services_pending,
array('service_state' => 99), $selfUrl,
array('title' => sprintf($this->translate('Services with state %s'), $this->translate('PENDING'))) array('service_state' => 99),
) ?></span> array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state PENDING',
'List %u services which are currently in state PENDING',
$this->stats->services_pending
),
$this->stats->services_pending
))
); ?>
</span>
<?php endif ?> <?php endif ?>
</span> </span>
</div> </div>

View File

@ -24,18 +24,21 @@ foreach ($groupData as $groupName => $groupInfo): ?>
<?php foreach ($groupInfo['contacts'] as $c): ?> <?php foreach ($groupInfo['contacts'] as $c): ?>
<div class="box entry"> <div class="box entry">
<?= $this->img('/static/gravatar', array('email' => $c->contact_email)); ?> <?= $this->img('/static/gravatar', array('email' => $c->contact_email)); ?>
<a href="<?= $this->href( <?= $this->qlink(
$c->contact_alias,
'monitoring/show/contact', 'monitoring/show/contact',
array('contact' => $c->contact_name) array('contact' => $c->contact_name),
); ?>"> array('title' => sprintf(
<?= $this->escape($c->contact_alias) ?> $this->translate('Show detailed information about %s'),
</a> $c->contact_alias
))
); ?>
<p> <p>
<?php if ($c->contact_email): ?> <?php if ($c->contact_email): ?>
<?= $c->contact_email; ?> <?= $c->contact_email; ?>
<?php endif; <?php endif;
if ($c->contact_pager): ?> if ($c->contact_pager): ?>
<br /> <br>
<?= $c->contact_pager; ?> <?= $c->contact_pager; ?>
<?php endif ?> <?php endif ?>
</p> </p>

View File

@ -11,24 +11,29 @@
<h1 tabindex="-1"><?= $this->translate('Contacts') ?></h1> <h1 tabindex="-1"><?= $this->translate('Contacts') ?></h1>
<?php <?php
if (count($contacts) === 0) { if (count($contacts) === 0) {
echo mt('monitoring', 'No contacts matching the filter'); echo $this->translate('No contacts matching the filter');
return; return;
} }
foreach ($contacts as $contact): ?> foreach ($contacts as $contact): ?>
<div class="contact"> <div class="contact">
<?= $this->img('/static/gravatar', array('email' => $contact->contact_email)); ?> <?= $this->img('/static/gravatar', array('email' => $contact->contact_email)); ?>
<a href="<?= $this->href( <strong><?= $this->qlink(
$contact->contact_name,
'monitoring/show/contact', 'monitoring/show/contact',
array('contact' => $contact->contact_name) array('contact' => $contact->contact_name),
) ?>"><strong><?= $contact->contact_name ?></strong></a> (<?= $contact->contact_alias ?>) array('title' => sprintf(
<div><?= sprintf( $this->translate('Show detailed information about %s'),
'%1$s: <a href="mailto:%2$s">%2$s</a>', $contact->contact_alias
mt('monitoring', 'Email'), ))
$this->escape($contact->contact_email) ); ?></strong> (<?= $contact->contact_alias; ?>)
) ?></div> <div>
<?= $this->translate('Email'); ?>: <a href="mailto:<?= $contact->contact_email; ?>" title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>" aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>">
<?= $this->escape($contact->contact_email); ?>
</a>
</div>
<?php if ($contact->contact_pager): ?> <?php if ($contact->contact_pager): ?>
<div> <div>
<?= mt('monitoring', 'Pager') ?>: <?= $this->translate('Pager') ?>:
<?= $this->escape($contact->contact_pager) ?> <?= $this->escape($contact->contact_pager) ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -36,13 +41,13 @@
<div class="notification-periods"> <div class="notification-periods">
<?php if ($contact->contact_notify_service_timeperiod): ?> <?php if ($contact->contact_notify_service_timeperiod): ?>
<div> <div>
<?= mt('monitoring', 'Service notification period') ?>: <?= $this->translate('Service notification period') ?>:
<?= $this->escape($contact->contact_notify_service_timeperiod) ?> <?= $this->escape($contact->contact_notify_service_timeperiod) ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if ($contact->contact_notify_host_timeperiod): ?> <?php if ($contact->contact_notify_host_timeperiod): ?>
<div> <div>
<?= mt('monitoring', 'Host notification period') ?>: <?= $this->translate('Host notification period') ?>:
<?= $this->escape($contact->contact_notify_host_timeperiod) ?> <?= $this->escape($contact->contact_notify_host_timeperiod) ?>
</div> </div>
<?php endif; ?> <?php endif; ?>

View File

@ -21,39 +21,39 @@ use Icinga\Web\Widget\Chart\HistoryColorGrid;
$settings = array( $settings = array(
'cnt_up' => array( 'cnt_up' => array(
'tooltip' => mt('monitoring', '%d ok on %s'), 'tooltip' => $this->translate('%d hosts ok on %s'),
'color' => '#49DF96', 'color' => '#49DF96',
'opacity' => '0.55' 'opacity' => '0.55'
), ),
'cnt_unreachable_hard' => array( 'cnt_unreachable_hard' => array(
'tooltip' => mt('monitoring', '%d unreachable on %s'), 'tooltip' => $this->translate('%d hosts unreachable on %s'),
'color' => '#77AAFF', 'color' => '#77AAFF',
'opacity' => '0.55' 'opacity' => '0.55'
), ),
'cnt_critical_hard' => array( 'cnt_critical_hard' => array(
'tooltip' => mt('monitoring', '%d critical on %s'), 'tooltip' => $this->translate('%d services critical on %s'),
'color' => '#ff5566', 'color' => '#ff5566',
'opacity' => '0.9' 'opacity' => '0.9'
), ),
'cnt_warning_hard' => array( 'cnt_warning_hard' => array(
'tooltip' => mt('monitoring', '%d warning on %s'), 'tooltip' => $this->translate('%d services warning on %s'),
'color' => '#ffaa44', 'color' => '#ffaa44',
'opacity' => '1.0' 'opacity' => '1.0'
), ),
'cnt_down_hard' => array( 'cnt_down_hard' => array(
'tooltip' => mt('monitoring', '%d down on %s'), 'tooltip' => $this->translate('%d hosts down on %s'),
'color' => '#ff5566', 'color' => '#ff5566',
'opacity' => '0.9' 'opacity' => '0.9'
), ),
'cnt_unknown_hard' => array( 'cnt_unknown_hard' => array(
'tooltip' => mt('monitoring', '%d unknown on %s'), 'tooltip' => $this->translate('%d services unknown on %s'),
'color' => '#cc77ff', 'color' => '#cc77ff',
'opacity' => '0.7' 'opacity' => '0.7'
), ),
'cnt_ok' => array( 'cnt_ok' => array(
'tooltip' => mt('monitoring', '%d ok on %s'), 'tooltip' => $this->translate('%d services ok on %s'),
'color' => '#49DF96', 'color' => '#49DF96',
'opacity' => '0.55' 'opacity' => '0.55'
) )
@ -69,7 +69,7 @@ if ($to - $from > 315360000) {
$data = array(); $data = array();
if (count($summary) === 0) { if (count($summary) === 0) {
echo mt('monitoring', 'No state changes in the selected time period.'); echo $this->translate('No state changes in the selected time period.');
} }
foreach ($summary as $entry) { foreach ($summary as $entry) {
$day = $entry->day; $day = $entry->day;

View File

@ -78,39 +78,53 @@
</td> </td>
<?php endif ?> <?php endif ?>
<td class="groupname"> <td class="groupname">
<a href="<?= $this->href('monitoring/list/hosts', array('hostgroup' => $h->hostgroup)); ?>"> <?= $this->qlink(
<?= $this->escape($h->hostgroup_alias) ?> $h->hostgroup_alias,
</a> 'monitoring/list/hosts',
array('hostgroup' => $h->hostgroup),
array('title' => sprintf($this->translate('List all hosts in the group "%s"'), $h->hostgroup_alias))
); ?>
</td> </td>
<td class="total"> <td class="total">
<?= $this->qlink($h->services_total, 'monitoring/list/services', array('hostgroup' => $h->hostgroup)) ?> <?= $this->qlink(
$h->services_total,
'monitoring/list/services',
array('hostgroup' => $h->hostgroup),
array('title' => sprintf(
$this->translate('List all services of all hosts in host group "%s"'),
$h->hostgroup_alias
))
); ?>
</td> </td>
<td class="state"> <td class="state">
<?php if ($h->services_ok): ?> <?php if ($h->services_ok): ?>
<span class="state ok"> <span class="state ok">
<a href="<?= $this->href( <?= $this->qlink(
$h->services_ok,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 0, 'service_state' => 0,
'hostgroup' => $h->hostgroup, 'hostgroup' => $h->hostgroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?= printf(
$this->translatePlural(
'List %u service with status ok in host group %s',
'List %u services with status ok in host group %s',
$h->services_ok
), ),
$h->services_ok, array(
$h->hostgroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $h->services_ok; ?> 'List %u service that is currently in state OK on hosts in the host group "%s"',
</a> 'List %u services which are currently in state OK on hosts in the host group "%s"',
$h->services_ok
),
$h->services_ok,
$h->hostgroup_alias
)
)
); ?>
</span> </span>
<?php endif ?> <?php endif ?>
<?php if ($h->services_critical_unhandled): ?> <?php if ($h->services_critical_unhandled): ?>
<span class="state critical"> <span class="state critical">
<a href="<?= $this->href( <?= $this->qlink(
$h->services_critical_unhandled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 2, 'service_state' => 2,
@ -119,40 +133,43 @@
'host_problem' => 0, 'host_problem' => 0,
'hostgroup' => $h->hostgroup, 'hostgroup' => $h->hostgroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %u service with status critical unhandled in host group %s',
'List %u services with status critical unhandled in host group %s',
$h->services_critical_unhandled
), ),
$h->services_critical_unhandled, array(
$h->hostgroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $h->services_critical_unhandled; ?> 'List %u service that is currently in state CRITICAL on hosts in the host group "%s"',
</a> 'List %u services which are currently in state CRITICAL on hosts in the host group "%s"',
$h->services_critical_unhandled
),
$h->services_critical_unhandled,
$h->hostgroup_alias
)
)
); ?>
<?php endif ?> <?php endif ?>
<?php if ($h->services_critical_handled): ?> <?php if ($h->services_critical_handled): ?>
<span class="state critical handled"> <span class="state critical handled">
<a href="<?= $this->href( <?= $this->qlink(
$h->services_critical_handled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 2, 'service_state' => 2,
'service_handled' => 1, 'service_handled' => 1,
'hostgroup' => $h->hostgroup, 'hostgroup' => $h->hostgroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %u service with status critical handled in host group %s',
'List %u services with status critical handled in host group %s',
$h->services_critical_handled
), ),
$h->services_critical_handled, array(
$h->hostgroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $h->services_critical_handled; ?> 'List %u service that is currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"',
</a> 'List %u services which are currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"',
$h->services_critical_handled
),
$h->services_critical_handled,
$h->hostgroup_alias
)
)
); ?>
</span> </span>
<?php endif ?> <?php endif ?>
<?php if ($h->services_critical_unhandled): ?> <?php if ($h->services_critical_unhandled): ?>
@ -160,7 +177,8 @@
<?php endif ?> <?php endif ?>
<?php if ($h->services_unknown_unhandled): ?> <?php if ($h->services_unknown_unhandled): ?>
<span class="state unknown"> <span class="state unknown">
<a href="<?= $this->href( <?= $this->qlink(
$h->services_unknown_unhandled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 3, 'service_state' => 3,
@ -169,40 +187,43 @@
'host_problem' => 0, 'host_problem' => 0,
'hostgroup' => $h->hostgroup, 'hostgroup' => $h->hostgroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %u service with status unknown unhandled in host group %s',
'List %u services with status unknown unhandled in host group %s',
$h->services_unknown_unhandled
), ),
$h->services_unknown_unhandled, array(
$h->hostgroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $h->services_unknown_unhandled; ?> 'List %u service that is currently in state UNKNOWN on hosts in the host group "%s"',
</a> 'List %u services which are currently in state UNKNOWN on hosts in the host group "%s"',
$h->services_unknown_unhandled
),
$h->services_unknown_unhandled,
$h->hostgroup_alias
)
)
); ?>
<?php endif ?> <?php endif ?>
<?php if ($h->services_unknown_handled): ?> <?php if ($h->services_unknown_handled): ?>
<span class="state unknown handled"> <span class="state unknown handled">
<a href="<?= $this->href( <?= $this->qlink(
$h->services_unknown_handled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 3, 'service_state' => 3,
'service_handled' => 1, 'service_handled' => 1,
'hostgroup' => $h->hostgroup, 'hostgroup' => $h->hostgroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %u service with status unknown handled in host group %s',
'List %u services with status unknown handled in host group %s',
$h->services_unknown_handled
), ),
$h->services_unknown_handled, array(
$h->hostgroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $h->services_unknown_handled; ?> 'List %u service that is currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"',
</a> 'List %u services which are currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"',
$h->services_unknown_handled
),
$h->services_unknown_handled,
$h->hostgroup_alias
)
)
); ?>
</span> </span>
<?php endif ?> <?php endif ?>
<?php if ($h->services_unknown_unhandled): ?> <?php if ($h->services_unknown_unhandled): ?>
@ -210,7 +231,8 @@
<?php endif ?> <?php endif ?>
<?php if ($h->services_warning_unhandled): ?> <?php if ($h->services_warning_unhandled): ?>
<span class="state warning"> <span class="state warning">
<a href="<?= $this->href( <?= $this->qlink(
$h->services_warning_unhandled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 1, 'service_state' => 1,
@ -219,40 +241,43 @@
'host_problem' => 0, 'host_problem' => 0,
'hostgroup' => $h->hostgroup, 'hostgroup' => $h->hostgroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %u service with status warning unhandled in host group %s',
'List %u services with status warning unhandled in host group %s',
$h->services_warning_unhandled
), ),
$h->services_warning_unhandled, array(
$h->hostgroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $h->services_warning_unhandled; ?> 'List %u service that is currently in state WARNING on hosts in the host group "%s"',
</a> 'List %u services which are currently in state WARNING on hosts in the host group "%s"',
$h->services_warning_unhandled
),
$h->services_warning_unhandled,
$h->hostgroup_alias
)
)
); ?>
<?php endif ?> <?php endif ?>
<?php if ($h->services_warning_handled): ?> <?php if ($h->services_warning_handled): ?>
<span class="state warning handled"> <span class="state warning handled">
<a href="<?= $this->href( <?= $this->qlink(
$h->services_warning_handled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 1, 'service_state' => 1,
'service_handled' => 1, 'service_handled' => 1,
'hostgroup' => $h->hostgroup, 'hostgroup' => $h->hostgroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %u service with status warning handled in host group %s',
'List %u services with status warning handled in host group %s',
$h->services_warning_handled
), ),
$h->services_warning_handled, array(
$h->hostgroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $h->services_warning_handled; ?> 'List %u service that is currently in state WARNING (Acknowledged) on hosts in the host group "%s"',
</a> 'List %u services which are currently in state WARNING (Acknowledged) on hosts in the host group "%s"',
$h->services_warning_handled
),
$h->services_warning_handled,
$h->hostgroup_alias
)
)
); ?>
</span> </span>
<?php endif ?> <?php endif ?>
<?php if ($h->services_warning_unhandled): ?> <?php if ($h->services_warning_unhandled): ?>
@ -260,24 +285,26 @@
<?php endif ?> <?php endif ?>
<?php if ($h->services_pending): ?> <?php if ($h->services_pending): ?>
<span class="state pending"> <span class="state pending">
<a href="<?= $this->href( <?= $this->qlink(
$h->services_pending,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 99, 'service_state' => 99,
'hostgroup' => $h->hostgroup, 'hostgroup' => $h->hostgroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %u service with status pending in host group %s',
'List %u services with status pending in host group %s',
$h->services_pending
), ),
$h->services_pending, array(
$h->hostgroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $h->services_pending; ?> 'List %u service that is currently in state PENDING on hosts in the host group "%s"',
</a> 'List %u services which are currently in state PENDING on hosts in the host group "%s"',
$h->services_pending
),
$h->services_pending,
$h->hostgroup_alias
)
)
); ?>
</span> </span>
<?php endif ?> <?php endif ?>
</td> </td>

View File

@ -95,11 +95,18 @@ if ($hosts->count() === 0) {
<?= $this->icon($this->resolveMacros($host->host_icon_image, $host)) ?> <?= $this->icon($this->resolveMacros($host->host_icon_image, $host)) ?>
<?php endif ?> <?php endif ?>
<?= implode(' ', $icons) ?> <?= implode(' ', $icons) ?>
<a href="<?= $hostLink ?>"><?= $this->escape($host->host_display_name) ?></a> <?= $this->qlink(
$host->host_display_name,
$hostLink,
null,
array(
'title' => sprintf($this->translate('Show detailed information for host %s'), $host->host_display_name)
)
); ?>
<?php if (isset($host->host_unhandled_services) && $host->host_unhandled_services > 0): ?> <?php if (isset($host->host_unhandled_services) && $host->host_unhandled_services > 0): ?>
<span> (<?= $this->qlink( <span> (<?= $this->qlink(
sprintf( sprintf(
$this->translatePlural('%d unhandled service', '%d unhandled services', $host->host_unhandled_services), $this->translatePlural('%u unhandled service', '%u unhandled services', $host->host_unhandled_services),
$host->host_unhandled_services $host->host_unhandled_services
), ),
'monitoring/show/services', 'monitoring/show/services',
@ -112,8 +119,8 @@ if ($hosts->count() === 0) {
'style' => 'font-weight: normal', 'style' => 'font-weight: normal',
'title' => sprintf( 'title' => sprintf(
$this->translatePlural( $this->translatePlural(
'List %s service problem on host %s', 'List %s unhandled service problem on host %s',
'List %s service problems on host %s', 'List %s unhandled service problems on host %s',
$host->host_unhandled_services $host->host_unhandled_services
), ),
$host->host_unhandled_services, $host->host_unhandled_services,

View File

@ -36,18 +36,23 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
); ?></th> ); ?></th>
<th colspan="<?= count($serviceStates); ?>"> <th colspan="<?= count($serviceStates); ?>">
<div> <div>
<?php foreach (array_keys($serviceStates) as $service_description): ?> <?php
$serviceDescriptions = array_keys($serviceStates);
$serviceFilter = '(service_description=' . implode('|service_description=', $serviceDescriptions) . ')';
foreach ($serviceDescriptions as $service_description): ?>
<span> <span>
<a href="<?= $this->href( <?= $this->qlink(
'monitoring/list/services', '<abbr>' . (strlen($service_description) > 18 ? substr($service_description, 0, 18) . '...' : $service_description) . '</abbr>',
'monitoring/list/services?' . $hostFilter,
array( array(
'service_description' => $service_description 'service_description' => $service_description
) ),
) . '&' . $hostFilter; ?>"> array(
<abbr title="<?= $service_description; ?>"> 'title' => sprintf($this->translate('List all services with the name "%s" on all reported hosts'), $service_description)
<?= strlen($service_description) > 18 ? substr($service_description, 0, 18) . '...' : $service_description; ?> ),
</abbr> false
</a> ); ?>
</span> </span>
<?php endforeach ?> <?php endforeach ?>
</div> </div>
@ -59,18 +64,40 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
<?php endif ?> <?php endif ?>
<tr> <tr>
<th> <th>
<a href="<?= $this->href('monitoring/show/services', array('host' => $host_name)); ?>"><?= $host_name; ?></a> <?= $this->qlink(
$host_name,
'monitoring/show/services?' . $serviceFilter,
array('host' => $host_name),
array('title' => sprintf($this->translate('List all reported services on host %s'), $host_name))
); ?>
</th> </th>
<?php foreach (array_values($serviceStates) as $service): ?> <?php foreach (array_values($serviceStates) as $service): ?>
<?php if ($service !== null): ?> <?php if ($service !== null): ?>
<td> <td>
<a href="<?= $this->href('monitoring/show/service', array( <span class="sr-only" id="<?= $service->host_name . '_' . $service->service_description . '_desc'; ?>">
'host' => $service->host_name, <?= $this->escape($service->service_output); ?>
'service' => $service->service_description </span>
)); ?>" title="<?= $this->escape($service->service_output); ?>" class="state_<?= Service::getStateText($service->service_state); ?> <?= $service->service_handled ? 'handled' : ''; ?>"></a> <?= $this->qlink(
'',
'monitoring/show/service',
array(
'host' => $service->host_name,
'service' => $service->service_description
),
array(
'aria-describedby' => $service->host_name . '_' . $service->service_description . '_desc',
'class' => 'state_' . Service::getStateText($service->service_state). ($service->service_handled ? ' handled' : ''),
'title' => $this->escape($service->service_output),
'aria-label' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$service->service_description,
$service->host_name
)
)
); ?>
</td> </td>
<?php else: ?> <?php else: ?>
<td>&middot;</td> <td><span aria-hidden="true">&middot;</span></td>
<?php endif ?> <?php endif ?>
<?php endforeach ?> <?php endforeach ?>
</tr> </tr>

View File

@ -78,9 +78,12 @@
</td> </td>
<?php endif ?> <?php endif ?>
<td class="groupname"> <td class="groupname">
<a href="<?= $this->href('monitoring/list/services', array('servicegroup' => $s->servicegroup)); ?>"> <?= $this->qlink(
<?= $this->translate($s->servicegroup_alias) ?> $s->servicegroup_alias,
</a> 'monitoring/list/services',
array('servicegroup' => $s->servicegroup),
array('title' => sprintf($this->translate('List all services in the group "%s"'), $s->servicegroup_alias))
); ?>
</td> </td>
<td class="total"> <td class="total">
<?= $s->services_total; ?> <?= $s->services_total; ?>
@ -88,29 +91,32 @@
<td class="state"> <td class="state">
<?php if ($s->services_ok): ?> <?php if ($s->services_ok): ?>
<span class="state ok"> <span class="state ok">
<a href="<?= $this->href( <?= $this->qlink(
$s->services_ok,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 0, 'service_state' => 0,
'servicegroup' => $s->servicegroup, 'servicegroup' => $s->servicegroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %s service with status ok in service group %s',
'List %s Services with status ok in service group %s',
$s->services_ok
), ),
$s->services_ok, array(
$s->servicegroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $s->services_ok; ?> 'List %s service that is currently in state OK in service group "%s"',
</a> 'List %s services which are currently in state OK in service group "%s"',
$s->services_ok
),
$s->services_ok,
$s->servicegroup_alias
)
)
); ?>
</span> </span>
<?php endif ?> <?php endif ?>
<?php if ($s->services_critical_unhandled): ?> <?php if ($s->services_critical_unhandled): ?>
<span class="state critical"> <span class="state critical">
<a href="<?= $this->href( <?= $this->qlink(
$s->services_critical_unhandled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 2, 'service_state' => 2,
@ -119,40 +125,43 @@
'host_problem' => 0, 'host_problem' => 0,
'servicegroup' => $s->servicegroup, 'servicegroup' => $s->servicegroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %s service with status critical unhandled in service group %s',
'List %s Services with status critical unhandled in service group %s',
$s->services_critical_unhandled
), ),
$s->services_critical_unhandled, array(
$s->servicegroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $s->services_critical_unhandled; ?> 'List %s service that is currently in state CRITICAL in service group "%s"',
</a> 'List %s services which are currently in state CRITICAL in service group "%s"',
$s->services_critical_unhandled
),
$s->services_critical_unhandled,
$s->servicegroup_alias
)
)
); ?>
<?php endif ?> <?php endif ?>
<?php if ($s->services_critical_handled): ?> <?php if ($s->services_critical_handled): ?>
<span class="state critical handled"> <span class="state critical handled">
<a href="<?= $this->href( <?= $this->qlink(
$s->services_critical_handled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 2, 'service_state' => 2,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup' => $s->servicegroup, 'servicegroup' => $s->servicegroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %s service with status critical handled in service group %s',
'List %s services with status critical handled in service group %s',
$s->services_critical_handled
), ),
$s->services_critical_handled, array(
$s->servicegroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $s->services_critical_handled; ?> 'List %s service that is currently in state CRITICAL (Acknowledged) in service group "%s"',
</a> 'List %s services which are currently in state CRITICAL (Acknowledged) in service group "%s"',
$s->services_critical_handled
),
$s->services_critical_handled,
$s->servicegroup_alias
)
)
); ?>
</span> </span>
<?php endif ?> <?php endif ?>
<?php if ($s->services_critical_unhandled): ?> <?php if ($s->services_critical_unhandled): ?>
@ -160,7 +169,8 @@
<?php endif ?> <?php endif ?>
<?php if ($s->services_unknown_unhandled): ?> <?php if ($s->services_unknown_unhandled): ?>
<span class="state unknown"> <span class="state unknown">
<a href="<?= $this->href( <?= $this->qlink(
$s->services_unknown_unhandled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 3, 'service_state' => 3,
@ -169,40 +179,43 @@
'host_problem' => 0, 'host_problem' => 0,
'servicegroup' => $s->servicegroup, 'servicegroup' => $s->servicegroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %s service with status unknown unhandled in service group %s',
'List %s services with status unknown unhandled in service group %s',
$s->services_unknown_unhandled
), ),
$s->services_unknown_unhandled, array(
$s->servicegroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $s->services_unknown_unhandled; ?> 'List %s service that is currently in state UNKNOWN in service group "%s"',
</a> 'List %s services which are currently in state UNKNOWN in service group "%s"',
$s->services_unknown_unhandled
),
$s->services_unknown_unhandled,
$s->servicegroup_alias
)
)
); ?>
<?php endif ?> <?php endif ?>
<?php if ($s->services_unknown_handled): ?> <?php if ($s->services_unknown_handled): ?>
<span class="state unknown handled"> <span class="state unknown handled">
<a href="<?= $this->href( <?= $this->qlink(
$s->services_unknown_handled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 3, 'service_state' => 3,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup' => $s->servicegroup, 'servicegroup' => $s->servicegroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %s service with status unknown handled in service group %s',
'List %s services with status unknown handled in service group %s',
$s->services_unknown_handled
), ),
$s->services_unknown_handled, array(
$s->servicegroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $s->services_unknown_handled; ?> 'List %s service that is currently in state UNKNOWN (Acknowledged) in service group "%s"',
</a> 'List %s services which are currently in state UNKNOWN (Acknowledged) in service group "%s"',
$s->services_unknown_handled
),
$s->services_unknown_handled,
$s->servicegroup_alias
)
)
); ?>
</span> </span>
<?php endif ?> <?php endif ?>
<?php if ($s->services_unknown_unhandled): ?> <?php if ($s->services_unknown_unhandled): ?>
@ -210,7 +223,8 @@
<?php endif ?> <?php endif ?>
<?php if ($s->services_warning_unhandled): ?> <?php if ($s->services_warning_unhandled): ?>
<span class="state warning"> <span class="state warning">
<a href="<?= $this->href( <?= $this->qlink(
$s->services_warning_unhandled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 1, 'service_state' => 1,
@ -219,40 +233,43 @@
'host_problem' => 0, 'host_problem' => 0,
'servicegroup' => $s->servicegroup, 'servicegroup' => $s->servicegroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %s service with status warning unhandled in service group %s',
'List %s services with status warning unhandled in service group %s',
$s->services_warning_unhandled
), ),
$s->services_warning_unhandled, array(
$s->servicegroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $s->services_warning_unhandled; ?> 'List %s service that is currently in state WARNING in service group "%s"',
</a> 'List %s services which are currently in state WARNING in service group "%s"',
$s->services_warning_unhandled
),
$s->services_warning_unhandled,
$s->servicegroup_alias
)
)
); ?>
<?php endif ?> <?php endif ?>
<?php if ($s->services_warning_handled): ?> <?php if ($s->services_warning_handled): ?>
<span class="state warning handled"> <span class="state warning handled">
<a href="<?= $this->href( <?= $this->qlink(
$s->services_warning_handled,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 1, 'service_state' => 1,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup' => $s->servicegroup, 'servicegroup' => $s->servicegroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %s service with status warning handled in service group %s',
'List %s services with status warning handled in service group %s',
$s->services_warning_handled
), ),
$s->services_warning_handled, array(
$s->servicegroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $s->services_warning_handled; ?> 'List %s service that is currently in state WARNING (Acknowledged) in service group "%s"',
</a> 'List %s services which are currently in state WARNING (Acknowledged) in service group "%s"',
$s->services_warning_handled
),
$s->services_warning_handled,
$s->servicegroup_alias
)
)
); ?>
</span> </span>
<?php endif ?> <?php endif ?>
<?php if ($s->services_warning_unhandled): ?> <?php if ($s->services_warning_unhandled): ?>
@ -260,24 +277,26 @@
<?php endif ?> <?php endif ?>
<?php if ($s->services_pending): ?> <?php if ($s->services_pending): ?>
<span class="state pending"> <span class="state pending">
<a href="<?= $this->href( <?= $this->qlink(
$s->services_pending,
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 99, 'service_state' => 99,
'servicegroup' => $s->servicegroup, 'servicegroup' => $s->servicegroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
)
); ?>" title="<?php printf(
$this->translatePlural(
'List %s service with status pending in service group %s',
'List %s services with status pending in service group %s',
$s->services_pending
), ),
$s->services_pending, array(
$s->servicegroup 'title' => sprintf(
); ?>"> $this->translatePlural(
<?= $s->services_pending; ?> 'List %s service that is currenlty in state PENDING in service group "%s"',
</a> 'List %s services which are currently in state PENDING in service group "%s"',
$s->services_pending
),
$s->services_pending,
$s->servicegroup_alias
)
)
); ?>
</span> </span>
<?php endif ?> <?php endif ?>
</td> </td>

View File

@ -101,13 +101,23 @@ foreach ($services as $service):
<?php endif ?> <?php endif ?>
<?php if ($service->service_icon_image && ! preg_match('/[\'"]/', $service->service_icon_image)): ?> <?php if ($service->service_icon_image && ! preg_match('/[\'"]/', $service->service_icon_image)): ?>
<?= $this->icon($this->resolveMacros($service->service_icon_image, $service)) ?> <?= $this->icon($this->resolveMacros($service->service_icon_image, $service)) ?>
<?php endif ?> <?php endif ?>
<a href="<?= $serviceLink ?>"><?= $this->escape($service->service_display_name) ?></a><?php if ($this->showHost): ?> on <a href="<?= $hostLink ?>"><?= $this->escape($service->host_display_name) ?> <?= $this->qlink(
<?php if ($service->host_state != 0): ?> $service->service_display_name,
(<?= Host::getStateText($service->host_state, true); ?>) $serviceLink,
<?php endif ?> null,
</a><?php endif ?><br /> array('title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$service->service_display_name,
$service->host_display_name
))
); ?><?php if ($this->showHost): ?> on <?= $this->qlink(
$service->host_display_name . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''),
$hostLink,
null,
array('title' => sprintf($this->translate('Show detailed information for host %s'), $service->host_display_name))
); ?><?php endif ?><br>
<p class="pluginoutput"><?= $this->escape($this->ellipsis($service->service_output, 10000)); ?></p> <p class="pluginoutput"><?= $this->escape($this->ellipsis($service->service_output, 10000)); ?></p>
</td> </td>
<?php foreach($this->extraColumns as $col): ?> <?php foreach($this->extraColumns as $col): ?>

View File

@ -1,23 +1,54 @@
<?php <?php
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Module\Monitoring\Object\Service;
$selfUrl = Url::fromPath('monitoring/show/services', array('host' => $this->object->host_name)); $selfUrl = Url::fromPath('monitoring/show/services', array('host' => $object->host_name));
$currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl(); $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>> ?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>>
<?php if ($object->stats->services_total > 0): ?> <?php if ($object->stats->services_total): ?>
<?= $this->qlink(sprintf($this->translatePlural('%d configured service:', '%d configured services:', $object->stats->services_total), $object->stats->services_total), $selfUrl) ?> <?= $this->qlink(
sprintf(
$this->translatePlural(
'%u configured service:',
'%u configured services:',
$object->stats->services_total
),
$object->stats->services_total
),
$selfUrl,
null,
array('title' => sprintf(
$this->translatePlural(
'List all %u service on host %s',
'List all %u services on host %s',
$object->stats->services_total
),
$object->stats->services_total,
$object->host_name
))
); ?>
<?php else: ?> <?php else: ?>
<?= $this->translate('No services configured on this host'); ?> <?= $this->translate('No services configured on this host'); ?>
<?php endif; ?> <?php endif; ?>
<span class="badges"> <span class="badges">
<?php if ($object->stats->services_ok > 0): ?> <?php if ($object->stats->services_ok): ?>
<span class="state ok<?= $currentUrl === $selfUrl->with('service_state', 0)->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink( <span class="state ok<?= $currentUrl === $selfUrl->with('service_state', 0)->getRelativeUrl() ? ' active' : ''; ?>">
$object->stats->services_ok, <?= $this->qlink(
$selfUrl, $object->stats->services_ok,
array('service_state' => 0), $selfUrl,
array('title' => sprintf($this->translate('Services with state %s'), $this->translate('OK'))) array('service_state' => 0),
) ?></span> array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state OK on host %s',
'List %u services which are currently in state OK on host %s',
$object->stats->services_ok
),
$object->stats->services_ok,
$object->host_name
))
); ?>
</span>
<?php endif ?> <?php endif ?>
<?php <?php
foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $state) { foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $state) {
@ -46,7 +77,16 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
$object->stats->$unhandled, $object->stats->$unhandled,
$selfUrl, $selfUrl,
$paramsUnhandled, $paramsUnhandled,
array('title' => sprintf($this->translate('Unhandled services with state %s'), $this->translate(strtoupper($state)))) array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state %s on host %s',
'List %u services which are currently in state %s on host %s',
$object->stats->$unhandled
),
$object->stats->$unhandled,
Service::getStateText($stateId, true),
$object->host_name
))
); );
} }
if ($object->stats->$handled) { if ($object->stats->$handled) {
@ -63,7 +103,16 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
$object->stats->$handled, $object->stats->$handled,
$selfUrl, $selfUrl,
$paramsHandled, $paramsHandled,
array('title' => sprintf($this->translate('Handled services with state %s'), $this->translate(strtoupper($state)))) array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state %s (Acknowledged) on host %s',
'List %u services which are currently in state %s (Acknowledged) on host %s',
$object->stats->$handled
),
$object->stats->$handled,
Service::getStateText($stateId, true),
$object->host_name
))
); );
if ($object->stats->$unhandled) { if ($object->stats->$unhandled) {
echo "</span>\n"; echo "</span>\n";
@ -74,12 +123,22 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
} }
?> ?>
<?php if ($object->stats->services_pending): ?> <?php if ($object->stats->services_pending): ?>
<span class="state pending<?= $currentUrl === $selfUrl->with('service_state', 99)->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink( <span class="state pending<?= $currentUrl === $selfUrl->with('service_state', 99)->getRelativeUrl() ? ' active' : ''; ?>">
$object->stats->services_pending, <?= $this->qlink(
$selfUrl, $object->stats->services_pending,
array('service_state' => 99), $selfUrl,
array('title' => sprintf($this->translate('Services with state %s'), $this->translate('PENDING'))) array('service_state' => 99),
) ?></span> array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state PENDING on host %s',
'List %u services which are currently in state PENDING on host %s',
$object->stats->services_pending
),
$object->stats->services_pending,
$object->host_name
))
) ?>
</span>
<?php endif ?> <?php endif ?>
</span> </span>
</div> </div>

View File

@ -1,159 +1,116 @@
<div class="controls"> <div class="controls">
<?= $this->render('partials/service/objects-header.phtml') ?> <?= $this->render('partials/service/objects-header.phtml'); ?>
</div> </div>
<div class="content"> <div class="content">
<?php if (($serviceCount = count($objects)) === 0): ?> <?php if (($serviceCount = count($objects)) === 0): ?>
<?= $this->translate('No services matching the filter') ?> <?= $this->translate('No services matching the filter'); ?>
<?php else: ?> <?php else: ?>
<h3><?= sprintf($this->translatePlural('%u Service', '%u Services', $serviceCount), $serviceCount); ?></h3>
<div><?= $this->qlink(
sprintf($this->translate('List all %u services'), $serviceCount),
$listAllLink
); ?></div>
<div> <div>
<a href="<?= $listAllLink ?>" title="<?= sprintf($this->translate('List all %u services'), $serviceCount) ?>"> <?= $checkNowForm; ?>
<?= $this->translate('List all') ?>
</a>
</div> </div>
<div><?= $this->qlink(
sprintf($this->translate('Reschedule the next check for all %u services'), $serviceCount),
$rescheduleAllLink,
null,
array('icon' => 'reschedule')
); ?></div>
<div><?= $this->qlink(
sprintf($this->translate('Schedule a downtime for all %u services'), $serviceCount),
$downtimeAllLink,
null,
array('icon' => 'plug')
); ?></div>
<div><?= $this->qlink(
sprintf($this->translate('Submit a passive check result for all %u services'), $serviceCount),
$processCheckResultAllLink,
null,
array('icon' => 'reply')
); ?></div>
<?php if (($unhandledCount = count($unhandledObjects)) > 0): ?>
<div> <div>
<?= $checkNowForm ?> <h3><?= sprintf(
</div>
<div>
<a href="<?= $rescheduleAllLink ?>">
<?= $this->icon('reschedule'); ?>
<?= $this->translate('Reschedule service checks') ?>
</a>
</div>
<div>
<a href="<?= $downtimeAllLink ?>">
<?= $this->icon('plug'); ?>
<?= $this->translate('Schedule service downtimes') ?>
</a>
</div>
<div>
<a href="<?= $processCheckResultAllLink; ?>">
<?= $this->icon('reply'); ?>
<?= $this->translate('Submit passive check results'); ?>
</a>
</div>
<?php if (! empty($unhandledObjects)): ?>
<h3>
<?php $unhandledCount = count($unhandledObjects) ?>
<?= sprintf(
$this->translatePlural( $this->translatePlural(
'%u Unhandled Service Problem', '%u Unhandled Service Problem',
'%u Unhandled Service Problems', '%u Unhandled Service Problems',
$unhandledCount $unhandledCount
), ),
$unhandledCount $unhandledCount
) ?> ); ?></h3>
</h3> <div><?= $this->qlink(
<div> sprintf(
<a href="<?= $downtimeUnhandledLink ?>" title="<?= sprintf(
$this->translatePlural(
'Schedule downtime for %u unhandled service problem',
'Schedule downtimes for %u unhandled service problems',
$unhandledCount
),
$unhandledCount
) ?>">
<?= $this->icon('plug'); ?>
<?= sprintf(
$this->translatePlural( $this->translatePlural(
'Schedule downtime for unhandled service problem', 'Schedule a downtime for %u unhandled service problem',
'Schedule downtimes for unhandled service problems', 'Schedule a downtime for %u unhandled service problems',
$unhandledCount $unhandledCount
), ),
$unhandledCount $unhandledCount
) ?>
</a>
</div>
<div>
<a href="<?= $acknowledgeUnhandledLink ?>" title="<?= sprintf(
$this->translatePlural(
'Acknowledge %u unhandled service problem',
'Acknowledge %u unhandled service problems',
$unhandledCount
), ),
$unhandledCount $downtimeUnhandledLink,
) ?>"> null,
<?= $this->icon('ok'); ?> array('icon' => 'plug')
<?= sprintf( ); ?></div>
<div><?= $this->qlink(
sprintf(
$this->translatePlural( $this->translatePlural(
'Acknowledge unhandled service problem', 'Acknowledge %u unhandled service problem',
'Acknowledge unhandled service problems', 'Acknowledge %u unhandled service problems',
$unhandledCount $unhandledCount
), ),
$unhandledCount $unhandledCount
) ?> ),
</a> $acknowledgeUnhandledLink,
null,
array('icon' => 'ok')
); ?></div>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if (($acknowledgedCount = count($acknowledgedObjects)) > 0): ?>
<?php if (! empty($acknowledgedObjects)): ?> <div>
<h2> <h2><?= sprintf(
<?php $acknowledgedCount = count($acknowledgedObjects) ?> $this->translatePlural(
<?= sprintf( '%u Acknowledged Service Problem',
$this->translatePlural( '%u Acknowledged Service Problems',
'%u Acknowledged Service Problem',
'%u Acknowledged Service Problems',
$acknowledgedCount
),
$acknowledgedCount $acknowledgedCount
) ?> ),
</h2> $acknowledgedCount
<div> ); ?></h2>
<?= $removeAckForm ?> <?= $removeAckForm ?>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if (($inDowntimeCount = count($objectsInDowntime)) > 0): ?>
<?php if (! empty($objectsInDowntime)): ?> <h2><?= $this->qlink(
<h2> sprintf(
<?php $inDowntimeCount = count($objectsInDowntime) ?> $this->translatePlural(
<a href="<?= $inDowntimeLink ?>" title="<?= sprintf( 'List %u service currently in downtime',
$this->translatePlural( 'List %u services currently in downtime',
'List %u service currently in downtime', $inDowntimeCount
'List %u services currently in downtime', ),
$inDowntimeCount $inDowntimeCount
), ),
$inDowntimeCount) ?>"> $inDowntimeLink,
<?= $this->icon('plug'); ?> null,
<?= sprintf( array('icon' => 'plug')
$this->translatePlural( ); ?></h2>
'List %u service currently in downtime', <?php endif ?>
'List %u services currently in downtime', <?php if (($commentCount = count($objects->getComments())) > 0): ?>
$inDowntimeCount <h2><?= $this->qlink(
), sprintf(
$inDowntimeCount $this->translatePlural(
) ?> 'List %u service comment',
</a> 'List %u service comments',
</h2>
<?php endif ?>
<?php $commentCount = count($objects->getComments()) ?>
<?php if ($commentCount): ?>
<h2>
<a href="<?= $commentsLink ?>" title="<?= sprintf(
$this->translatePlural(
'List %u service comment',
'List %u service comments',
$commentCount
),
$commentCount $commentCount
) ?>"> ),
<?= $this->icon('comment'); ?> $commentCount
<?= sprintf( ),
$this->translatePlural( $commentsLink,
'List %u service comment', null,
'List %u service comments', array('icon' => 'comment')
$commentCount ); ?></h2>
), <?php endif ?>
$commentCount
) ?>
</a>
</h2>
<?php endif ?>
<?php endif ?> <?php endif ?>
</div> </div>

View File

@ -35,9 +35,17 @@ if ($object->acknowledged): ?>
); );
} }
?> ?>
<a href="<?= $ackLink ?>" data-base-target="_self"> <?= $this->qlink(
<?= $this->icon('ok') ?> <?= $this->translate('Acknowledge') ?> $this->translate('Acknowledge'),
</a> $ackLink,
null,
array(
'icon' => 'ok',
'title' => $this->translate(
'Acknowledge this problem, suppress all future notifications for it and tag it as being handled'
)
)
); ?>
<?php } else { <?php } else {
echo '&#45;'; echo '&#45;';
} // endif ?> } // endif ?>

View File

@ -28,23 +28,33 @@ if ($object->getType() === $object::TYPE_HOST) {
<td> <td>
<?php if ($this->hasPermission('monitoring/command/schedule-check')) { <?php if ($this->hasPermission('monitoring/command/schedule-check')) {
if ($isService) { if ($isService) {
$reschedule = $this->href( echo $this->qlink(
$this->translate('Reschedule'),
'monitoring/service/reschedule-check', 'monitoring/service/reschedule-check',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()) array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
array(
'icon' => 'reschedule',
'data-base-target' => '_self',
'title' => $this->translate(
'Schedule the next active check at a different time than the current one'
)
)
); );
} else { } else {
$reschedule = $this->href( echo $this->qlink(
$this->translate('Reschedule'),
'monitoring/host/reschedule-check', 'monitoring/host/reschedule-check',
array('host' => $object->getName()) array('host' => $object->getName()),
array(
'icon' => 'reschedule',
'data-base-target' => '_self',
'title' => $this->translate(
'Schedule the next active check at a different time than the current one'
)
)
); );
} }
?> } ?> <?= $this->timeUntil($object->next_check) ?>
<a href="<?= $reschedule ?>" data-base-target="_self">
<?= $this->icon('reschedule') ?>
<?= $this->translate('Reschedule') ?>
</a>
<?php } // endif ?>
<?= $this->timeUntil($object->next_check) ?>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -6,26 +6,35 @@ $command = array_shift($parts);
?> ?>
<tr class="newsection"> <tr class="newsection">
<th><?= $this->translate('Command') ?></th> <th><?= $this->translate('Command'); ?></th>
<td> <td>
<?= $this->escape($command) ?> <?= $this->escape($command); ?>
<?php if ($this->hasPermission('monitoring/command/schedule-check') && $object->passive_checks_enabled): ?> <?php if ($this->hasPermission('monitoring/command/schedule-check') && $object->passive_checks_enabled) {
<?php if ($object->getType() === $object::TYPE_HOST) { $title = sprintf($this->translate('Submit a one time or so called passive result for the %s check'), $command);
$processCheckResult = $this->href( if ($object->getType() === $object::TYPE_HOST) {
echo $this->qlink(
$this->translate('Process check result'),
'monitoring/host/process-check-result', 'monitoring/host/process-check-result',
array('host' => $object->getName()) array('host' => $object->getName()),
array(
'icon' => 'reply',
'data-base-target' => '_self',
'title' => $title
)
); );
} else { } else {
$processCheckResult = $this->href( echo $this->qlink(
$this->translate('Process check result'),
'monitoring/service/process-check-result', 'monitoring/service/process-check-result',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()) array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
array(
'icon' => 'reply',
'data-base-target' => '_self',
'title' => $title
)
); );
} ?> }
<a href="<?= $processCheckResult ?>" data-base-target="_self"> } ?>
<?= $this->icon('reply') ?>
<?= $this->translate('Process check result') ?>
</a>
<?php endif ?>
</td> </td>
</tr> </tr>

View File

@ -1,27 +1,34 @@
<tr> <tr>
<th><?= $this->translate('Comments') ?></th> <th><?= $this->translate('Comments'); ?></th>
<td> <td>
<?php if ($this->hasPermission('monitoring/command/comment/add')) { <?php if ($this->hasPermission('monitoring/command/comment/add')) {
/** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */ /** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */
if ($object->getType() === $object::TYPE_HOST) { if ($object->getType() === $object::TYPE_HOST) {
$addCommentLink = $this->href( echo $this->qlink(
$this->translate('Add comment'),
'monitoring/host/add-comment', 'monitoring/host/add-comment',
array('host' => $object->getName()) array('host' => $object->getName()),
array(
'icon' => 'comment',
'data-base-target' => '_self',
'title' => $this->translate('Add a new comment to this host')
)
); );
} else { } else {
$addCommentLink = $this->href( echo $this->qlink(
$this->translate('Add comment'),
'monitoring/service/add-comment', 'monitoring/service/add-comment',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()) array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
array(
'icon' => 'comment',
'data-base-target' => '_self',
'title' => $this->translate('Add a new comment to this service')
)
); );
} }
?> } else {
<a href="<?= $addCommentLink ?>" data-base-target="_self">
<?= $this->icon('comment') ?>
<?= $this->translate('Add comment') ?>
</a>
<?php } else {
echo '&#45;'; echo '&#45;';
} // endif ?> } ?>
</td> </td>
</tr> </tr>

View File

@ -4,9 +4,12 @@ if (! empty($object->contacts)) {
$list = array(); $list = array();
foreach ($object->contacts as $contact) { foreach ($object->contacts as $contact) {
$list[] = $this->qlink($contact->contact_alias, 'monitoring/show/contact', array( $list[] = $this->qlink(
'contact' => $contact->contact_name $contact->contact_alias,
)); 'monitoring/show/contact',
array('contact' => $contact->contact_name),
array('title' => sprintf($this->translate('Show detailed information about %s'), $contact->contact_alias))
);
} }
printf( printf(
@ -24,7 +27,8 @@ if (! empty($object->contactgroups)) {
$list[] = $this->qlink( $list[] = $this->qlink(
$contactgroup->contactgroup_alias, $contactgroup->contactgroup_alias,
'monitoring/list/contactgroups', 'monitoring/list/contactgroups',
array('contactgroup' => $contactgroup->contactgroup_name) array('contactgroup' => $contactgroup->contactgroup_name),
array('title' => sprintf($this->translate('List contacts in contact-group "%s"'), $contactgroup->contactgroup_alias))
); );
} }

View File

@ -1,27 +1,38 @@
<tr> <tr>
<th><?= $this->translate('Downtimes') ?></th> <th><?= $this->translate('Downtimes'); ?></th>
<td> <td>
<?php if ($this->hasPermission('monitoring/command/downtime/schedule')) { <?php if ($this->hasPermission('monitoring/command/downtime/schedule')) {
/** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */ /** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */
if ($object->getType() === $object::TYPE_HOST) { if ($object->getType() === $object::TYPE_HOST) {
$scheduleDowntimeLink = $this->href( echo $this->qlink(
$this->translate('Schedule downtime'),
'monitoring/host/schedule-downtime', 'monitoring/host/schedule-downtime',
array('host' => $object->getName()) array('host' => $object->getName()),
array(
'icon' => 'plug',
'data-base-target' => '_self',
'title' => $this->translate(
'Schedule a downtime to suppress all problem notifications within a specific period of time'
)
)
); );
} else { } else {
$scheduleDowntimeLink = $this->href( echo $this->qlink(
$this->translate('Schedule downtime'),
'monitoring/service/schedule-downtime', 'monitoring/service/schedule-downtime',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()) array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
array(
'icon' => 'plug',
'data-base-target' => '_self',
'title' => $this->translate(
'Schedule a downtime to suppress all problem notifications within a specific period of time'
)
)
); );
} }
?> } else {
<a href="<?= $scheduleDowntimeLink ?>" data-base-target="_self">
<?= $this->icon('plug') ?>
<?= $this->translate('Schedule downtime') ?>
</a>
<?php } else {
echo '&#45;'; echo '&#45;';
} // endif ?> } ?>
</td> </td>
</tr> </tr>

View File

@ -4,9 +4,12 @@ if (empty($object->hostgroups)) return;
$list = array(); $list = array();
foreach ($object->hostgroups as $name => $alias) { foreach ($object->hostgroups as $name => $alias) {
$list[] = $this->qlink($alias, 'monitoring/list/hosts', array( $list[] = $this->qlink(
'hostgroup' => $name $alias,
)); 'monitoring/list/hosts',
array('hostgroup' => $name),
array('title' => sprintf($this->translate('List all hosts in the group "%s"'), $alias))
);
} }
printf( printf(
"<tr><th>%s</th><td>%s %s</td></tr>\n", "<tr><th>%s</th><td>%s %s</td></tr>\n",

View File

@ -4,9 +4,12 @@ if (empty($object->servicegroups)) return;
$list = array(); $list = array();
foreach ($object->servicegroups as $name => $alias) { foreach ($object->servicegroups as $name => $alias) {
$list[] = $this->qlink($alias, 'monitoring/list/services', array( $list[] = $this->qlink(
'servicegroup' => $name $alias,
)); 'monitoring/list/services',
array('servicegroup' => $name),
array('title' => sprintf($this->translate('List all services in the group "%s"'), $alias))
);
} }
printf( printf(

View File

@ -19,23 +19,27 @@
</tr> </tr>
<?php if ($contact->contact_email): ?> <?php if ($contact->contact_email): ?>
<tr> <tr>
<th><?= mt('monitoring', 'Email') ?></th> <th><?= $this->translate('Email') ?></th>
<td><?= sprintf('<a href="mailto:%1$s">%1$s</a>', $this->escape($contact->contact_email)) ?></td> <td>
<a href="mailto:<?= $contact->contact_email; ?>" title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>" aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>">
<?= $this->escape($contact->contact_email); ?>
</a>
</td>
</tr> </tr>
<?php endif ?> <?php endif ?>
<?php if ($contact->contact_pager): ?> <?php if ($contact->contact_pager): ?>
<tr> <tr>
<th><?= mt('monitoring', 'Pager') ?></th> <th><?= $this->translate('Pager') ?></th>
<td><?= $this->escape($contact->contact_pager) ?></td> <td><?= $this->escape($contact->contact_pager) ?></td>
</tr> </tr>
<?php endif ?> <?php endif ?>
<tr> <tr>
<th><?= mt('monitoring', 'Hosts') ?></th> <th><?= $this->translate('Hosts') ?></th>
<td><?= $this->escape($contactHelper->contactFlags($contact, 'host')) ?><br /> <td><?= $this->escape($contactHelper->contactFlags($contact, 'host')) ?><br />
<?= $this->escape($contact->contact_notify_host_timeperiod) ?></td> <?= $this->escape($contact->contact_notify_host_timeperiod) ?></td>
</tr> </tr>
<tr> <tr>
<th><?= mt('monitoring', 'Services') ?></th> <th><?= $this->translate('Services') ?></th>
<td><?= $this->escape($contactHelper->contactFlags($contact, 'service')) ?><br /> <td><?= $this->escape($contactHelper->contactFlags($contact, 'service')) ?><br />
<?= $this->escape($contact->contact_notify_service_timeperiod) ?></td> <?= $this->escape($contact->contact_notify_service_timeperiod) ?></td>
</tr> </tr>

View File

@ -29,7 +29,12 @@ $hostContext = $object->getType() === 'host';
function contactsLink($match, $view) { function contactsLink($match, $view) {
$links = array(); $links = array();
foreach (preg_split('/,\s/', $match[1]) as $contact) { foreach (preg_split('/,\s/', $match[1]) as $contact) {
$links[] = $view->qlink($contact, 'monitoring/show/contact', array('contact' => $contact)); $links[] = $view->qlink(
$contact,
'monitoring/show/contact',
array('contact' => $contact),
array('title' => sprintf($view->translate('Show detailed information about %s'), $contact))
);
} }
return '[' . implode(', ', $links) . ']'; return '[' . implode(', ', $links) . ']';
} }
@ -136,12 +141,17 @@ $output = $this->tickets ? preg_replace_callback(
<?= sprintf( <?= sprintf(
$this->translate('%s on %s', 'Service running on host'), $this->translate('%s on %s', 'Service running on host'),
$hostContext ? $this->qlink( $hostContext ? $this->qlink(
$this->escape($event->service_display_name), $event->service_display_name,
'monitoring/show/service', 'monitoring/show/service',
array( array(
'host' => $event->host_name, 'host' => $event->host_name,
'service' => $event->service_description 'service' => $event->service_description
) ),
array('title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$event->service_display_name,
$event->host_display_name
))
) : $this->escape($event->service_display_name), ) : $this->escape($event->service_display_name),
$event->host_display_name $event->host_display_name
) ?> ) ?>
@ -150,7 +160,7 @@ $output = $this->tickets ? preg_replace_callback(
<?php endif ?> <?php endif ?>
<br> <br>
<div> <div>
<?= $this->icon($icon, $title); ?> <?= empty($msg) ? '' : $this->escape($msg) ?> <?= $this->icon($icon, $title); ?> <?= empty($msg) ? '' : $msg; ?>
</div> </div>
</td> </td>
</tr> </tr>

View File

@ -12,66 +12,114 @@
<tr> <tr>
<td> <td>
<?php if ($this->statusSummary->hosts_active): ?> <?php if ($this->statusSummary->hosts_active): ?>
<div class="box entry"> <div class="box entry"><?= $this->qlink(
<a href="<?= $this->href( sprintf(
'monitoring/list/hosts', $this->translatePlural('%u Active', '%u Active', $this->statusSummary->hosts_active),
array('host_active_checks_enabled' => 1) $this->statusSummary->hosts_active
); ?>"> ),
<?= sprintf($this->translatePlural('%d Active', '%d Active', $this->statusSummary->hosts_active), $this->statusSummary->hosts_active); ?> 'monitoring/list/hosts',
</a> array('host_active_checks_enabled' => 1),
</div> array('title' => sprintf(
$this->translatePlural(
'List %u actively checked host',
'List %u actively checked hosts',
$this->statusSummary->hosts_active
),
$this->statusSummary->hosts_active
))
); ?></div>
<?php endif ?> <?php endif ?>
<?php if ($this->statusSummary->hosts_passive): ?> <?php if ($this->statusSummary->hosts_passive): ?>
<div class="box entry"> <div class="box entry"><?= $this->qlink(
<a href="<?= $this->href( sprintf(
'monitoring/list/hosts', $this->translatePlural('%d Passive', '%d Passive', $this->statusSummary->hosts_passive),
array('host_active_checks_enabled' => 0, 'host_passive_checks_enabled' => 1) $this->statusSummary->hosts_passive
); ?>"> ),
<?= sprintf($this->translatePlural('%d Passive', '%d Passive', $this->statusSummary->hosts_passive), $this->statusSummary->hosts_passive); ?> 'monitoring/list/hosts',
</a> array('host_active_checks_enabled' => 0, 'host_passive_checks_enabled' => 1),
</div> array('title' => sprintf(
$this->translatePlural(
'List %u passively checked host',
'List %u passively checked hosts',
$this->statusSummary->hosts_passive
),
$this->statusSummary->hosts_passive
))
); ?></div>
<?php endif ?> <?php endif ?>
<?php if ($this->statusSummary->hosts_not_checked): ?> <?php if ($this->statusSummary->hosts_not_checked): ?>
<div class="box entry"> <div class="box entry"><?= $this->qlink(
<a href="<?= $this->href( sprintf(
'monitoring/list/hosts', $this->translatePlural('%d Disabled', '%d Disabled', $this->statusSummary->hosts_not_checked),
array('host_active_checks_enabled' => 0, 'host_passive_checks_enabled' => 0) $this->statusSummary->hosts_not_checked
); ?>" style="color: red;"> ),
<?= sprintf($this->translatePlural('%d Disabled', '%d Disabled', $this->statusSummary->hosts_not_checked), $this->statusSummary->hosts_not_checked); ?> 'monitoring/list/hosts',
</a> array('host_active_checks_enabled' => 0, 'host_passive_checks_enabled' => 0),
</div> array('title' => sprintf(
$this->translatePlural(
'List %u host that is not being checked at all',
'List %u hosts which are not being checked at all',
$this->statusSummary->hosts_not_checked
),
$this->statusSummary->hosts_not_checked
))
); ?></div>
<?php endif ?> <?php endif ?>
</td> </td>
<td> <td>
<?php if ($this->statusSummary->services_active): ?> <?php if ($this->statusSummary->services_active): ?>
<div class="box entry"> <div class="box entry"><?= $this->qlink(
<a href="<?= $this->href( sprintf(
'monitoring/list/services', $this->translatePlural('%d Active', '%d Active', $this->statusSummary->services_active),
array('service_active_checks_enabled' => 1) $this->statusSummary->services_active
); ?>"> ),
<?= sprintf($this->translatePlural('%d Active', '%d Active', $this->statusSummary->services_active), $this->statusSummary->services_active); ?> 'monitoring/list/services',
</a> array('service_active_checks_enabled' => 1),
</div> array('title' => sprintf(
$this->translatePlural(
'List %u actively checked service',
'List %u actively checked services',
$this->statusSummary->services_active
),
$this->statusSummary->services_active
))
); ?></div>
<?php endif ?> <?php endif ?>
<?php if ($this->statusSummary->services_passive): ?> <?php if ($this->statusSummary->services_passive): ?>
<div class="box entry"> <div class="box entry"><?= $this->qlink(
<a href="<?= $this->href( sprintf(
'monitoring/list/services', $this->translatePlural('%d Passive', '%d Passive', $this->statusSummary->services_passive),
array('service_active_checks_enabled' => 0, 'service_passive_checks_enabled' => 1) $this->statusSummary->services_passive
); ?>"> ),
<?= sprintf($this->translatePlural('%d Passive', '%d Passive', $this->statusSummary->services_passive), $this->statusSummary->services_passive); ?> 'monitoring/list/services',
</a> array('service_active_checks_enabled' => 0, 'service_passive_checks_enabled' => 1),
</div> array('title' => sprintf(
$this->translatePlural(
'List %u passively checked service',
'List %u passively checked services',
$this->statusSummary->services_passive
),
$this->statusSummary->services_passive
))
); ?></div>
<?php endif ?> <?php endif ?>
<?php if ($this->statusSummary->services_not_checked): ?> <?php if ($this->statusSummary->services_not_checked): ?>
<div class="box entry"> <div class="box entry"><?= $this->qlink(
<a href="<?= $this->href( sprintf(
'monitoring/list/services', $this->translatePlural('%d Disabled', '%d Disabled', $this->statusSummary->services_not_checked),
array('service_active_checks_enabled' => 0, 'service_passive_checks_enabled' => 0) $this->statusSummary->services_not_checked
); ?>" style="color: red;"> ),
<?= sprintf($this->translatePlural('%d Disabled', '%d Disabled', $this->statusSummary->services_not_checked), $this->statusSummary->services_not_checked); ?> 'monitoring/list/services',
</a> array('service_active_checks_enabled' => 0, 'service_passive_checks_enabled' => 0),
</div> array('title' => sprintf(
$this->translatePlural(
'List %u service that is not being checked at all',
'List %u services which are not being checked at all',
$this->statusSummary->services_not_checked
),
$this->statusSummary->services_not_checked
))
); ?></div>
<?php endif ?> <?php endif ?>
</td> </td>
</tr> </tr>

View File

@ -11,58 +11,112 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
<div class="box entry">
<?php if ($this->statusSummary->hosts_without_flap_detection): ?> <?php if ($this->statusSummary->hosts_without_flap_detection): ?>
<div class="box entry"> <?= $this->qlink(
<a href="<?= $this->href( sprintf(
$this->translatePlural('%u Host Disabled', '%u Hosts Disabled', $this->statusSummary->hosts_without_flap_detection),
$this->statusSummary->hosts_without_flap_detection
),
'monitoring/list/hosts', 'monitoring/list/hosts',
array('host_flap_detection_enabled' => 0) array('host_flap_detection_enabled' => 0),
); ?>" class="feature-highlight"> array(
<?= sprintf($this->translatePlural('%d Host Disabled', '%d Hosts Disabled', $this->statusSummary->hosts_without_flap_detection), $this->statusSummary->hosts_without_flap_detection); ?> 'class' => 'feature-highlight',
</a> 'title' => sprintf(
$this->translatePlural(
'List %u host for which flap detection has been disabled',
'List %u hosts for which flap detection has been disabled',
$this->statusSummary->hosts_without_flap_detection
),
$this->statusSummary->hosts_without_flap_detection
)
)
); ?>
<?php else: ?> <?php else: ?>
<div class="box entry"> <?= $this->qlink(
<a href="<?= $this->href( $this->translate('All Hosts Enabled'),
'monitoring/list/hosts', 'monitoring/list/hosts',
array('host_flap_detection_enabled' => 1) array('host_flap_detection_enabled' => 1),
); ?>"> array('title' => $this->translate(
<?= $this->translate('All Hosts Enabled'); ?> 'List all hosts, for which flap detection is enabled entirely'
</a> ))
); ?>
<?php endif ?> <?php endif ?>
<?php if ($this->statusSummary->hosts_flapping): ?> <?php if ($this->statusSummary->hosts_flapping): ?>
<a href="<?= $this->href( <?= $this->qlink(
sprintf(
$this->translatePlural('%u Host Flapping', '%u Hosts Flapping', $this->statusSummary->hosts_flapping),
$this->statusSummary->hosts_flapping
),
'monitoring/list/hosts', 'monitoring/list/hosts',
array('host_is_flapping' => 1) array('host_is_flapping' => 1),
); ?>" class="feature-highlight"> array(
<?= sprintf($this->translatePlural('%d Host Flapping', '%d Hosts Flapping', $this->statusSummary->hosts_flapping), $this->statusSummary->hosts_flapping); ?> 'class' => 'feature-highlight',
</a> 'title' => sprintf(
$this->translatePlural(
'List %u host that is currently flapping',
'List %u hosts which are currently flapping',
$this->statusSummary->hosts_flapping
),
$this->statusSummary->hosts_flapping
)
)
); ?>
<?php endif ?> <?php endif ?>
</div> </div>
</td> </td>
<td> <td>
<div class="box entry">
<?php if ($this->statusSummary->services_without_flap_detection): ?> <?php if ($this->statusSummary->services_without_flap_detection): ?>
<div class="box entry"> <?= $this->qlink(
<a href="<?= $this->href( sprintf(
$this->translatePlural('%u Service Disabled', '%u Services Disabled', $this->statusSummary->services_without_flap_detection),
$this->statusSummary->services_without_flap_detection
),
'monitoring/list/services', 'monitoring/list/services',
array('service_flap_detection_enabled' => 0) array('service_flap_detection_enabled' => 0),
); ?>" class="feature-highlight"> array(
<?= sprintf($this->translatePlural('%d Service Disabled', '%d Services Disabled', $this->statusSummary->services_without_flap_detection), $this->statusSummary->services_without_flap_detection); ?> 'class' => 'feature-highlight',
</a> 'title' => sprintf(
$this->translatePlural(
'List %u service for which flap detection has been disabled',
'List %u services for which flap detection has been disabled',
$this->statusSummary->services_without_flap_detection
),
$this->statusSummary->services_without_flap_detection
)
)
); ?>
<?php else: ?> <?php else: ?>
<div class="box entry"> <?= $this->qlink(
<a href="<?= $this->href( $this->translate('All Services Enabled'),
'monitoring/list/services', 'monitoring/list/services',
array('service_flap_detection_enabled' => 1) array('service_flap_detection_enabled' => 1),
); ?>"> array('title' => $this->translate(
<?= $this->translate('All Services Enabled'); ?> 'List all services, for which flap detection is enabled entirely'
</a> ))
); ?>
<?php endif ?> <?php endif ?>
<?php if ($this->statusSummary->services_flapping): ?> <?php if ($this->statusSummary->services_flapping): ?>
<a href="<?= $this->href( <?= $this->qlink(
sprintf(
$this->translatePlural('%u Service Flapping', '%u Services Flapping', $this->statusSummary->services_flapping),
$this->statusSummary->services_flapping
),
'monitoring/list/services', 'monitoring/list/services',
array('service_is_flapping' => 1) array('service_is_flapping' => 1),
); ?>" class="feature-highlight"> array(
<?= sprintf($this->translatePlural('%d Service Flapping', '%d Services Flapping', $this->statusSummary->services_flapping), $this->statusSummary->services_flapping); ?> 'class' => 'feature-highlight',
</a> 'title' => sprintf(
$this->translatePlural(
'List %u service that is currently flapping',
'List %u services which are currently flapping',
$this->statusSummary->services_flapping
),
$this->statusSummary->services_flapping
)
)
); ?>
<?php endif ?> <?php endif ?>
</div> </div>
</td> </td>
@ -78,42 +132,70 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
<div class="box entry">
<?php if ($this->statusSummary->hosts_not_triggering_notifications): ?> <?php if ($this->statusSummary->hosts_not_triggering_notifications): ?>
<div class="box entry "> <?= $this->qlink(
<a href="<?= $this->href( sprintf(
$this->translatePlural('%u Host Disabled', '%u Hosts Disabled', $this->statusSummary->hosts_not_triggering_notifications),
$this->statusSummary->hosts_not_triggering_notifications
),
'monitoring/list/hosts', 'monitoring/list/hosts',
array('host_notifications_enabled' => 0) array('host_notifications_enabled' => 0),
); ?>" class="feature-highlight"> array(
<?= sprintf($this->translatePlural('%d Host Disabled', '%d Hosts Disabled', $this->statusSummary->hosts_not_triggering_notifications), $this->statusSummary->hosts_not_triggering_notifications); ?> 'class' => 'feature-highlight',
</a> 'title' => sprintf(
$this->translatePlural(
'List %u host for which notifications are suppressed',
'List %u hosts for which notifications are suppressed',
$this->statusSummary->hosts_not_triggering_notifications
),
$this->statusSummary->hosts_not_triggering_notifications
)
)
); ?>
<?php else: ?> <?php else: ?>
<div class="box entry "> <?= $this->qlink(
<a href="<?= $this->href( $this->translate('All Hosts Enabled'),
'monitoring/list/hosts', 'monitoring/list/hosts',
array('host_notifications_enabled' => 1) array('host_notifications_enabled' => 1),
); ?>"> array('title' => $this->translate(
<?= $this->translate('All Hosts Enabled'); ?> 'List all hosts, for which notifications are enabled entirely'
</a> ))
); ?>
<?php endif ?> <?php endif ?>
</div> </div>
</td> </td>
<td> <td>
<div class="box entry">
<?php if ($this->statusSummary->services_not_triggering_notifications): ?> <?php if ($this->statusSummary->services_not_triggering_notifications): ?>
<div class="box entry"> <?= $this->qlink(
<a href="<?= $this->href( sprintf(
$this->translatePlural('%u Service Disabled', '%u Services Disabled', $this->statusSummary->services_not_triggering_notifications),
$this->statusSummary->services_not_triggering_notifications
),
'monitoring/list/services', 'monitoring/list/services',
array('service_notifications_enabled' => 0) array('service_notifications_enabled' => 0),
); ?>" class="feature-highlight"> array(
<?= sprintf($this->translatePlural('%d Service Disabled', '%d Services Disabled', $this->statusSummary->services_not_triggering_notifications), $this->statusSummary->services_not_triggering_notifications); ?> 'class' => 'feature-highlight',
</a> 'title' => sprintf(
$this->translatePlural(
'List %u service for which notifications are suppressed',
'List %u services for which notifications are suppressed',
$this->statusSummary->services_not_triggering_notifications
),
$this->statusSummary->services_not_triggering_notifications
)
)
); ?>
<?php else: ?> <?php else: ?>
<div class="box entry"> <?= $this->qlink(
<a href="<?= $this->href( $this->translate('All Services Enabled'),
'monitoring/list/services', 'monitoring/list/services',
array('service_notifications_enabled' => 1) array('service_notifications_enabled' => 1),
); ?>"> array('title' => $this->translate(
<?= $this->translate('All Services Enabled'); ?> 'List all services, for which notifications are enabled entirely'
</a> ))
); ?>
<?php endif ?> <?php endif ?>
</div> </div>
</td> </td>
@ -129,42 +211,70 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
<div class="box entry">
<?php if ($this->statusSummary->hosts_not_processing_event_handlers): ?> <?php if ($this->statusSummary->hosts_not_processing_event_handlers): ?>
<div class="box entry"> <?= $this->qlink(
<a href="<?= $this->href( sprintf(
$this->translatePlural('%u Host Disabled', '%u Hosts Disabled', $this->statusSummary->hosts_not_processing_event_handlers),
$this->statusSummary->hosts_not_processing_event_handlers
),
'monitoring/list/hosts', 'monitoring/list/hosts',
array('host_event_handler_enabled' => 0) array('host_event_handler_enabled' => 0),
); ?>" class="feature-highlight"> array(
<?= sprintf($this->translatePlural('%d Host Disabled', '%d Hosts Disabled', $this->statusSummary->hosts_not_processing_event_handlers), $this->statusSummary->hosts_not_processing_event_handlers); ?> 'class' => 'feature-highlight',
</a> 'title' => sprintf(
$this->translatePlural(
'List %u host that is not processing any event handlers',
'List %u hosts which are not processing any event handlers',
$this->statusSummary->hosts_not_processing_event_handlers
),
$this->statusSummary->hosts_not_processing_event_handlers
)
)
); ?>
<?php else: ?> <?php else: ?>
<div class="box entry"> <?= $this->qlink(
<a href="<?= $this->href( $this->translate('All Hosts Enabled'),
'monitoring/list/hosts', 'monitoring/list/hosts',
array('host_event_handler_enabled' => 1) array('host_event_handler_enabled' => 1),
); ?>"> array('title' => $this->translate(
<?= $this->translate('All Hosts Enabled'); ?> 'List all hosts, which are processing event handlers entirely'
</a> ))
); ?>
<?php endif ?> <?php endif ?>
</div> </div>
</td> </td>
<td> <td>
<div class="box entry">
<?php if ($this->statusSummary->services_not_processing_event_handlers): ?> <?php if ($this->statusSummary->services_not_processing_event_handlers): ?>
<div class="box entry"> <?= $this->qlink(
<a href="<?= $this->href( sprintf(
$this->translatePlural('%u Service Disabled', '%u Services Disabled', $this->statusSummary->services_not_processing_event_handlers),
$this->statusSummary->services_not_processing_event_handlers
),
'monitoring/list/services', 'monitoring/list/services',
array('service_event_handler_enabled' => 0) array('service_event_handler_enabled' => 0),
); ?>" class="feature-highlight"> array(
<?= sprintf($this->translatePlural('%d Service Disabled', '%d Services Disabled', $this->statusSummary->services_not_processing_event_handlers), $this->statusSummary->services_not_processing_event_handlers); ?> 'class' => 'feature-highlight',
</a> 'title' => sprintf(
$this->translatePlural(
'List %u service that is not processing any event handlers',
'List %u services which are not processing any event handlers',
$this->statusSummary->services_not_processing_event_handlers
),
$this->statusSummary->services_not_processing_event_handlers
)
)
); ?>
<?php else: ?> <?php else: ?>
<div class="box entry"> <?= $this->qlink(
<a href="<?= $this->href( $this->translate('All Services Enabled'),
'monitoring/list/services', 'monitoring/list/services',
array('service_event_handler_enabled' => 1) array('service_event_handler_enabled' => 1),
); ?>"> array('title' => $this->translate(
<?= $this->translate('All Services Enabled'); ?> 'List all services, which are processing event handlers entirely'
</a> ))
); ?>
<?php endif ?> <?php endif ?>
</div> </div>
</td> </td>

View File

@ -10,18 +10,40 @@ $service_problems = (
?> ?>
<div class="box ok_hosts state_<?= $this->statusSummary->hosts_up ? 'up' : 'pending'; ?>"> <div class="box ok_hosts state_<?= $this->statusSummary->hosts_up ? 'up' : 'pending'; ?>">
<?php if ($this->statusSummary->hosts_up): ?> <?php if ($this->statusSummary->hosts_up): ?>
<h2> <h2><?= $this->qlink(
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 0)); ?>"> sprintf(
<?= sprintf($this->translatePlural('%d Host UP', '%d Hosts UP', $this->statusSummary->hosts_up), $this->statusSummary->hosts_up); ?> $this->translatePlural('%u Host UP', '%u Hosts UP', $this->statusSummary->hosts_up),
</a> $this->statusSummary->hosts_up
</h2> ),
'monitoring/list/hosts',
array('host_state' => 0),
array('title' => sprintf(
$this->translatePlural(
'List %u host that is currently in state UP',
'List %u hosts which are currently in state UP',
$this->statusSummary->hosts_up
),
$this->statusSummary->hosts_up
))
); ?></h2>
<?php endif ?> <?php endif ?>
<?php if ($this->statusSummary->hosts_pending): ?> <?php if ($this->statusSummary->hosts_pending): ?>
<h2> <h2><?= $this->qlink(
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 99)); ?>"> sprintf(
<?= sprintf($this->translatePlural('%d Host PENDING', '%d Hosts PENDING', $this->statusSummary->hosts_pending), $this->statusSummary->hosts_pending); ?> $this->translatePlural('%u Host PENDING', '%u Hosts PENDING', $this->statusSummary->hosts_pending),
</a> $this->statusSummary->hosts_pending
</h2> ),
'monitoring/list/hosts',
array('host_state' => 99),
array('title' => sprintf(
$this->translatePlural(
'List %u host that is currently in state PENDING',
'List %u hosts which are currently in state PENDING',
$this->statusSummary->hosts_pending
),
$this->statusSummary->hosts_pending
))
); ?></h2>
<?php endif ?> <?php endif ?>
<?php if ($service_problems || $this->statusSummary->hosts_down || $this->statusSummary->hosts_unreachable): ?> <?php if ($service_problems || $this->statusSummary->hosts_down || $this->statusSummary->hosts_unreachable): ?>
<div class="box contents"> <div class="box contents">

View File

@ -1,280 +1,396 @@
<?php
use Icinga\Module\Monitoring\Object\Service;
?>
<?php if ($services_critical_handled || $services_critical_unhandled): ?> <?php if ($services_critical_handled || $services_critical_unhandled): ?>
<div class="box entry state_critical <?= $services_critical_unhandled ? '' : 'handled'; ?>"> <div class="box entry state_<?= Service::getStateText(2); ?> <?= $services_critical_unhandled ? '' : 'handled'; ?>">
<?php if ($services_critical_unhandled): ?> <?php if ($services_critical_unhandled): ?>
<a href="<?= $this->href( <?= $this->qlink(
$services_critical_unhandled . ' ' . Service::getStateText(2, true),
'monitoring/list/services', 'monitoring/list/services',
array('host_problem' => $host_problem, 'service_state' => 2, 'service_acknowledged' => 0, 'service_in_downtime' => 0) array(
); ?>"> 'host_problem' => $host_problem,
<?= sprintf($this->translatePlural('%d CRITICAL', '%d CRITICAL', $services_critical_unhandled, 'icinga.state'), $services_critical_unhandled); ?> 'service_state' => 2,
</a> 'service_acknowledged' => 0,
'service_in_downtime' => 0
),
array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state CRITICAL',
'List %u services which are currently in state CRITICAL',
$services_critical_unhandled
),
$services_critical_unhandled
))
); ?>
<?php endif ?> <?php endif ?>
<?php if ($services_critical_handled): ?> <?php if ($services_critical_handled): ?>
<a href="<?= $this->href( <?= $this->qlink(
$services_critical_handled . ' ' . (
$services_critical_unhandled ? $this->translate('Acknowledged') : Service::getStateText(2, true)
),
'monitoring/list/services', 'monitoring/list/services',
array('host_problem' => $host_problem, 'service_state' => 2, 'service_handled' => 1) array(
); ?>"> 'host_problem' => $host_problem,
<?= $services_critical_handled . ' ' . ($services_critical_unhandled ? $this->translate('Acknowledged') : $this->translate('CRITICAL', 'icinga.state')); ?> 'service_state' => 2,
</a> 'service_handled' => 1
),
array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state CRITICAL (Acknowledged)',
'List %u services which are currently in state CRITICAL (Acknowledged)',
$services_critical_handled
),
$services_critical_handled
))
); ?>
<?php endif ?> <?php endif ?>
<?php if ($services_critical_passive): ?> <?php if ($services_critical_passive): ?>
<a href="<?= $this->href( <?= $this->qlink(
sprintf(
$this->translatePlural(
'%u is passively checked',
'%u are passively checked',
$services_critical_passive
),
$services_critical_passive
),
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 2, 'service_state' => 2,
'host_problem' => $host_problem, 'host_problem' => $host_problem,
'service_active_checks_enabled' => 0, 'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 1 'service_passive_checks_enabled' => 1
) ),
); ?>"> array('title' => sprintf(
<?php $this->translatePlural(
if ($services_critical_passive > 1) { 'List %u service that is currently in state CRITICAL and passively checked',
printf( 'List %u services which are currently in state CRITICAL and passively checked',
$this->translate('%d are passively checked'), $services_critical_passive
$services_critical_passive ),
); $services_critical_passive
} else { ))
printf( ); ?>
$this->translate('%d is passively checked'),
$services_critical_passive
);
}
?>
</a>
<?php endif ?> <?php endif ?>
<?php if ($services_critical_not_checked): ?> <?php if ($services_critical_not_checked): ?>
<a href="<?= $this->href( <?= $this->qlink(
sprintf(
$this->translatePlural(
'%u is not checked at all',
'%u are not checked at all',
$services_critical_not_checked
),
$services_critical_not_checked
),
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 2, 'service_state' => 2,
'host_problem' => $host_problem, 'host_problem' => $host_problem,
'service_active_checks_enabled' => 0, 'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0 'service_passive_checks_enabled' => 0
) ),
); ?>"> array('title' => sprintf(
<?php $this->translatePlural(
if ($services_critical_not_checked > 1) { 'List %u service that is currently in state CRITICAL and not checked at all',
printf( 'List %u services which are currently in state CRITICAL and not checked at all',
$this->translate('%d are not checked at all'), $services_critical_not_checked
$services_critical_not_checked ),
); $services_critical_not_checked
} else { ))
printf( ); ?>
$this->translate('%d is not checked at all'),
$services_critical_not_checked
);
}
?>
</a>
<?php endif ?> <?php endif ?>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if ($services_warning_handled || $services_warning_unhandled): ?> <?php if ($services_warning_handled || $services_warning_unhandled): ?>
<div class="box entry state_warning <?= $services_warning_unhandled ? '' : 'handled'; ?>"> <div class="box entry state_<?= Service::getStateText(1); ?> <?= $services_warning_unhandled ? '' : 'handled'; ?>">
<?php if ($services_warning_unhandled): ?> <?php if ($services_warning_unhandled): ?>
<a href="<?= $this->href( <?= $this->qlink(
$services_warning_unhandled . ' ' . Service::getStateText(1, true),
'monitoring/list/services', 'monitoring/list/services',
array('host_problem' => $host_problem, 'service_state' => 1, 'service_acknowledged' => 0, 'service_in_downtime' => 0) array(
); ?>"> 'host_problem' => $host_problem,
<?= $services_warning_unhandled; ?> <?= $this->translate('WARNING', 'icinga.state') ?> 'service_state' => 1,
</a> 'service_acknowledged' => 0,
'service_in_downtime' => 0
),
array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state WARNING',
'List %u services which are currently in state WARNING',
$services_warning_unhandled
),
$services_warning_unhandled
))
); ?>
<?php endif ?> <?php endif ?>
<?php if ($services_warning_handled): ?> <?php if ($services_warning_handled): ?>
<a href="<?= $this->href( <?= $this->qlink(
$services_warning_handled . ' ' . (
$services_warning_unhandled ? $this->translate('Acknowledged') : Service::getStateText(1, true)
),
'monitoring/list/services', 'monitoring/list/services',
array('host_problem' => $host_problem, 'service_state' => 1, 'service_handled' => 1) array(
); ?>"> 'host_problem' => $host_problem,
<?= $services_warning_handled . ' ' . ($services_warning_unhandled ? $this->translate('Acknowledged') : $this->translate('WARNING', 'icinga.state')); ?> 'service_state' => 1,
</a> 'service_handled' => 1
),
array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state WARNING (Acknowledged)',
'List %u services which are currently in state WARNING (Acknowledged)',
$services_warning_handled
),
$services_warning_handled
))
); ?>
<?php endif ?> <?php endif ?>
<?php if ($services_warning_passive): ?> <?php if ($services_warning_passive): ?>
<a href="<?= $this->href( <?= $this->qlink(
sprintf(
$this->translatePlural(
'%u is passively checked',
'%u are passively checked',
$services_warning_passive
),
$services_warning_passive
),
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 1, 'service_state' => 1,
'host_problem' => $host_problem, 'host_problem' => $host_problem,
'service_active_checks_enabled' => 0, 'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 1 'service_passive_checks_enabled' => 1
) ),
); ?>"> array('title' => sprintf(
<?php $this->translatePlural(
if ($services_warning_passive > 1) { 'List %u service that is currently in state WARNING and passively checked',
printf( 'List %u services which are currently in state WARNING and passively checked',
$this->translate('%d are passively checked'), $services_warning_passive
$services_warning_passive ),
); $services_warning_passive
} else { ))
printf( ); ?>
$this->translate('%d is passively checked'),
$services_warning_passive
);
}
?>
</a>
<?php endif ?> <?php endif ?>
<?php if ($services_warning_not_checked): ?> <?php if ($services_warning_not_checked): ?>
<a href="<?= $this->href( <?= $this->qlink(
sprintf(
$this->translatePlural(
'%u is not checked at all',
'%u are not checked at all',
$services_warning_not_checked
),
$services_warning_not_checked
),
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 1, 'service_state' => 1,
'host_problem' => $host_problem, 'host_problem' => $host_problem,
'service_active_checks_enabled' => 0, 'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0 'service_passive_checks_enabled' => 0
) ),
); ?>"> array('title' => sprintf(
<?php $this->translatePlural(
if ($services_warning_not_checked > 1) { 'List %u service that is currently in state WARNING and not checked at all',
printf( 'List %u services which are currently in state WARNING and not checked at all',
$this->translate('%d are not checked at all'), $services_warning_not_checked
$services_warning_not_checked ),
); $services_warning_not_checked
} else { ))
printf( ); ?>
$this->translate('%d is not checked at all'),
$services_warning_not_checked
);
}
?>
</a>
<?php endif ?> <?php endif ?>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if ($services_unknown_handled || $services_unknown_unhandled): ?> <?php if ($services_unknown_handled || $services_unknown_unhandled): ?>
<div class="box entry state_unknown <?= $services_unknown_unhandled ? '' : 'handled'; ?>"> <div class="box entry state_<?= Service::getStateText(3); ?> <?= $services_unknown_unhandled ? '' : 'handled'; ?>">
<?php if ($services_unknown_unhandled): ?> <?php if ($services_unknown_unhandled): ?>
<a href="<?= $this->href( <?= $this->qlink(
$services_unknown_unhandled . ' ' . Service::getStateText(3, true),
'monitoring/list/services', 'monitoring/list/services',
array('host_problem' => $host_problem, 'service_state' => 3, 'service_acknowledged' => 0, 'service_in_downtime' => 0) array(
); ?>"> 'host_problem' => $host_problem,
<?= sprintf($this->translatePlural('%d UNKNOWN', '%d UNKNOWN', $services_unknown_unhandled, 'icinga.state'), $services_unknown_unhandled) ?> 'service_state' => 3,
</a> 'service_acknowledged' => 0,
'service_in_downtime' => 0
),
array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state UNKNOWN',
'List %u services which are currently in state UNKNOWN',
$services_unknown_unhandled
),
$services_unknown_unhandled
))
); ?>
<?php endif ?> <?php endif ?>
<?php if ($services_unknown_handled): ?> <?php if ($services_unknown_handled): ?>
<a href="<?= $this->href( <?= $this->qlink(
$services_unknown_handled . ' ' . (
$services_unknown_unhandled ? $this->translate('Acknowledged') : Service::getStateText(3, true)
),
'monitoring/list/services', 'monitoring/list/services',
array('host_problem' => $host_problem, 'service_state' => 3, 'service_handled' => 1) array(
); ?>"> 'host_problem' => $host_problem,
<?= $services_unknown_handled . ' ' . ($services_unknown_unhandled ? $this->translate('Acknowledged') : $this->translate('UNKNOWN', 'icinga.state')); ?> 'service_state' => 3,
</a> 'service_handled' => 1
),
array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state UNKNOWN (Acknowledged)',
'List %u services which are currently in state UNKNOWN (Acknowledged)',
$services_unknown_handled
),
$services_unknown_handled
))
); ?>
<?php endif ?> <?php endif ?>
<?php if ($services_unknown_passive): ?> <?php if ($services_unknown_passive): ?>
<a href="<?= $this->href( <?= $this->qlink(
sprintf(
$this->translatePlural(
'%u is passively checked',
'%u are passively checked',
$services_unknown_passive
),
$services_unknown_passive
),
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 3, 'service_state' => 3,
'host_problem' => $host_problem, 'host_problem' => $host_problem,
'service_active_checks_enabled' => 0, 'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 1 'service_passive_checks_enabled' => 1
) ),
); ?>"> array('title' => sprintf(
<?php $this->translatePlural(
if ($services_unknown_passive > 1) { 'List %u service that is currently in state UNKNOWN and passively checked',
printf( 'List %u services which are currently in state UNKNOWN and passively checked',
$this->translate('%d are passively checked'), $services_unknown_passive
$services_unknown_passive ),
); $services_unknown_passive
} else { ))
printf( ); ?>
$this->translate('%d is passively checked'),
$services_unknown_passive
);
}
?>
</a>
<?php endif ?> <?php endif ?>
<?php if ($services_unknown_not_checked): ?> <?php if ($services_unknown_not_checked): ?>
<a href="<?= $this->href( <?= $this->qlink(
sprintf(
$this->translatePlural(
'%u is not checked at all',
'%u are not checked at all',
$services_unknown_not_checked
),
$services_unknown_not_checked
),
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 3, 'service_state' => 3,
'host_problem' => $host_problem, 'host_problem' => $host_problem,
'service_active_checks_enabled' => 0, 'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0 'service_passive_checks_enabled' => 0
) ),
); ?>"> array('title' => sprintf(
<?php $this->translatePlural(
if ($services_unknown_not_checked > 1) { 'List %u service that is currently in state UNKNOWN and not checked at all',
printf( 'List %u services which are currently in state UNKNOWN and not checked at all',
$this->translate('%d are not checked at all'), $services_unknown_not_checked
$services_unknown_not_checked ),
); $services_unknown_not_checked
} else { ))
printf( ); ?>
$this->translate('%d is not checked at all'),
$services_unknown_not_checked
);
}
?>
</a>
<?php endif ?> <?php endif ?>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if ($services_ok): ?> <?php if ($services_ok): ?>
<div class="box entry state_ok"> <div class="box entry state_<?= Service::getStateText(0); ?>">
<a href="<?= $this->href( <?= $this->qlink(
$services_ok . ' ' . Service::getStateText(0, true),
'monitoring/list/services', 'monitoring/list/services',
array('host_problem' => $host_problem, 'service_state' => 0) array(
); ?>"> 'host_problem' => $host_problem,
<?= $services_ok; ?> <?= $this->translate('OK', 'icinga.state') ?> 'service_state' => 0
</a> ),
array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state OK',
'List %u services which are currently in state OK',
$services_ok
),
$services_ok
))
); ?>
<?php if ($services_ok_not_checked): ?> <?php if ($services_ok_not_checked): ?>
<a href="<?= $this->href( <?= $this->qlink(
sprintf(
$this->translatePlural(
'%u is not checked at all',
'%u are not checked at all',
$services_ok_not_checked
),
$services_ok_not_checked
),
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 0, 'service_state' => 0,
'host_problem' => $host_problem, 'host_problem' => $host_problem,
'service_active_checks_enabled' => 0, 'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0 'service_passive_checks_enabled' => 0
) ),
); ?>"> array('title' => sprintf(
<?php $this->translatePlural(
if ($services_ok_not_checked > 1) { 'List %u service that is currently in state OK and not checked at all',
printf( 'List %u services which are currently in state OK and not checked at all',
$this->translate('%d are not checked at all'), $services_ok_not_checked
$services_ok_not_checked ),
); $services_ok_not_checked
} else { ))
printf( ); ?>
$this->translate('%d is not checked at all'),
$services_ok_not_checked
);
}
?>
</a>
<?php endif ?> <?php endif ?>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if ($services_pending): ?> <?php if ($services_pending): ?>
<div class="box entry state_pending"> <div class="box entry state_<?= Service::getStateText(99); ?>">
<a href="<?= $this->href( <?= $this->qlink(
$services_pending . ' ' . Service::getStateText(99, true),
'monitoring/list/services', 'monitoring/list/services',
array('host_problem' => $host_problem, 'service_state' => 99) array(
); ?>"> 'host_problem' => $host_problem,
<?= sprintf($this->translatePlural('%d PENDING', '%d PENDING', $services_pending, 'icinga.state'), $services_pending); ?> 'service_state' => 99
</a> ),
array('title' => sprintf(
$this->translatePlural(
'List %u service that is currently in state PENDING',
'List %u services which are currently in state PENDING',
$services_pending
),
$services_pending
))
); ?>
<?php if ($services_pending_not_checked): ?> <?php if ($services_pending_not_checked): ?>
<a href="<?= $this->href( <?= $this->qlink(
sprintf(
$this->translatePlural(
'%u is not checked at all',
'%u are not checked at all',
$services_pending_not_checked
),
$services_pending_not_checked
),
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 99, 'service_state' => 99,
'host_problem' => $host_problem, 'host_problem' => $host_problem,
'service_active_checks_enabled' => 0, 'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0 'service_passive_checks_enabled' => 0
) ),
); ?>"> array('title' => sprintf(
<?php $this->translatePlural(
if ($services_pending_not_checked > 1) { 'List %u service that is currently in state PENDING and not checked at all',
printf( 'List %u services which are currently in state PENDING and not checked at all',
$this->translate('%d are not checked at all'), $services_pending_not_checked
$services_pending_not_checked ),
); $services_pending_not_checked
} else { ))
printf( ); ?>
$this->translate('%d is not checked at all'),
$services_pending_not_checked
);
}
?>
</a>
<?php endif ?> <?php endif ?>
</div> </div>
<?php endif ?> <?php endif ?>

View File

@ -5,18 +5,44 @@
} }
?>"> ?>">
<?php if ($this->statusSummary->hosts_down): ?> <?php if ($this->statusSummary->hosts_down): ?>
<h2> <h2><?= $this->qlink(
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 1)); ?>"> sprintf(
<?= sprintf($this->translatePlural('%d Host DOWN', '%d Hosts DOWN', $this->statusSummary->hosts_down), $this->statusSummary->hosts_down); ?> $this->translatePlural('%u Host DOWN', '%u Hosts DOWN', $this->statusSummary->hosts_down),
</a> $this->statusSummary->hosts_down
</h2> ),
'monitoring/list/hosts',
array('host_state' => 1),
array('title' => sprintf(
$this->translatePlural(
'List %u host that is currently in state DOWN',
'List %u hosts which are currently in state DOWN',
$this->statusSummary->hosts_down
),
$this->statusSummary->hosts_down
))
); ?></h2>
<?php endif ?> <?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable): ?> <?php if ($this->statusSummary->hosts_unreachable): ?>
<h2> <h2><?= $this->qlink(
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 2)); ?>"> sprintf(
<?= sprintf($this->translatePlural('%d Host UNREACHABLE', '%d Hosts UNREACHABLE', $this->statusSummary->hosts_unreachable), $this->statusSummary->hosts_unreachable); ?> $this->translatePlural(
</a> '%u Host UNREACHABLE',
</h2> '%u Hosts UNREACHABLE',
$this->statusSummary->hosts_unreachable
),
$this->statusSummary->hosts_unreachable
),
'monitoring/list/hosts',
array('host_state' => 2),
array('title' => sprintf(
$this->translatePlural(
'List %u host that is currently in state UNREACHABLE',
'List %u hosts which are currently in state UNREACHABLE',
$this->statusSummary->hosts_unreachable
),
$this->statusSummary->hosts_unreachable
))
); ?></h2>
<?php endif ?> <?php endif ?>
<div class="box contents"> <div class="box contents">
<strong><?= $this->translate('Services'); ?></strong> <strong><?= $this->translate('Services'); ?></strong>

View File

@ -31,19 +31,54 @@ $firstRow = !$beingExtended;
<?php if ($switchedContext): ?> <?php if ($switchedContext): ?>
<hr> <hr>
<?php endif ?> <?php endif ?>
<?php foreach ($timeline as $timeInfo): ?> <?php foreach ($timeline as $timeInfo):
switch ($intervalBox->getInterval()) {
case '1d':
$titleTime = sprintf(
$this->translate('on %s', 'timeline.link.title.time'),
$timeInfo[0]->end->format('d/m/Y')
);
break;
case '1w':
$titleTime = sprintf(
$this->translate('in week %s of %s', 'timeline.link.title.week.and.year'),
$timeInfo[0]->end->format('W'),
$timeInfo[0]->end->format('Y')
);
break;
case '1m':
$titleTime = sprintf(
$this->translate('in %s', 'timeline.link.title.month.and.year'),
$timeInfo[0]->end->format('F Y')
);
break;
case '1y':
$titleTime = sprintf(
$this->translate('in %s', 'timeline.link.title.year'),
$timeInfo[0]->end->format('Y')
);
break;
default:
$titleTime = sprintf(
$this->translate('between %s and %s', 'timeline.link.title.datetime.twice'),
$timeInfo[0]->end->format('d/m/Y g:i A'),
$timeInfo[0]->start->format('d/m/Y g:i A')
);
} ?>
<div class="timeframe"> <div class="timeframe">
<span> <span><?= $this->qlink(
<a href="<?= $this->href( $timeInfo[0]->end->format($intervalFormat),
'/monitoring/list/eventhistory', '/monitoring/list/eventhistory',
array( array(
'timestamp<' => $timeInfo[0]->start->getTimestamp(), 'timestamp<' => $timeInfo[0]->start->getTimestamp(),
'timestamp>' => $timeInfo[0]->end->getTimestamp() 'timestamp>' => $timeInfo[0]->end->getTimestamp()
) ),
); ?>"> array('title' => sprintf(
<?= $timeInfo[0]->end->format($intervalFormat); ?> $this->translate('List all event records registered %s', 'timeline.link.title'),
</a> $titleTime
</span> )),
false
); ?></span>
<?php foreach ($groupInfo as $groupName => $labelAndColor): ?> <?php foreach ($groupInfo as $groupName => $labelAndColor): ?>
<?php if (array_key_exists($groupName, $timeInfo[1])): ?> <?php if (array_key_exists($groupName, $timeInfo[1])): ?>
<?php <?php
@ -67,18 +102,30 @@ $extrapolatedCircleWidth = $timeline->getExtrapolatedCircleWidth($timeInfo[1][$g
$circleWidth $circleWidth
); ?>"> ); ?>">
<?php endif ?> <?php endif ?>
<a class="inner-circle" style="<?= sprintf( <?= $this->qlink(
'width: %3$s; height: %3$s; background-color: %2$s; margin-top: -%1$Fem; margin-left: -%1$Fem;', '',
(float) substr($circleWidth, 0, -2) / 2, $timeInfo[1][$groupName]->getDetailUrl(),
$timeInfo[1][$groupName]->getColor(),
(string) $circleWidth
); ?>" href="<?= $timeInfo[1][$groupName]->getDetailUrl()->overwriteParams(
array( array(
'timestamp<' => $timeInfo[0]->start->getTimestamp(), 'type' => $groupName,
'timestamp>' => $timeInfo[0]->end->getTimestamp(), 'timestamp<' => $timeInfo[0]->start->getTimestamp(),
'type' => $groupName 'timestamp>' => $timeInfo[0]->end->getTimestamp()
),
array(
'title' => sprintf(
$this->translate('List %u %s registered %s', 'timeline.link.title'),
$timeInfo[1][$groupName]->getValue(),
strtolower($labelAndColor['label']),
$titleTime
),
'class' => 'inner-circle',
'style' => sprintf(
'width: %3$s; height: %3$s; background-color: %2$s; margin-top: -%1$Fem; margin-left: -%1$Fem;',
(float) substr($circleWidth, 0, -2) / 2,
$timeInfo[1][$groupName]->getColor(),
(string) $circleWidth
)
) )
); ?>" title="<?= $timeInfo[1][$groupName]->getValue(); ?> <?= $labelAndColor['label']; ?>"></a> ); ?>
</div> </div>
</div> </div>
<?php endif ?> <?php endif ?>
@ -86,7 +133,7 @@ $extrapolatedCircleWidth = $timeline->getExtrapolatedCircleWidth($timeInfo[1][$g
</div> </div>
<?php $firstRow = false; ?> <?php $firstRow = false; ?>
<?php endforeach ?> <?php endforeach ?>
<a id="end" href="<?= Url::fromRequest()->remove( <a aria-hidden="true" id="end" href="<?= Url::fromRequest()->remove(
array( array(
'raw_timestamp<', 'raw_timestamp<',
'raw_timestamp>' 'raw_timestamp>'

View File

@ -67,11 +67,13 @@ $this->provideRestriction(
); );
$this->provideConfigTab('backends', array( $this->provideConfigTab('backends', array(
'title' => 'Backends', 'title' => $this->translate('Configure how to retrieve monitoring information'),
'label' => $this->translate('Backends'),
'url' => 'config' 'url' => 'config'
)); ));
$this->provideConfigTab('security', array( $this->provideConfigTab('security', array(
'title' => 'Security', 'title' => $this->translate('Configure how to protect your monitoring environment against prying eyes'),
'label' => $this->translate('Security'),
'url' => 'config/security' 'url' => 'config/security'
)); ));
$this->provideSetupWizard('Icinga\Module\Monitoring\MonitoringWizard'); $this->provideSetupWizard('Icinga\Module\Monitoring\MonitoringWizard');

View File

@ -164,10 +164,12 @@ abstract class MonitoredObjectController extends Controller
$tabs = $this->getTabs(); $tabs = $this->getTabs();
$object = $this->object; $object = $this->object;
if ($object->getType() === $object::TYPE_HOST) { if ($object->getType() === $object::TYPE_HOST) {
$isService = false;
$params = array( $params = array(
'host' => $object->getName() 'host' => $object->getName()
); );
} else { } else {
$isService = true;
$params = array( $params = array(
'host' => $object->getHost()->getName(), 'host' => $object->getHost()->getName(),
'service' => $object->getName() 'service' => $object->getName()
@ -176,17 +178,26 @@ abstract class MonitoredObjectController extends Controller
$tabs->add( $tabs->add(
'host', 'host',
array( array(
'title' => $this->translate('Host'), 'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$isService ? $object->getHost()->getName() : $object->getName()
),
'label' => $this->translate('Host'),
'icon' => 'host', 'icon' => 'host',
'url' => 'monitoring/host/show', 'url' => 'monitoring/host/show',
'urlParams' => $params 'urlParams' => $params
) )
); );
if (isset($params['service'])) { if ($isService) {
$tabs->add( $tabs->add(
'service', 'service',
array( array(
'title' => $this->translate('Service'), 'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$object->getName(),
$object->getHost()->getName()
),
'label' => $this->translate('Service'),
'icon' => 'service', 'icon' => 'service',
'url' => 'monitoring/service/show', 'url' => 'monitoring/service/show',
'urlParams' => $params 'urlParams' => $params
@ -196,7 +207,11 @@ abstract class MonitoredObjectController extends Controller
$tabs->add( $tabs->add(
'services', 'services',
array( array(
'title' => $this->translate('Services'), 'title' => sprintf(
$this->translate('List all services on host %s'),
$isService ? $object->getHost()->getName() : $object->getName()
),
'label' => $this->translate('Services'),
'icon' => 'services', 'icon' => 'services',
'url' => 'monitoring/show/services', 'url' => 'monitoring/show/services',
'urlParams' => $params 'urlParams' => $params
@ -206,7 +221,15 @@ abstract class MonitoredObjectController extends Controller
$tabs->add( $tabs->add(
'history', 'history',
array( array(
'title' => $this->translate('History'), 'title' => $isService
? sprintf(
$this->translate('Show all event records of service %s on host %s'),
$object->getName(),
$object->getHost()->getName()
)
: sprintf($this->translate('Show all event records of host %s'), $object->getName())
,
'label' => $this->translate('History'),
'icon' => 'rewind', 'icon' => 'rewind',
'url' => 'monitoring/show/history', 'url' => 'monitoring/show/history',
'urlParams' => $params 'urlParams' => $params

View File

@ -32,7 +32,17 @@ $requirements = $form->getRequirements();
<td></td> <td></td>
<td class="btn-update"> <td class="btn-update">
<div class="buttons"> <div class="buttons">
<a title="<?= $this->translate('You may also need to restart the web-server for the changes to take effect!'); ?>" href="<?= $this->href(); ?>" class="button-like"><?= $this->translate('Refresh'); ?></a> <?php $title = $this->translate('You may also need to restart the web-server for the changes to take effect!'); ?>
<?= $this->qlink(
$this->translate('Refresh'),
null,
null,
array(
'class' => 'button-like',
'title' => $title,
'aria-label' => sprintf($this->translate('Refresh the page; %s'), $title)
)
); ?>
</div> </div>
</td> </td>
</tr> </tr>

View File

@ -18,9 +18,25 @@
</div> </div>
<div class="buttons"> <div class="buttons">
<?php if ($success): ?> <?php if ($success): ?>
<a href="<?= $this->href('authentication/login'); ?>" class="button-like login"><?= $this->translate('Login to Icinga Web 2'); ?></a> <?= $this->qlink(
$this->translate('Login to Icinga Web 2'),
'authentication/login',
null,
array(
'class' => 'button-like login',
'title' => $this->translate('Show the login page of Icinga Web 2')
)
); ?>
<?php else: ?> <?php else: ?>
<a href="<?= $this->href(); ?>" class="button-like"><?= $this->translate('Back'); ?></a> <?= $this->qlink(
$this->translate('Back'),
null,
null,
array(
'class' => 'button-like',
'title' => $this->translate('Show previous wizard-page')
)
); ?>
<?php endif ?> <?php endif ?>
</div> </div>
</div> </div>

View File

@ -29,7 +29,7 @@ table.historycolorgrid td.weekday {
opacity: 1.0; opacity: 1.0;
} }
table.historycolorgrid a { table.historycolorgrid a, table.historycolorgrid span {
margin: 0; margin: 0;
text-decoration: none; text-decoration: none;
display: block; display: block;

View File

@ -140,7 +140,7 @@
cutContainer: function ($col) { cutContainer: function ($col) {
var props = { var props = {
'elements': $('#' + $col.attr('id') + ' > div').detach(), 'elements': $('#' + $col.attr('id') + ' > *').detach(),
'data': { 'data': {
'data-icinga-url': $col.data('icingaUrl'), 'data-icinga-url': $col.data('icingaUrl'),
'data-icinga-refresh': $col.data('icingaRefresh'), 'data-icinga-refresh': $col.data('icingaRefresh'),