diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index b5ecafbba..8562ba4f0 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -78,7 +78,6 @@ class Monitoring_ListController extends Controller $this->addTitleTab('hosts'); $this->setAutorefreshInterval(10); - $this->compactView = 'hosts-compact'; $query = $this->backend->select()->from('hostStatus', array_merge(array( 'host_icon_image', 'host_name', diff --git a/modules/monitoring/application/views/scripts/list/hosts-compact.phtml b/modules/monitoring/application/views/scripts/list/hosts-compact.phtml deleted file mode 100644 index d06c3af32..000000000 --- a/modules/monitoring/application/views/scripts/list/hosts-compact.phtml +++ /dev/null @@ -1,88 +0,0 @@ -count() === 0) { - echo '

No host found

'; - return; -} - -?>" - data-icinga-multiselect-data="host" -> - -getHelper('MonitoringState'); -foreach($hosts as $host): - - $hostStateName = strtolower($this->util()->getHostStateName($host->host_state)); - $hostLink = $this->href('monitoring/show/host', array('host' => $host->host_name)); - -?> - - - - - - - - - - -
- timeSince($host->host_last_state_change) ?> - - host_name ?>
- escape(substr(strip_tags($host->host_output), 0, 10000)); ?> -
diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index 455f06957..672212ae3 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -1,27 +1,33 @@ getHelper('MonitoringState'); -?> -
-tabs ?> -
-translate('Sort by') ?> sortControl->render($this); ?> -filterEditor): ?> -filterPreview ?> - -
-widget('limiter')->setMaxLimit($this->hosts->count()) ?> -paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?> -selectionToolbar('multi', $this->href('monitoring/multi/host?' . $this->filter->toQueryString())); ?> -
-
-filterEditor ?> +if (! $this->compact): ?> +
+ tabs ?> +
+ translate('Sort by') ?> sortControl->render($this) ?> + filterEditor): ?> + filterPreview ?> + +
+ + widget('limiter')->setMaxLimit($this->hosts->count()) ?> + paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?> + selectionToolbar('multi', $this->href('monitoring/multi/host?' . $this->filter->toQueryString())) ?> +
+
+ filterEditor ?> count() === 0) { - echo $this->translate('No host found') . '
'; - return; -} +if ($hosts->count() === 0): ?> + translate('No host found') ?> + compact): ?> +
+ count() === 0) { data-icinga-multiselect-url="href("/monitoring/multi/host") ?>" data-icinga-multiselect-data="host" > - - + util()->getHostStateName($host->host_state)); - $hostLink = $this->href('/monitoring/show/host', array('host' => $host->host_name)); + $hostStateName = strtolower($this->util()->getHostStateName($host->host_state)); + $hostLink = $this->href('/monitoring/show/host', array('host' => $host->host_name)); - $icons = array(); - if (!$host->host_handled && $host->host_state > 0){ - $icons[] = $this->icon('unhandled.png', 'Unhandled'); - } + if (! $this->compact) { + $icons = array(); + if (! $host->host_handled && $host->host_state > 0){ + $icons[] = $this->icon('unhandled.png', 'Unhandled'); + } - if ($host->host_acknowledged) { - $icons[] = $this->icon('acknowledgement.png', 'Acknowledged'); - } + if ($host->host_acknowledged) { + $icons[] = $this->icon('acknowledgement.png', 'Acknowledged'); + } - if ($host->host_is_flapping) { - $icons[] = $this->icon('flapping.png', 'Flapping'); - } + if ($host->host_is_flapping) { + $icons[] = $this->icon('flapping.png', 'Flapping'); + } - if (!$host->host_notifications_enabled) { - $icons[] = $this->icon('notification_disabled.png', 'Notifications Disabled'); - } + if (! $host->host_notifications_enabled) { + $icons[] = $this->icon('notification_disabled.png', 'Notifications Disabled'); + } - if ($host->host_in_downtime) { - $icons[] = $this->icon('in_downtime.png', 'In Downtime'); - } + if ($host->host_in_downtime) { + $icons[] = $this->icon('in_downtime.png', 'In Downtime'); + } - if (!$host->host_active_checks_enabled) { - if (!$host->host_passive_checks_enabled) { - $icons[] = $this->icon('active_passive_checks_disabled.png', 'Active And Passive Checks Disabled'); - } else { - $icons[] = $this->icon('active_checks_disabled.png', 'Active Checks Disabled'); + if (! $host->host_active_checks_enabled) { + if (! $host->host_passive_checks_enabled) { + $icons[] = $this->icon('active_passive_checks_disabled.png', 'Active And Passive Checks Disabled'); + } else { + $icons[] = $this->icon('active_checks_disabled.png', 'Active Checks Disabled'); + } + } + + if (isset($host->host_last_comment) && $host->host_last_comment !== null) { + $icons[] = $this->icon('comment.png', 'Comment: ' . $host->host_last_comment); + } } - } + ?> + + + - - - monitoringState($host, 'host')); ?>
-
- prefixedTimeSince($host->host_last_state_change, true) ?> - host_state > 0): ?> -
- host_state_type === '1') ? $this->translate('Hard') : $this->translate('Soft') ?> host_current_check_attempt; ?>/host_max_check_attempts; ?> - -
- - - - - - - - + + + + +
+ compact): ?> +
+ host_unhandled_services) && $host->host_unhandled_services > 0): ?> + + host_unhandled_services ?> + + - if (isset($host->host_last_comment) && $host->host_last_comment !== null) { - $icons[] = $this->icon('comment.png', 'Comment: ' . $host->host_last_comment); - } -?> -
-
- host_unhandled_services) && $host->host_unhandled_services > 0): ?> - - host_unhandled_services ?> - - + monitoringState($host, 'host')) ?>
+
+ + prefixedTimeSince($host->host_last_state_change, true) ?> + compact): ?> + host_state > 0): ?> +
+ translate( + ($host->host_state_type === '1') ? 'Hard' : 'Soft' + ) ?> host_current_check_attempt ?>/host_max_check_attempts ?> + +
+
+ +
- host_icon_image) : ?> - img($this->resolveMacros($host->host_icon_image, $host), array('align' => 'right')) ?> - - - host_name ?>
- escape(substr(strip_tags($host->host_output), 0, 10000)); ?> -
+ compact): ?> + host_icon_image): ?> + img( + $this->resolveMacros($host->host_icon_image, $host), + array('align' => 'right') + ) ?> + + + + host_name ?>
+ escape(substr(strip_tags($host->host_output), 0, 10000)) ?> +
-