Show new notfication types in the history views
This commit is contained in:
parent
54f9c68887
commit
213e7a3c13
|
@ -53,16 +53,44 @@ $rowAction = Url::fromPath('monitoring/event/show');
|
|||
'id' => $event->id
|
||||
));
|
||||
switch ($event->type) {
|
||||
case 'notify':
|
||||
case substr($event->type, 0, 13) === 'notification_':
|
||||
$icon = 'bell';
|
||||
$iconTitle = $this->translate('Notification', 'tooltip');
|
||||
$label = $this->translate('NOTIFICATION');
|
||||
switch (substr($event->type, 13)) {
|
||||
case 'state':
|
||||
$iconTitle = $this->translate('State notification', 'tooltip');
|
||||
$label = $this->translate('NOTIFICATION');
|
||||
$stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
|
||||
break;
|
||||
case 'ack':
|
||||
$iconTitle = $this->translate('Ack Notification', 'tooltip');
|
||||
$label = $this->translate('ACK NOTIFICATION');
|
||||
break;
|
||||
case 'dt_start':
|
||||
$iconTitle = $this->translate('Downtime start notification', 'tooltip');
|
||||
$label = $this->translate('DOWNTIME START NOTIFICATION');
|
||||
break;
|
||||
case 'dt_end':
|
||||
$iconTitle = $this->translate('Downtime end notification', 'tooltip');
|
||||
$label = $this->translate('DOWNTIME END NOTIFICATION');
|
||||
break;
|
||||
case 'flapping':
|
||||
$iconTitle = $this->translate('Flapping notification', 'tooltip');
|
||||
$label = $this->translate('FLAPPING NOTIFICATION');
|
||||
break;
|
||||
case 'flapping_end':
|
||||
$iconTitle = $this->translate('Flapping end notification', 'tooltip');
|
||||
$label = $this->translate('FLAPPING END NOTIFICATION');
|
||||
break;
|
||||
case 'custom':
|
||||
$iconTitle = $this->translate('Custom notification', 'tooltip');
|
||||
$label = $this->translate('CUSTOM NOTIFICATION');
|
||||
break;
|
||||
}
|
||||
$msg = $msg ? preg_replace_callback(
|
||||
'/^\[([^\]]+)\]/',
|
||||
function($match) use ($self) { return contactsLink($match, $self); },
|
||||
$msg
|
||||
) : $this->translate('This notification was not sent out to any contact.');
|
||||
$stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
|
||||
break;
|
||||
case 'comment':
|
||||
$icon = 'comment-empty';
|
||||
|
|
Loading…
Reference in New Issue