diff --git a/modules/monitoring/application/controllers/DowntimesController.php b/modules/monitoring/application/controllers/DowntimesController.php index 51c9b79ed4..5d8fcb60b6 100644 --- a/modules/monitoring/application/controllers/DowntimesController.php +++ b/modules/monitoring/application/controllers/DowntimesController.php @@ -101,6 +101,6 @@ public function deleteAllAction() )); $delDowntimeForm->setRedirectUrl(Url::fromPath('monitoring/list/downtimes')); $delDowntimeForm->setDowntimes($this->downtimes->fetchAll())->handleRequest(); - $this->view->delDowntimeForm = $delDowntimeForm; + $this->view->delAllDowntimeForm = $delDowntimeForm; } } diff --git a/modules/monitoring/application/forms/Command/Object/DeleteDowntimeCommandForm.php b/modules/monitoring/application/forms/Command/Object/DeleteDowntimeCommandForm.php index 27fbae67a1..fd14172241 100644 --- a/modules/monitoring/application/forms/Command/Object/DeleteDowntimeCommandForm.php +++ b/modules/monitoring/application/forms/Command/Object/DeleteDowntimeCommandForm.php @@ -68,7 +68,7 @@ public function addSubmitButton() 'ignore' => true, 'escape' => false, 'type' => 'submit', - 'class' => 'link-like spinner', + 'class' => 'action-link link', 'label' => $this->getView()->icon('trash'), 'title' => $this->translate('Delete this downtime'), 'decorators' => array('ViewHelper') diff --git a/modules/monitoring/application/views/scripts/downtime/remove.phtml b/modules/monitoring/application/views/scripts/downtime/remove.phtml index 57fe366556..34a7dbdc8e 100644 --- a/modules/monitoring/application/views/scripts/downtime/remove.phtml +++ b/modules/monitoring/application/views/scripts/downtime/remove.phtml @@ -4,7 +4,9 @@ tabs; ?> - render('partials/downtime/downtime-header.phtml'); ?> + + render('partials/downtime/downtime-header.phtml') ?> +
diff --git a/modules/monitoring/application/views/scripts/downtime/show.phtml b/modules/monitoring/application/views/scripts/downtime/show.phtml index 4a3583363c..b59001a2fb 100644 --- a/modules/monitoring/application/views/scripts/downtime/show.phtml +++ b/modules/monitoring/application/views/scripts/downtime/show.phtml @@ -3,119 +3,171 @@ tabs; ?> - render('partials/downtime/downtime-header.phtml'); ?> + + render('partials/downtime/downtime-header.phtml'); ?> +
-
-

translate('Downtime detail information') ?>

- - +

translate('Details') ?>

+
+ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - downtime->is_flexible): ?> - - - + + + - - - - - - - - - + + + + + + + + + +
- isService ? $this->translate('Service') : $this->translate('Host') ?> - - isService): ?> - link()->service( - $downtime->service_description, - $downtime->service_display_name, - $downtime->host_name, - $downtime->host_display_name - ); - $icon = $this->icon('service', $this->translate('Service')); - ?> - - icon('host', $this->translate('Host')); - $link = $this->link()->host($downtime->host_name, $downtime->host_display_name) - ?> - - - - + isService ? $this->translate('Service') : $this->translate('Host') ?> + + isService): ?> + link()->service( + $downtime->service_description, + $downtime->service_display_name, + $downtime->host_name, + $downtime->host_display_name + ); + $icon = $this->icon('service', $this->translate('Service')); + ?> + + icon('host', $this->translate('Host')); + $link = $this->link()->host($downtime->host_name, $downtime->host_display_name) + ?> + + + +
translate('Author') ?>icon('user', $this->translate('User')) ?> escape($this->downtime->author_name) ?>
translate('Comment') ?>icon('comment', $this->translate('Comment')) ?> escape($this->downtime->comment) ?>
translate('Entry Time') ?>formatDateTime($this->downtime->entry_time) ?>
escape( - $this->downtime->is_flexible ? - $this->translate('Flexible') : $this->translate('Fixed') - ); ?> - escape( - $this->downtime->is_flexible ? - $this->translate('Flexible downtimes have a hard start and end time,' - . ' but also an additional restriction on the duration in which ' - . ' the host or service may actually be down.') : - $this->translate('Fixed downtimes have a static start and end time.') - ); ?> -
translate('Scheduled start') ?>formatDateTime($this->downtime->scheduled_start) ?>
translate('Scheduled end') ?>formatDateTime($this->downtime->scheduled_end) ?>
translate('Duration') ?>formatDuration($this->downtime->duration) ?>
translate('Author') ?>icon('user', $this->translate('User')) ?> escape($this->downtime->author_name) ?>
translate('Actual start time') ?>formatDateTime($downtime->start) ?>
translate('Actual end time') ?>formatDateTime($downtime->end) ?>
translate('Entry Time') ?>formatDateTime($this->downtime->entry_time) ?>
translate('Comment') ?>escape($this->downtime->comment) ?>
- - translate('In effect') ?> - - escape( - $this->downtime->is_in_effect ? - $this->translate('Yes') : $this->translate('No') - ); - ?> - - +

translate('Duration') ?>

- - - translate('Commands') ?> - - - - - - - + + + + + + + + + + + + + + + downtime->is_flexible): ?> + + + + + + + + + + + + + + + + + + + + + + + + + + +
escape( + $this->downtime->is_flexible ? + $this->translate('Flexible') : $this->translate('Fixed') + ); ?> + icon('info-circled', $this->downtime->is_flexible ? + $this->translate('Flexible downtimes have a hard start and end time,' + . ' but also an additional restriction on the duration in which ' + . ' the host or service may actually be down.') : + $this->translate('Fixed downtimes have a static start and end time.')) ?> + + is_flexible): ?> + is_in_effect): ?> + translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.') + : $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'), + $this->formatDate($downtime->start), + $this->formatTime($downtime->start), + $this->formatDuration($downtime->duration), + $this->formatDate($downtime->end), + $this->formatTime($downtime->end) + ) ?> + + translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.') + : $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'), + $this->formatDateTime($downtime->scheduled_start), + $this->formatDateTime($downtime->scheduled_end), + $this->formatDuration($downtime->duration) + ) ?> + + + is_in_effect): ?> + translate('This fixed service downtime was started on %s at %s and expires on %s at %s.') + : $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'), + $this->formatDate($downtime->start), + $this->formatTime($downtime->start), + $this->formatDate($downtime->end), + $this->formatTime($downtime->end) + ) ?> + + translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.') + : $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'), + $this->formatDate($downtime->start), + $this->formatTime($downtime->start), + $this->formatDate($downtime->end), + $this->formatTime($downtime->end) + ) ?> + + +
translate('Scheduled start') ?>formatDateTime($this->downtime->scheduled_start) ?>
translate('Scheduled end') ?>formatDateTime($this->downtime->scheduled_end) ?>
translate('Duration') ?>formatDuration($this->downtime->duration) ?>
translate('Actual start time') ?>formatDateTime($downtime->start) ?>
translate('Actual end time') ?>formatDateTime($downtime->end) ?>
translate('In effect') ?> + escape( + $this->downtime->is_in_effect ? + $this->translate('Yes') : $this->translate('No') + ); + ?> +
translate('Commands') ?> + +
diff --git a/modules/monitoring/application/views/scripts/downtimes/delete-all.phtml b/modules/monitoring/application/views/scripts/downtimes/delete-all.phtml index fed0e12f76..e6435feac4 100644 --- a/modules/monitoring/application/views/scripts/downtimes/delete-all.phtml +++ b/modules/monitoring/application/views/scripts/downtimes/delete-all.phtml @@ -8,5 +8,5 @@
- +
\ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/downtimes/show.phtml b/modules/monitoring/application/views/scripts/downtimes/show.phtml index 9b4449cb56..73d9bf6012 100644 --- a/modules/monitoring/application/views/scripts/downtimes/show.phtml +++ b/modules/monitoring/application/views/scripts/downtimes/show.phtml @@ -6,7 +6,7 @@
-

icon('reschedule') ?>translate('Commands') ?>

+

translate('Commands') ?>

qlink( sprintf($this->translate('Remove all %d scheduled downtimes'), $downtimes->count()), $removeAllLink, diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 709b7ec336..047f1c45e5 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -11,137 +11,34 @@ if (! $this->compact): ?> render('list/components/selectioninfo.phtml'); ?>

translate('Downtimes') ?>

- sortBox; ?> - limiter; ?> - paginator; ?> - filterEditor; ?> + sortBox ?> + limiter ?> + paginator ?> + filterEditor ?>
" data-icinga-multiselect-data="downtime_id"> - - service_description)) { - $isService = true; - $stateName = Service::getStateText($downtime->service_state); + $this->isService = true; + $this->stateName = Service::getStateText($downtime->service_state); } else { - $isService = false; - $stateName = Host::getStateText($downtime->host_state); + $this->isService = false; + $this->stateName = Host::getStateText($downtime->host_state); } + $this->downtime = $downtime; + $this->displayComment = true; ?> - - - - - - - - + + render('partials/downtime/downtime-header.phtml'); ?> + +
- start <= time() && ! $downtime->is_in_effect): ?> - translate('Ends'); ?> -
- timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?> - - is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?> -
- timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?> - -
- - icon('service', $this->translate('Service')); ?> qlink( - $this->escape($downtime->host_display_name) . ': ' . $this->escape($downtime->service_display_name), - 'monitoring/downtime/show', - array('downtime_id' => $downtime->id), - array( - 'title' => sprintf( - $this->translate('Show detailed information for this downtime scheduled for service %s on host %s'), - $downtime->service_display_name, - $downtime->host_display_name - ), - 'class' => 'rowaction' - ) - ); ?> - - icon('host', $this->translate('host')); ?> qlink( - $this->escape($downtime->host_display_name), - 'monitoring/downtime/show', - array('downtime_id' => $downtime->id), - array( - 'title' => sprintf( - $this->translate('Show detailed information for this downtime scheduled for host %s'), - $downtime->host_display_name - ), - 'class' => 'rowaction' - ) - ); ?> - -
- icon('comment', $this->translate('Comment')); ?> [escape($downtime->author_name) ?>] escape($downtime->comment) ?> -
- - is_flexible): ?> - is_in_effect): ?> - translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.') - : $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'), - $this->formatDate($downtime->start), - $this->formatTime($downtime->start), - $this->formatDuration($downtime->duration), - $this->formatDate($downtime->end), - $this->formatTime($downtime->end) - ); ?> - - translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.') - : $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'), - $this->formatDateTime($downtime->scheduled_start), - $this->formatDateTime($downtime->scheduled_end), - $this->formatDuration($downtime->duration) - ); ?> - - - is_in_effect): ?> - translate('This fixed service downtime was started on %s at %s and expires on %s at %s.') - : $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'), - $this->formatDate($downtime->start), - $this->formatTime($downtime->start), - $this->formatDate($downtime->end), - $this->formatTime($downtime->end) - ); ?> - - translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.') - : $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'), - $this->formatDate($downtime->start), - $this->formatTime($downtime->start), - $this->formatDate($downtime->end), - $this->formatTime($downtime->end) - ); ?> - - - -
- populate( - array( - 'downtime_id' => $downtime->id, - 'downtime_is_service' => isset($downtime->service_description) - ) - ); - echo $delDowntimeForm; - ?> -
hasResult()): ?> diff --git a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml index 13bf8fe958..683375f133 100644 --- a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml @@ -1,64 +1,72 @@ - - - - - -
- start <= time() && ! $downtime->is_in_effect): ?> - translate('Ends'); ?> -
- timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?> - - is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?> -
- timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?> - -
- - is_flexible): ?> - is_in_effect): ?> - isService - ? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.') - : $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'), - $this->formatDate($downtime->start), - $this->formatTime($downtime->start), - $this->formatDuration($downtime->duration), - $this->formatDate($downtime->end), - $this->formatTime($downtime->end) - ); ?> - - isService - ? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.') - : $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'), - $this->formatDateTime($downtime->scheduled_start), - $this->formatDateTime($downtime->scheduled_end), - $this->formatDuration($downtime->duration) - ); ?> - - - is_in_effect): ?> - isService - ? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.') - : $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'), - $this->formatDate($downtime->start), - $this->formatTime($downtime->start), - $this->formatDate($downtime->end), - $this->formatTime($downtime->end) - ); ?> - - isService - ? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.') - : $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'), - $this->formatDate($downtime->start), - $this->formatTime($downtime->start), - $this->formatDate($downtime->end), - $this->formatTime($downtime->end) - ); ?> - - - -
+ + start <= time() && ! $downtime->is_in_effect): ?> + translate('Ends'); ?> +

timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?>

+ + is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?> +

timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>

+ + + + + + icon('service', $this->translate('Service')); ?> qlink( + $this->escape($downtime->host_display_name) . ': ' . $this->escape($downtime->service_display_name), + 'monitoring/downtime/show', + array('downtime_id' => $downtime->id), + array( + 'title' => sprintf( + $this->translate('Show detailed information for this downtime scheduled for service %s on host %s'), + $downtime->service_display_name, + $downtime->host_display_name + ), + 'class' => 'rowaction' + ) + ); ?> + + icon('host', $this->translate('host')); ?> qlink( + $this->escape($downtime->host_display_name), + 'monitoring/downtime/show', + array('downtime_id' => $downtime->id), + array( + 'title' => sprintf( + $this->translate('Show detailed information for this downtime scheduled for host %s'), + $downtime->host_display_name + ), + 'class' => 'rowaction' + ) + ); ?> + + + translate('by') ?> + escape($downtime->author_name) ?> + + + is_flexible): ?> + icon('magic', $this->translate('This downtime is flexible')); ?> + + + is_in_effect): ?> + icon('plug', $this->translate('This downtime is in effect')); ?> + + + + populate( + array( + 'downtime_id' => $downtime->id, + 'downtime_is_service' => isset($downtime->service_description) + ) + ); + echo $delDowntimeForm; + ?> + + + + +

+ escape($downtime->comment) ?> +

+ + diff --git a/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml b/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml index e80ec72e3e..a84b6fc0a2 100644 --- a/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml @@ -10,89 +10,17 @@ use Icinga\Module\Monitoring\Object\Service; break; } if ($downtime->objecttype === 'service') { - $isService = true; - $stateText = Service::getStateText($downtime->service_state); + $this->isService = true; + $this->stateName = Service::getStateText($downtime->service_state); } else { - $isService = false; - $stateText = Host::getStateText($downtime->host_state); + $this->isService = false; + $this->stateName = Host::getStateText($downtime->host_state); } + $this->downtime = $downtime; + $this->displayComment = false; ?> - - - start <= time() && ! $downtime->is_in_effect): ?> - translate('Ends') ?> -
- timeUntil( - $downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact - ) ?> - - - is_in_effect ? $this->translate('Expires') : $this->translate('Starts') ?> - -
- timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?> - - - - - icon('service', $this->translate('Service')) ?> - link()->service( - $downtime->service_description, - $downtime->service_display_name, - $downtime->host_name, - $downtime->host_display_name - ) ?> - - icon('host', $this->translate('Host')) ?> - link()->host($downtime->host_name, $downtime->host_display_name) ?> - -
- is_flexible): ?> - is_in_effect): ?> - translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.') - : $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'), - $this->formatDate($downtime->start), - $this->formatTime($downtime->start), - $this->formatDuration($downtime->duration), - $this->formatDate($downtime->end), - $this->formatTime($downtime->end) - ) ?> - - translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.') - : $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'), - $this->formatDateTime($downtime->scheduled_start), - $this->formatDateTime($downtime->scheduled_end), - $this->formatDuration($downtime->duration) - ) ?> - - - is_in_effect): ?> - translate('This fixed service downtime was started on %s at %s and expires on %s at %s.') - : $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'), - $this->formatDate($downtime->start), - $this->formatTime($downtime->start), - $this->formatDate($downtime->end), - $this->formatTime($downtime->end) - ) ?> - - translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.') - : $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'), - $this->formatDate($downtime->scheduled_start), - $this->formatTime($downtime->scheduled_start), - $this->formatDate($downtime->scheduled_end), - $this->formatTime($downtime->scheduled_end) - ) ?> - - - + + render('partials/downtime/downtime-header.phtml') ?>