Separate icon and event output in the history views

This commit is contained in:
Eric Lippmann 2019-07-15 16:38:32 +02:00 committed by Johannes Meyer
parent 213e7a3c13
commit aa293f54bd
2 changed files with 51 additions and 27 deletions

View File

@ -179,38 +179,47 @@ $rowAction = Url::fromPath('monitoring/event/show');
<div class="state-meta"><?= $this->formatTime($event->timestamp) ?></div> <div class="state-meta"><?= $this->formatTime($event->timestamp) ?></div>
</td> </td>
<td> <td>
<?php if ($this->isOverview): ?> <div class="history-message-container">
<?= $this->qlink( <?php if ($icon): ?>
$event->host_display_name, <div class="history-message-icon">
'monitoring/host/show', <?= $this->icon($icon, $iconTitle) ?>
array( </div>
'host' => $event->host_name, <?php endif ?>
), <div class="history-message-output">
array('title' => sprintf( <?php if ($this->isOverview): ?>
$this->translate('Show detailed information for host %s'),
$event->host_display_name
))
) ?><?php if ($isService): ?>&#58;
<?= $this->qlink( <?= $this->qlink(
$event->service_display_name, $event->host_display_name,
'monitoring/service/show', 'monitoring/host/show',
array( [
'host' => $event->host_name, 'host' => $event->host_name,
'service' => $event->service_description ],
), [
array(
'title' => sprintf( 'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'), $this->translate('Show detailed information for host %s'),
$event->service_display_name,
$event->host_display_name $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
],
[
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$event->service_display_name,
$event->host_display_name
)
]
) ?>
<?php endif ?>
<?php endif ?> <?php endif ?>
<?php endif ?> <?= $this->nl2br($this->createTicketLinks($this->markdown($msg, ['class' => 'overview-plugin-output']))) ?>
<?php if ($icon) { </div>
echo $this->icon($icon, $iconTitle); </div>
} ?><?= $this->nl2br($this->createTicketLinks($this->markdown($msg, ['class' => 'overview-plugin-output']))) ?>
</td> </td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>

View File

@ -241,3 +241,18 @@
cursor: pointer; cursor: pointer;
} }
} }
// Event history
.history-message-container {
display: flex;
align-items: center;
justify-content: center;
> .history-message-icon {
padding: 0.25em;
}
> .history-message-output {
flex: 1;
}
}