From 5a6aa1c073233017060843cdae19f2839e713f51 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 30 Sep 2015 13:58:02 +0200 Subject: [PATCH] monitoring: New layout for host and service multi views refs #5543 --- .../controllers/HostsController.php | 2 +- .../views/scripts/hosts/show.phtml | 374 ++++++++--------- .../views/scripts/services/show.phtml | 378 +++++++++--------- 3 files changed, 351 insertions(+), 403 deletions(-) diff --git a/modules/monitoring/application/controllers/HostsController.php b/modules/monitoring/application/controllers/HostsController.php index 3c576fbc8..96b78da62 100644 --- a/modules/monitoring/application/controllers/HostsController.php +++ b/modules/monitoring/application/controllers/HostsController.php @@ -149,7 +149,7 @@ class HostsController extends Controller ->setQueryString( $this->hostList ->objectsFilter() - ->andFilter(FilterEqual::where('downtime_objecttype', 'host')) + ->andFilter(FilterEqual::where('object_type', 'host')) ->toQueryString() ); $this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments'); diff --git a/modules/monitoring/application/views/scripts/hosts/show.phtml b/modules/monitoring/application/views/scripts/hosts/show.phtml index 3721d1eee..073c94405 100644 --- a/modules/monitoring/application/views/scripts/hosts/show.phtml +++ b/modules/monitoring/application/views/scripts/hosts/show.phtml @@ -2,233 +2,199 @@ compact): ?> - render('list/components/hostssummary.phtml') ?> render('partials/host/objects-header.phtml'); ?> + getScheduledDowntimes()); + ?> -
-

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

- -

- translatePlural( - 'Issue commands to %s selected host:', - 'Issue commands to all %s selected hosts:', - count($objects) - ), '' . count($objects) . '') ?> -

- - +
+ translate('No hosts found matching the filter'); ?> - +

translate('Problem Handling') ?>

+ + + - qlink( - $this->translate('Reschedule next checks'), - $rescheduleAllLink, - null, - array('icon' => 'reschedule') - ); ?> - -
- qlink( - $this->translate('Schedule downtimes'), - $downtimeAllLink, - null, - array('icon' => 'plug') - ); ?> - -
- qlink( - $this->translate('Submit passive check results'), - $processCheckResultAllLink, - null, - array('icon' => 'reply') - ); ?> - -
- qlink( - $this->translate('Add comments'), - $addCommentLink, - null, - array('icon' => 'comment') - ); ?> - - hasPermission('monitoring/command/send-custom-notification')): ?> -
- qlink( - sprintf($this->translate('Send a custom notification for all %u hosts'), $hostCount), - $sendCustomNotificationLink, - null, - array('icon' => 'comment') - ); ?> - - - - - -

- icon('attention-alt') ?> - translatePlural( - 'Problem', - 'Problems', - $unhandledCount + $problemCount - ) ?> -

- - -

- translatePlural( - 'There is %s problem.', - 'There are %s problems.', - $problemCount - ), - '' . $problemCount . '' - ); ?> -

- qlink( - sprintf( - $this->translatePlural( - 'Schedule a downtime for %u problem host', - 'Schedule a downtime for %u problem hosts', - $problemCount - ), - $problemCount - ), - $downtimeLink, - null, - array('icon' => 'plug') - ); ?> + if ($unackCount > 0): ?> + + + + - 0): ?> -
+ 0): ?> + + + + + + + + + + + + getComments())) > 0): ?> + + + + + - -

- translatePlural( - 'There is %s unhandled problem host, issue commands to the problematic host:', - 'There are %s unhandled problem hosts, issue commands to the problematic hosts:', - $unhandledCount - ), - '' . $unhandledCount . '' - ); ?> -

+ + + + - qlink( - sprintf( - $this->translatePlural( - 'Schedule a downtime for %u unhandled problem host', - 'Schedule a downtime for %u unhandled problem hosts', - $unhandledCount - ), - $unhandledCount - ), - $downtimeUnhandledLink, - null, - array('icon' => 'plug') - ); ?> + 0): ?> + + + + + + +
translate('%d unhandled problems'), $unackCount) ?> + qlink( + $this->translate('Acknowledge'), + $acknowledgeLink, + null, + array( + 'icon' => 'ok', + 'class' => 'action-link' + ) + ) ?> +
translatePlural( + '%s acknowledgedment', + '%s acknowledgedments', + $acknowledgedCount + ), + '' . $acknowledgedCount . '' + ); ?> + +
translate('Comments') ?> + qlink( + $this->translate('Add comments'), + $addCommentLink, + null, + array( + 'icon' => 'comment', + 'class' => 'action-link' + ) + ) ?> +
qlink( sprintf( $this->translatePlural( - 'Acknowledge %u unacknowledged problem hosts', - 'Acknowledge %u unacknowledged problem hosts', - $unackCount + '%s comment', + '%s comments', + $commentCount ), - $unackCount + $commentCount ), - $acknowledgeLink, + $commentsLink, null, - array('icon' => 'ok') + array('data-base-target' => '_next') ); ?> - +
+ translate('Downtimes') ?> + + qlink( + $this->translate('Schedule downtimes'), + $downtimeAllLink, + null, + array( + 'icon' => 'plug', + 'class' => 'action-link' + ) + ) ?> +
+ qlink( + sprintf( + $this->translatePlural( + '%d scheduled downtime', + '%d scheduled downtimes', + $scheduledDowntimeCount + ), + $scheduledDowntimeCount + ), + $showDowntimesLink, + null, + array( + 'data-base-target' => '_next' + ) + ) ?> +
- - + hasPermission('monitoring/command/send-custom-notification')): ?> +

translate('Notifications') ?>

+ + + + + + + +
translate('Notifications') ?> + qlink( + $this->translate('Send notifications'), + $sendCustomNotificationLink, + null, + array( + 'icon' => 'bell-alt', + 'class' => 'action-link' + ) + ) ?> +
+ - 0): ?> -
-

icon('ok', $this->translate('Acknowledgements')) ?> translate('Acknowledgements') ?>

+

translate('Check Execution') ?>

- translatePlural( - '%s Acknowledged Host Problem', - '%s Acknowledged Host Problems', - $acknowledgedCount - ), - '' . $acknowledgedCount . '' - ); ?> + + + + + + - - - + + + + - getScheduledDowntimes()) ?> - - -

icon('plug', $this->translate('Downtimes'))?> translate('Downtimes')?>

- qlink( - sprintf( - $this->translatePlural( - '%s scheduled downtime', - '%s scheduled downtimes', - $scheduledDowntimeCount - ), - $scheduledDowntimeCount - ), - $showDowntimesLink, - null, - array('data-base-target' => '_next') - );?> - translate('on all selected hosts.')) ?> - - 0): ?> -
- qlink( - sprintf( - $this->translatePlural( - '%s host', - '%s hosts', - $inDowntimeCount - ), - $inDowntimeCount - ), - $inDowntimeLink, - null, - array('data-base-target' => '_next') - ); ?> - translate('are currently in downtime.') ?> - - - - getComments())) > 0): ?> -

icon('comment', $this->translate('Comments'))?> translate('Comments') ?>

- qlink( - sprintf( - $this->translatePlural( - '%s comment', - '%s comments', - $commentCount - ), - $commentCount - ), - $commentsLink, - null, - array('data-base-target' => '_next') - ); ?> - translate('on all selected hosts.') ?> - + + + + + +
translate('Command') ?> + qlink( + $this->translate('Process check result'), + $processCheckResultAllLink, + null, + array( + 'icon' => 'reply', + 'class' => 'action-link' + ) + ) ?> +
translate('Schedule Check') ?>
+ qlink( + $this->translate('Reschedule'), + $rescheduleAllLink, + null, + array( + 'icon' => 'reschedule', + 'class' => 'action-link' + ) + ) ?> +
diff --git a/modules/monitoring/application/views/scripts/services/show.phtml b/modules/monitoring/application/views/scripts/services/show.phtml index f07ee8145..64d0d8e89 100644 --- a/modules/monitoring/application/views/scripts/services/show.phtml +++ b/modules/monitoring/application/views/scripts/services/show.phtml @@ -1,219 +1,201 @@
compact): ?> - + - - render('list/components/servicesummary.phtml') ?> - render('partials/service/objects-header.phtml'); ?> - + render('partials/service/objects-header.phtml') ?> + getScheduledDowntimes()); + ?>
-
-

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

- - translate('No services found matching the filter'); ?> +
+ + + translate('No services found matching the filter') ?> -

- translatePlural( - 'Issue commands to %s selected service:', - 'Issue commands to all %s selected services:', - count($objects) - ), '' . count($objects) . '') ?> -

- -
- qlink( - $this->translate('Reschedule next checks'), - $rescheduleAllLink, - null, - array('icon' => 'reschedule') - ); ?> - -
- qlink( - $this->translate('Schedule downtimes'), - $downtimeAllLink, - null, - array('icon' => 'plug') - ); ?> - -
- qlink( - $this->translate('Submit passive check results'), - $processCheckResultAllLink, - null, - array('icon' => 'reply') - ); ?> - -
- qlink( - $this->translate('Add comments'), - $addCommentLink, - null, - array('icon' => 'comment') - ); ?> - - hasPermission('monitoring/command/send-custom-notification')): ?> -
- qlink( - sprintf($this->translate('Send a custom notification for all %u services'), $serviceCount), - $sendCustomNotificationLink, - null, - array('icon' => 'comment') - ); ?> - - - - - -
-

- icon('attention-alt') ?> - translate('Problems') ?> -

- - -

- translatePlural( - 'There is %s problem, issue commands to the problem service', - 'There are %s problems, issue commands to the problem services', - $problemCount - ), - '' . $problemCount . '' - ); ?> -

- qlink( - sprintf( - $this->translatePlural( - 'Schedule a downtime for %s problem service', - 'Schedule downtimes for %s problem services', - $problemCount - ), - $problemCount - ), - $downtimeLink, - null, - array('icon' => 'plug') - ); ?> - - +

translate('Problem handling') ?>

+ + 0): ?> -
- qlink( - sprintf( - $this->translatePlural( - 'Acknowledge %u unacknowledged problem service', - 'Acknowledge %u unacknowledged problem services', - $unackCount - ), - $unackCount - ), - $acknowledgeLink, - null, - array('icon' => 'ok') - ); ?> + + + + - -

- translate('There are %s unhandled problem services. ' . - 'Issue commands to the problematic services:'), - '' . $unhandledCount . '') ?> - -

- qlink( - sprintf( - $this->translatePlural( - 'Schedule a downtime for %u unhandled problem service', - 'Schedule a downtime for %u unhandled problem services', - $unhandledCount - ), - $unhandledCount - ), - $downtimeUnhandledLink, - null, - array('icon' => 'plug') - ); ?> - + 0): ?> + + + + - - + + + + - 0): ?> -

icon('ok', $this->translate('Acknowledgements')) ?> translate('Acknowledgements') ?>

-

- translatePlural( - '%s Acknowledged Service Problem.', - '%s Acknowledged Service Problems.', - $acknowledgedCount - ), - '' . $acknowledgedCount . '' - ); ?> -

- + getComments())) > 0): ?> + + + + + - getScheduledDowntimes()) ?> + + + + - -

icon('plug', $this->translate('Downtimes')) ?> translate('Downtimes') ?>

- qlink( - sprintf( - $this->translatePlural( - '%s scheduled downtime', - '%s scheduled downtimes', - $scheduledDowntimeCount - ), - $scheduledDowntimeCount - ), - $showDowntimesLink, - null, - array('data-base-target' => '_next') - );?> - translate('on all selected services.')) ?> + 0): ?> + + + + + - 0): ?> -
- qlink( - sprintf($this->translatePlural( - '%s service', - '%s services', - $inDowntimeCount - ), $inDowntimeCount), - $inDowntimeLink, - null, - array('data-base-target' => '_next') - );?> - translate('are currently in downtime.')) ?> + +
translate('%d unhandled problems'), $unackCount) ?> qlink( + $this->translate('Acknowledge'), + $acknowledgeLink, + null, + array( + 'icon' => 'ok', + 'class' => 'action-link' + ) + ) ?>
translatePlural( + '%s acknowledgedment', + '%s acknowledgedments', + $acknowledgedCount + ), + '' . $acknowledgedCount . '' + ) ?> + + +
translate('Comments') ?> + qlink( + $this->translate('Add comments'), + $addCommentLink, + null, + array( + 'icon' => 'comment', + 'class' => 'action-link' + ) + ) ?> +
+ qlink( + sprintf( + $this->translatePlural( + '%s comment', + '%s comments', + $commentCount + ), + $commentCount + ), + $commentsLink, + null, + array('data-base-target' => '_next') + ) ?> +
+ translate('Downtimes') ?> + + qlink( + $this->translate('Schedule downtimes'), + $downtimeAllLink, + null, + array( + 'icon' => 'plug', + 'class' => 'action-link' + ) + ) ?> +
+ qlink( + sprintf( + $this->translatePlural( + '%d scheduled downtime', + '%d scheduled downtimes', + $scheduledDowntimeCount + ), + $scheduledDowntimeCount + ), + $showDowntimesLink, + null, + array( + 'data-base-target' => '_next' + ) + ) ?> +
+ + hasPermission('monitoring/command/send-custom-notification')): ?> + +

translate('Notifications') ?>

+ + + + + + + + +
translate('Notifications') ?> + qlink( + $this->translate('Send notifications'), + $sendCustomNotificationLink, + null, + array( + 'icon' => 'bell-alt', + 'class' => 'action-link' + ) + ) ?> +
- - getComments()) ?> - 0): ?> -

icon('comment') ?> translate('Comments') ?>

- qlink( - sprintf( - $this->translatePlural( - '%s comment.', - '%s comments.', - $commentCount - ), $commentCount), - $commentsLink, - null, - array('data-base-target' => '_next') - ); ?> - translate('on all selected services.') ?> +

translate('Check Execution') ?>

+ + + + + + + + + + + + + + + + + + +
translate('Command') ?> + qlink( + $this->translate('Process check result'), + $processCheckResultAllLink, + null, + array( + 'icon' => 'reply', + 'class' => 'action-link' + ) + ) ?> +
translate('Schedule Check') ?>
+ qlink( + $this->translate('Reschedule'), + $rescheduleAllLink, + null, + array( + 'icon' => 'reschedule', + 'class' => 'action-link' + ) + ) ?> +
-