icingaweb2/modules/monitoring/application/views/scripts/show/components/statusIcons.phtml

50 lines
1.6 KiB
PHTML
Raw Normal View History

2013-10-10 15:36:53 +02:00
<?php
2014-03-07 11:30:23 +01:00
use Icinga\Module\Monitoring\Object\Service;
$o = $this->object;
$isService = $o instanceof Service;
$obj = new \stdClass();
$obj->handled =
($isService) ? $o->service_handled : $o->host_handled;
$obj->state =
($isService) ? $o->service_state : $o->host_state;
$obj->acknowledged =
($isService) ? $o->service_acknowledged : $o->host_acknowledged;
$obj->in_downtime =
($isService) ? $o->in_downtime : $o->host_in_downtime;
$obj->notifications_enabled =
($isService) ? $o->notifications_enabled : $o->service_notifications_enabled;
$obj->active_checks_enabled =
($isService) ? $o->active_checks_enabled : $o->host_active_checks_enabled;
$obj->passive_checks_enabled =
($isService) ? $o->passive_checks_enabled : $o->host_passive_checks_enabled;
2014-02-18 20:17:33 +01:00
$i = array();
if (! $obj->handled && $obj->state > 0) {
$i[] = $this->icon('unhandled.png', $this->translate('Unhandled'));
2014-02-18 20:17:33 +01:00
}
if ($obj->acknowledged && ! $obj->in_downtime) {
$i[] = $this->icon('acknowledgement.png', $this->translate('Acknowledged'));
2014-02-18 20:17:33 +01:00
}
if (!$obj->notifications_enabled) {
$i[] = $this->icon('notification_disabled.png', $this->translate('Notifications Disabled'));
2014-02-18 20:17:33 +01:00
}
if ($obj->in_downtime) {
$i[] = $this->icon('in_downtime.png', $this->translate('In Downtime'));
2014-02-18 20:17:33 +01:00
}
if (! $obj->active_checks_enabled) {
if ($obj->passive_checks_enabled) {
$i[] = $this->icon('active_checks_disabled.png', $this->translate('Active Checks Disabled'));
2014-02-18 20:17:33 +01:00
} else {
$i[] = $this->icon('active_passive_checks_disabled.png', $this->translate('Active And Passive Checks Disabled'));
2014-02-18 20:17:33 +01:00
}
}
2014-03-07 11:30:23 +01:00
?><?= implode("\n", $i) ?>