Improve host-service distinction for events

This commit is contained in:
Eric Lippmann 2019-07-26 17:24:09 +02:00
parent f7ed5de8c8
commit dc3147c652
1 changed files with 39 additions and 23 deletions

View File

@ -188,35 +188,51 @@ $rowAction = Url::fromPath('monitoring/event/show');
<?php endif ?>
<div class="history-message-output">
<?php if ($this->isOverview): ?>
<?= $this->qlink(
$event->host_display_name,
'monitoring/host/show',
[
'host' => $event->host_name,
],
[
'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$event->host_display_name
<?php if ($isService) {
echo '<span class="service-on">';
echo sprintf(
$this->translate('%s on %s', 'service on host'),
$this->qlink(
$event->service_display_name,
'monitoring/service/show',
[
'host' => $event->host_name,
'service' => $event->service_description
],
[
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$event->service_display_name,
$event->host_display_name
)
]
),
$this->qlink(
$event->host_display_name,
'monitoring/host/show',
['host' => $event->host_name],
[
'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$event->host_display_name
)
]
)
]
) ?><?php if ($isService): ?>&#58;
<?= $this->qlink(
$event->service_display_name,
'monitoring/service/show',
[
'host' => $event->host_name,
'service' => $event->service_description
],
);
echo '</span>';
} else {
echo $this->qlink(
$event->host_display_name,
'monitoring/host/show',
['host' => $event->host_name],
[
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$event->service_display_name,
$this->translate('Show detailed information for host %s'),
$event->host_display_name
)
]
) ?>
<?php endif ?>
);
} ?>
<?php endif ?>
<?= $this->nl2br($this->createTicketLinks($this->markdown($msg, ['class' => 'overview-plugin-output']))) ?>
</div>