monitoring: Use display_name for displaying the host and service name in the notifications overview

refs #7843
This commit is contained in:
Eric Lippmann 2015-01-21 15:48:45 +01:00
parent 846f391080
commit ece6bfe6bb

View File

@ -25,20 +25,13 @@ use Icinga\Module\Monitoring\Object\Service;
<tbody> <tbody>
<?php foreach ($notifications as $notification): <?php foreach ($notifications as $notification):
if (isset($notification->service)) { if (isset($notification->service)) {
$isService = true; $isService = true;
$href = $this->href('monitoring/show/service', array( $stateName = Service::getStateText($notification->notification_state);
'host' => $notification->host,
'service' => $notification->service
));
$stateName = Service::getStateText($notification->notification_state);
} else { } else {
$isService = false; $isService = false;
$href = $this->href('monitoring/show/host', array(
'host' => $notification->host
));
$stateName = Host::getStateText($notification->notification_state); $stateName = Host::getStateText($notification->notification_state);
} }
?> ?>
<tr class="state <?= $stateName ?>"> <tr class="state <?= $stateName ?>">
<td class="state"> <td class="state">
<?= $this->dateTimeRenderer($notification->notification_start_time)->render( <?= $this->dateTimeRenderer($notification->notification_start_time)->render(
@ -49,12 +42,14 @@ use Icinga\Module\Monitoring\Object\Service;
</td> </td>
<td style="font-size: 0.8em"> <td style="font-size: 0.8em">
<?php if ($isService): ?> <?php if ($isService): ?>
<?= sprintf( <?= $this->link()->service(
$this->translate('%s on %s'), $notification->service,
$this->qlink($notification->service, $href), $notification->host $notification->service_display_name,
$notification->host,
$notification->host_display_name
) ?> ) ?>
<?php else: ?> <?php else: ?>
<?= $this->qlink($notification->host, $href) ?> <?= $this->link()->host($notification->host, $notification->host_display_name) ?>
<?php endif ?> <?php endif ?>
<br> <br>
<?= $this->escape(substr(strip_tags($notification->notification_output), 0, 10000)); ?> <?= $this->escape(substr(strip_tags($notification->notification_output), 0, 10000)); ?>