Merge branch 'bugfix/Improve-tooltip-descriptions-8110'

fixes #8110
This commit is contained in:
Eric Lippmann 2015-02-03 12:38:59 +01:00
commit 946a903a39
11 changed files with 303 additions and 76 deletions

View File

@ -32,7 +32,7 @@
<a href="<?= $this->href('/preference'); ?>"><?= $this->translate('Preferences'); ?> </a>
</li>
<li id="icinga_app_nav_logout">
<a href="<?= $this->href('/authentication/logout'); ?>" title="Logout"><?= $this->translate('Logout'); ?></a>
<a href="<?= $this->href('/authentication/logout'); ?>" title="<?= $this->translate('Logout from Icinga Web 2') ?>"><?= $this->translate('Logout'); ?></a>
</li>
</ul>
</li>

View File

@ -6,7 +6,7 @@ if ($xAxisPaginator->count() <= 1 && $yAxisPaginator->count() <= 1) {
return; // Display this pagination only if there are multiple pages
}
$fromTo = t('%s: %d to %d of %d');
$fromTo = t('%s: %d to %d of %d (on the %s-axis)');
$xAxisPages = $xAxisPaginator->getPages('all');
$yAxisPages = $yAxisPaginator->getPages('all');
@ -35,7 +35,8 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
t('Hosts'),
($prevYAxisPage - 1) * $yAxisPages->itemCountPerPage + 1,
$prevYAxisPage * $yAxisPages->itemCountPerPage,
$yAxisPages->totalItemCount
$yAxisPages->totalItemCount,
'y'
); ?>"><?= $this->icon('up-open'); ?></a>
<?php else: ?>
<?= $this->icon('up-open'); ?>
@ -53,7 +54,8 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
t('Services'),
($prevXAxisPage - 1) * $xAxisPages->itemCountPerPage + 1,
$prevXAxisPage * $xAxisPages->itemCountPerPage,
$xAxisPages->totalItemCount
$xAxisPages->totalItemCount,
'x'
); ?>"><?= $this->icon('left-open'); ?></a>
<?php else: ?>
<?= $this->icon('left-open'); ?>
@ -69,7 +71,8 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
t('Services'),
$currentXAxisPage * $xAxisPages->itemCountPerPage + 1,
$nextXAxisPage === $xAxisPages->last ? $xAxisPages->totalItemCount : $nextXAxisPage * $xAxisPages->itemCountPerPage,
$xAxisPages->totalItemCount
$xAxisPages->totalItemCount,
'x'
); ?>"><?= $this->icon('right-open'); ?></a>
<?php else: ?>
<?= $this->icon('right-open'); ?>
@ -87,7 +90,8 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
t('Hosts'),
$currentYAxisPage * $yAxisPages->itemCountPerPage + 1,
$nextYAxisPage === $yAxisPages->last ? $yAxisPages->totalItemCount : $nextYAxisPage * $yAxisPages->itemCountPerPage,
$yAxisPages->totalItemCount
$yAxisPages->totalItemCount,
'y'
); ?>"><?= $this->icon('down-open'); ?></a>
<?php else: ?>
<?= $this->icon('down-open'); ?>

View File

@ -6,7 +6,7 @@ if ($xAxisPaginator->count() <= 1 && $yAxisPaginator->count() <= 1) {
return; // Display this pagination only if there are multiple pages
}
$fromTo = t('%s: %d to %d of %d');
$fromTo = t('%s: %d to %d of %d (on the %s-axis)');
$xAxisPages = $xAxisPaginator->getPages('all');
$yAxisPages = $yAxisPaginator->getPages('all');
@ -28,13 +28,15 @@ $yAxisPages = $yAxisPaginator->getPages('all');
t('Hosts'),
($yAxisPage - 1) * $yAxisPages->itemCountPerPage + 1,
$yAxisPage === $yAxisPages->last ? $yAxisPages->totalItemCount : $yAxisPage * $yAxisPages->itemCountPerPage,
$yAxisPages->totalItemCount
$yAxisPages->totalItemCount,
'y'
) . '; ' . sprintf(
$fromTo,
t('Services'),
($xAxisPage - 1) * $xAxisPages->itemCountPerPage + 1,
$xAxisPage === $xAxisPages->last ? $xAxisPages->totalItemCount : $xAxisPage * $xAxisPages->itemCountPerPage,
$xAxisPages->totalItemCount
$xAxisPages->totalItemCount,
'x'
); ?>"></a>
<?php endif ?>
</td>

View File

@ -52,7 +52,10 @@
<td><?= $this->escape($role->groups) ?></td>
<td>
<a href="<?= $this->url('roles/remove', array('role' => $name)) ?>"
title="<?= $this->translate('Remove role') ?>">
title="<?= sprintf(
$this->translate('Remove role %s'),
$name
) ?>">
<?= $this->icon('cancel') ?>
</a>
</td>

View File

@ -147,7 +147,7 @@ class Monitoring_HostsController extends Controller
$this->view->objectsInDowntime = $objectsInDowntime;
$this->view->inDowntimeLink = Url::fromPath('monitoring/list/downtimes')
->setQueryString(Filter::matchAny($downtimeFilterExpressions)->toQueryString());
$this->view->havingCommentsLink = Url::fromRequest()
$this->view->commentsLink = Url::fromRequest()
->setPath('monitoring/list/comments');
$this->view->hostStatesPieChart = $this->createPieChart(
$hostStates,

View File

@ -191,7 +191,7 @@ class Monitoring_ServicesController extends Controller
$this->view->objectsInDowntime = $objectsInDowntime;
$this->view->inDowntimeLink = Url::fromPath('monitoring/list/downtimes')
->setQueryString(Filter::matchAny($downtimeFilterExpressions)->toQueryString());
$this->view->havingCommentsLink = Url::fromRequest()
$this->view->commentsLink = Url::fromRequest()
->setPath('monitoring/list/comments');
$this->view->serviceStatesPieChart = $this->createPieChart(
$serviceStates,

View File

@ -17,7 +17,10 @@
</h3>
<div>
<a href="<?= $listAllLink ?>" title="<?= $this->translate('List all') ?>">
<a href="<?= $listAllLink ?>" title="<?= sprintf(
$this->translate('List all %u hosts'),
$hostCount
); ?>">
<?= $this->translate('List all') ?>
</a>
</div>
@ -60,17 +63,43 @@
) ?>
</h3>
<div>
<a href="<?= $downtimeUnhandledLink ?>"
title="<?= $this->translate('Schedule downtimes for unhandled problem hosts') ?>">
<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') ?>
<?= $this->translate('Schedule downtimes for unhandled problem hosts') ?>
<?= sprintf(
$this->translatePlural(
'Schedule downtime for unhandled host problem',
'Schedule downtimes for unhandled host problems',
$unhandledCount
),
$unhandledCount
) ?>
</a>
</div>
<div>
<a href="<?= $acknowledgeUnhandledLink ?>"
title="<?= $this->translate('Acknowledge unhandled problem hosts') ?>">
<a href="<?= $acknowledgeUnhandledLink ?>" title="<?= sprintf(
$this->translatePlural(
'Acknowledge %u unhandled host problem',
'Acknowledge %u unhandled host problems',
$unhandledCount
),
$unhandledCount
) ?>">
<?= $this->icon('ok') ?>
<?= $this->translate('Acknowledge unhandled problem hosts') ?>
<?= sprintf(
$this->translatePlural(
'Acknowledge unhandled host problem',
'Acknowledge unhandled host problems',
$unhandledCount
),
$unhandledCount
) ?>
</a>
</div>
<?php endif ?>
@ -96,12 +125,19 @@
<h2>
<?php $inDowntimeCount = count($objectsInDowntime) ?>
<a href="<?= $inDowntimeLink ?>"
title="<?= $this->translate('Hosts in downtime') ?>">
title="<?= sprintf(
$this->translatePlural(
'List %u host which is in downtime',
'List %u hosts which are in downtime',
$inDowntimeCount
),
$inDowntimeCount
) ?>">
<?= $this->icon('plug') ?>
<?= sprintf(
$this->translatePlural(
'%u host is in downtime',
'%u hosts are in downtime',
'List %u host currently in downtime',
'List %u hosts currently downtime',
$inDowntimeCount
),
$inDowntimeCount
@ -110,19 +146,26 @@
</h2>
<?php endif ?>
<?php $havingCommentsCount = count($objects->getComments()) ?>
<?php if ($havingCommentsCount): ?>
<?php $commentCount = count($objects->getComments()) ?>
<?php if ($commentCount): ?>
<h2>
<a href="<?= $havingCommentsLink ?>"
title="<?= $this->translate('Comments') ?>">
<a href="<?= $commentsLink ?>"
title="<?= sprintf(
$this->translatePlural(
'List %u host comment',
'List %u host comments',
$commentCount
),
$commentCount
) ?>">
<?= $this->icon('comment') ?>
<?= sprintf(
$this->translatePlural(
'%u comment',
'%u comments',
$havingCommentsCount
'List %u host comment',
'List %u host comments',
$commentCount
),
$havingCommentsCount
$commentCount
) ?>
</a>
</h2>

View File

@ -96,7 +96,15 @@
'hostgroup' => $h->hostgroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services OK'); ?>">
); ?>" 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,
$h->hostgroup
); ?>">
<?= $h->services_ok; ?>
</a>
</span>
@ -113,7 +121,15 @@
'hostgroup' => $h->hostgroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services CRITICAL Unhandled'); ?>">
); ?>" 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,
$h->hostgroup
); ?>">
<?= $h->services_critical_unhandled; ?>
</a>
<?php endif ?>
@ -127,7 +143,15 @@
'hostgroup' => $h->hostgroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services CRITICAL Handled'); ?>">
); ?>" 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,
$h->hostgroup
); ?>">
<?= $h->services_critical_handled; ?>
</a>
</span>
@ -147,7 +171,15 @@
'hostgroup' => $h->hostgroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services UNKNOWN Unhandled'); ?>">
); ?>" 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,
$h->hostgroup
); ?>">
<?= $h->services_unknown_unhandled; ?>
</a>
<?php endif ?>
@ -161,7 +193,15 @@
'hostgroup' => $h->hostgroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services UNKNOWN Handled'); ?>">
); ?>" 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,
$h->hostgroup
); ?>">
<?= $h->services_unknown_handled; ?>
</a>
</span>
@ -181,7 +221,15 @@
'hostgroup' => $h->hostgroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services WARNING Unhandled'); ?>">
); ?>" 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,
$h->hostgroup
); ?>">
<?= $h->services_warning_unhandled; ?>
</a>
<?php endif ?>
@ -195,7 +243,15 @@
'hostgroup' => $h->hostgroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services WARNING Handled'); ?>">
); ?>" 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,
$h->hostgroup
); ?>">
<?= $h->services_warning_handled; ?>
</a>
</span>
@ -212,7 +268,15 @@
'hostgroup' => $h->hostgroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services PENDING'); ?>">
); ?>" 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,
$h->hostgroup
); ?>">
<?= $h->services_pending; ?>
</a>
</span>

View File

@ -98,19 +98,29 @@ if ($hosts->count() === 0) {
<?= implode(' ', $icons) ?>
<a href="<?= $hostLink ?>"><?= $this->escape($host->host_display_name) ?></a>
<?php if (isset($host->host_unhandled_services) && $host->host_unhandled_services > 0): ?>
<span title="<?=
$host->host_unhandled_services
?> <?= $this->translate('Service Problems on Host') ?>"> (<?= $this->qlink(
<span> (<?= $this->qlink(
sprintf(
$this->translatePlural('%d unhandled service', '%d unhandled services', $host->host_unhandled_services),
$host->host_unhandled_services),
$host->host_unhandled_services
),
'monitoring/show/services',
array(
'host' => $host->host_name,
'service_problem' => 1,
'service_handled' => 0
),
array('style' => 'font-weight: normal')
array(
'style' => 'font-weight: normal',
'title' => sprintf(
$this->translatePlural(
'List %s service problem on host %s',
'List %s service problems on host %s',
$host->host_unhandled_services
),
$host->host_unhandled_services,
$host->host_name
)
)
) ?>)</span>
<?php endif ?>
<p class="pluginoutput"><?= $this->escape($this->ellipsis($host->host_output, 10000)) ?></p>

View File

@ -96,7 +96,15 @@
'servicegroup' => $s->servicegroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services OK'); ?>">
); ?>" 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,
$s->servicegroup
); ?>">
<?= $s->services_ok; ?>
</a>
</span>
@ -113,7 +121,15 @@
'servicegroup' => $s->servicegroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services CRITICAL Unhandled'); ?>">
); ?>" 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,
$s->servicegroup
); ?>">
<?= $s->services_critical_unhandled; ?>
</a>
<?php endif ?>
@ -127,7 +143,15 @@
'servicegroup' => $s->servicegroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services CRITICAL Handled'); ?>">
); ?>" 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,
$s->servicegroup
); ?>">
<?= $s->services_critical_handled; ?>
</a>
</span>
@ -147,7 +171,15 @@
'servicegroup' => $s->servicegroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services UNKNOWN Unhandled'); ?>">
); ?>" 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,
$s->servicegroup
); ?>">
<?= $s->services_unknown_unhandled; ?>
</a>
<?php endif ?>
@ -161,7 +193,15 @@
'servicegroup' => $s->servicegroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services UNKNOWN Handled'); ?>">
); ?>" 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,
$s->servicegroup
); ?>">
<?= $s->services_unknown_handled; ?>
</a>
</span>
@ -181,7 +221,15 @@
'servicegroup' => $s->servicegroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services WARNING Unhandled'); ?>">
); ?>" 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,
$s->servicegroup
); ?>">
<?= $s->services_warning_unhandled; ?>
</a>
<?php endif ?>
@ -195,7 +243,15 @@
'servicegroup' => $s->servicegroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services WARNING Handled'); ?>">
); ?>" 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,
$s->servicegroup
); ?>">
<?= $s->services_warning_handled; ?>
</a>
</span>
@ -212,7 +268,15 @@
'servicegroup' => $s->servicegroup,
'sort' => 'service_severity'
)
); ?>" title="<?= $this->translate('Services PENDING'); ?>">
); ?>" 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,
$s->servicegroup
); ?>">
<?= $s->services_pending; ?>
</a>
</span>

View File

@ -7,7 +7,7 @@
<?php else: ?>
<div>
<a href="<?= $listAllLink ?>" title="<?= $this->translate('List all') ?>">
<a href="<?= $listAllLink ?>" title="<?= sprintf($this->translate('List all %u services'), $serviceCount) ?>">
<?= $this->translate('List all') ?>
</a>
</div>
@ -51,17 +51,43 @@
) ?>
</h3>
<div>
<a href="<?= $downtimeUnhandledLink ?>"
title="<?= $this->translate('Schedule downtimes for unhandled problem services') ?>">
<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') ?>
<?= $this->translate('Schedule downtimes for unhandled problem services') ?>
<?= sprintf(
$this->translatePlural(
'Schedule downtime for unhandled service problem',
'Schedule downtimes for unhandled service problems',
$unhandledCount
),
$unhandledCount
) ?>
</a>
</div>
<div>
<a href="<?= $acknowledgeUnhandledLink ?>"
title="<?= $this->translate('Acknowledge unhandled problem services') ?>">
<a href="<?= $acknowledgeUnhandledLink ?>" title="<?= sprintf(
$this->translatePlural(
'Acknowledge %u unhandled service problem',
'Acknowledge %u unhandled service problems',
$unhandledCount
),
$unhandledCount
) ?>">
<?= $this->icon('ok') ?>
<?= $this->translate('Acknowledge unhandled problem services') ?>
<?= sprintf(
$this->translatePlural(
'Acknowledge unhandled service problem',
'Acknowledge unhandled service problems',
$unhandledCount
),
$unhandledCount
) ?>
</a>
</div>
<?php endif ?>
@ -86,13 +112,18 @@
<?php if (! empty($objectsInDowntime)): ?>
<h2>
<?php $inDowntimeCount = count($objectsInDowntime) ?>
<a href="<?= $inDowntimeLink ?>"
title="<?= $this->translate('Services in downtime') ?>">
<a href="<?= $inDowntimeLink ?>" title="<?= sprintf(
$this->translatePlural(
'List %u service currently in downtime',
'List %u services currently in downtime',
$inDowntimeCount
),
$inDowntimeCount) ?>">
<?= $this->icon('plug') ?>
<?= sprintf(
$this->translatePlural(
'%u service is in downtime',
'%u services are in downtime',
'List %u service currently in downtime',
'List %u services currently in downtime',
$inDowntimeCount
),
$inDowntimeCount
@ -101,19 +132,25 @@
</h2>
<?php endif ?>
<?php $havingCommentsCount = count($objects->getComments()) ?>
<?php if ($havingCommentsCount): ?>
<?php $commentCount = count($objects->getComments()) ?>
<?php if ($commentCount): ?>
<h2>
<a href="<?= $havingCommentsLink ?>"
title="<?= $this->translate('Comments') ?>">
<a href="<?= $commentsLink ?>" title="<?= sprintf(
$this->translatePlural(
'List %u service comment',
'List %u service comments',
$commentCount
),
$commentCount
) ?>">
<?= $this->icon('comment') ?>
<?= sprintf(
$this->translatePlural(
'%u comment',
'%u comments',
$havingCommentsCount
'List %u service comment',
'List %u service comments',
$commentCount
),
$havingCommentsCount
$commentCount
) ?>
</a>
</h2>