Improve service/host name layout in all views

refs #9361
This commit is contained in:
Matthias Jentsch 2015-06-17 11:33:55 +02:00
parent b3028e9988
commit 1ef643e002
6 changed files with 15 additions and 16 deletions

View File

@ -51,7 +51,8 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract
public function service($service, $serviceLinkText, $host, $hostLinkText) public function service($service, $serviceLinkText, $host, $hostLinkText)
{ {
return sprintf( return sprintf(
$this->view->translate('%s on %s', 'Service running on host'), '%s: %s',
$this->host($host, $hostLinkText),
$this->view->qlink( $this->view->qlink(
$serviceLinkText, $serviceLinkText,
'monitoring/service/show', 'monitoring/service/show',
@ -61,8 +62,7 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract
$service, $service,
$host $host
)) ))
), )
$this->host($host, $hostLinkText)
); );
} }
} }

View File

@ -37,9 +37,9 @@ if (count($comments) === 0) {
<?= $this->qlink( <?= $this->qlink(
sprintf( sprintf(
$this->translate('%s on %s', 'Service running on host'), '%s: %s',
$comment->service_display_name, $comment->host_display_name,
$comment->host_display_name $comment->service_display_name
), ),
'monitoring/comment/show', 'monitoring/comment/show',
array('comment_id' => $comment->id), array('comment_id' => $comment->id),

View File

@ -54,7 +54,7 @@ if (count($downtimes) === 0) {
} }
?> ?>
<?= $this->qlink( <?= $this->qlink(
sprintf($this->translate('%s on %s', 'Service running on host'), $downtime->service_display_name, $downtime->host_display_name), sprintf('%s: %s', $downtime->host_display_name, $downtime->service_display_name),
'monitoring/downtime/show', 'monitoring/downtime/show',
array('downtime_id' => $downtime->id), array('downtime_id' => $downtime->id),
array('title' => sprintf( array('title' => sprintf(

View File

@ -1,9 +1,9 @@
<?php if ($comment->objecttype === 'service'): ?> <?php if ($comment->objecttype === 'service'): ?>
<?= $this->icon('service', $this->translate('Service')); ?> <?= $this->icon('service', $this->translate('Service')); ?>
<?= sprintf( <?= sprintf(
$this->translate('%s on %s', 'Service running on host'), '%s: %s',
$comment->service_display_name, $comment->host_display_name,
$comment->host_display_name $comment->service_display_name
) ?> ) ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('host', $this->translate('Host')); ?> <?= $this->icon('host', $this->translate('Host')); ?>

View File

@ -18,9 +18,8 @@ $i = 0;
<?= $this->iconImage()->service($service) ?> <?= $this->iconImage()->service($service) ?>
<?= implode(' ', $this->serviceFlags($service)) ?> <?= implode(' ', $this->serviceFlags($service)) ?>
<b> <b>
<?= $this->escape($service->getName()); ?> <?= $this->escape($service->getHost()->getName()); ?>:
<?= $this->translate('on') ?> <?= $this->escape($service->getName()); ?> <br>
<?= $this->escape($service->getHost()->getName()); ?><br>
</b> </b>
<?= $this->escape($service->service_output) ?> <?= $this->escape($service->service_output) ?>
</td> </td>

View File

@ -143,7 +143,8 @@ $output = $this->tickets ? preg_replace_callback(
?> ?>
<?php if ($isService): ?> <?php if ($isService): ?>
<?= sprintf( <?= sprintf(
$this->translate('%s on %s', 'Service running on host'), '%s: %s',
$event->host_display_name,
$hostContext ? $this->qlink( $hostContext ? $this->qlink(
$event->service_display_name, $event->service_display_name,
'monitoring/show/service', 'monitoring/show/service',
@ -156,8 +157,7 @@ $output = $this->tickets ? preg_replace_callback(
$event->service_display_name, $event->service_display_name,
$event->host_display_name $event->host_display_name
)) ))
) : $this->escape($event->service_display_name), ) : $this->escape($event->service_display_name)
$event->host_display_name
) ?> ) ?>
<?php else: ?> <?php else: ?>
<?= $this->escape($event->host_name); ?> <?= $this->escape($event->host_name); ?>