From e84491d438c36c4023665f7a5f15e28aa934a0c5 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Mon, 18 May 2015 14:49:06 +0200 Subject: [PATCH] Improve multi view layout refs #8565 --- .../views/scripts/comments/show.phtml | 2 +- .../views/scripts/hosts/show.phtml | 199 +++++++------- .../partials/host/objects-header.phtml | 14 +- .../partials/service/objects-header.phtml | 17 +- .../views/scripts/services/show.phtml | 253 +++++++++--------- public/css/icinga/monitoring-colors.less | 2 +- 6 files changed, 239 insertions(+), 248 deletions(-) diff --git a/modules/monitoring/application/views/scripts/comments/show.phtml b/modules/monitoring/application/views/scripts/comments/show.phtml index 6298749b2..f84f512b1 100644 --- a/modules/monitoring/application/views/scripts/comments/show.phtml +++ b/modules/monitoring/application/views/scripts/comments/show.phtml @@ -19,7 +19,7 @@
qlink( sprintf( - $this->translate('Remove all %d scheduled comments'), + $this->translate('Remove %d comments'), count($comments) ), $removeAllLink, diff --git a/modules/monitoring/application/views/scripts/hosts/show.phtml b/modules/monitoring/application/views/scripts/hosts/show.phtml index a5e1cff38..45bf19ebb 100644 --- a/modules/monitoring/application/views/scripts/hosts/show.phtml +++ b/modules/monitoring/application/views/scripts/hosts/show.phtml @@ -13,66 +13,61 @@ 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'); ?> + -

-

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

-

icon('attention-alt') ?> translatePlural( @@ -92,16 +86,16 @@

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

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

+ qlink( sprintf( $this->translatePlural( 'Schedule a downtime for %u problem host', @@ -113,13 +107,11 @@ $downtimeLink, null, array('icon' => 'plug') - ); ?>
- -

+ ); ?> -

+

translatePlural( 'There is %s unhandled problem host, issue commands to the problematic host:', @@ -128,8 +120,9 @@ ), '' . $unhandledCount . '' ); ?> +

-
qlink( + qlink( sprintf( $this->translatePlural( 'Schedule a downtime for %u unhandled problem host', @@ -141,10 +134,10 @@ $downtimeUnhandledLink, null, array('icon' => 'plug') - ); ?>
+ ); ?> - -
qlink( +
+ qlink( sprintf( $this->translatePlural( 'Acknowledge %u unhandled problem host', @@ -156,19 +149,16 @@ $acknowledgeUnhandledLink, null, array('icon' => 'ok') - ); ?>
-

+ ); ?> - -

0): ?>

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

-

translatePlural( '%s Acknowledged Host Problem', '%s Acknowledged Host Problems', @@ -181,57 +171,60 @@

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

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

-

translatePlural( - '%s Host currently in downtime.', - '%s Hosts currently in downtime.', - $inDowntimeCount + +

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

+ qlink( + sprintf( + $this->translatePlural( + '%s scheduled downtime', + '%s scheduled downtimes', + $scheduledDowntimeCount + ), + $scheduledDowntimeCount ), - '' . $inDowntimeCount . '' - ) ?> qlink( - $this->translate('List all'), - $inDowntimeLink, + $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( - 'There is %s host comment.', - 'There are %s host comments.', + '%s comment', + '%s comments', $commentCount ), - '' . $commentCount . '' - ) ?> - - qlink( - $this->translate('List all'), - $commentsLink, - null, - array('data-base-target' => '_next') - ); ?> - -

- - + $commentCount + ), + $commentsLink, + null, + array('data-base-target' => '_next') + ); ?> + translate('on all selected hosts.') ?> diff --git a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml index ef48eefe0..17cf9f7fe 100644 --- a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml @@ -5,22 +5,22 @@ $i = 0; ?> 0): ?> - - +
5) { + if (++ $i > 5) { continue; } ?> - - - + diff --git a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml index 7c707f0bf..e3c1227f3 100644 --- a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml @@ -4,20 +4,25 @@ use Icinga\Module\Monitoring\Object\Service; $i = 0; ?> 0): ?> -
host_state, true); ?>
hostFlags($host)) ?>escape($host->getName()); ?>escape($host->host_output) ?> + hostFlags($host)) ?> + escape($host->getName()); ?>
+ escape($host->host_output) ?> +
+
5) { + if (++ $i > 5) { continue; } ?> - - - - + diff --git a/modules/monitoring/application/views/scripts/services/show.phtml b/modules/monitoring/application/views/scripts/services/show.phtml index 5159e65b3..9291f6ef3 100644 --- a/modules/monitoring/application/views/scripts/services/show.phtml +++ b/modules/monitoring/application/views/scripts/services/show.phtml @@ -17,62 +17,55 @@ 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('Reschedule next checks'), - $rescheduleAllLink, - null, - array('icon' => 'reschedule') - ); ?> -
+
+ qlink( + $this->translate('Submit passive check results'), + $processCheckResultAllLink, + null, + array('icon' => 'reply') + ); ?> -
- 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') - ); ?> -
+
+ qlink( + $this->translate('Add comments'), + $addCommentLink, + null, + array('icon' => 'comment') + ); ?> hasPermission('monitoring/command/send-custom-notification')): ?> -
qlink( +
+ qlink( sprintf($this->translate('Send a custom notification for all %u services'), $serviceCount), $sendCustomNotificationLink, null, array('icon' => 'comment') - ); ?>
+ ); ?> -

- 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( - 'There is %s problem, issue commands to the problem service', - 'There are %s problems, issue commands to the problem services', + 'Schedule a downtime for %s problem service', + 'Schedule downtimes for %s 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') - ); ?> -
+ $problemCount + ), + $downtimeLink, + null, + array('icon' => 'plug') + ); ?> -

translate('There are %s unhandled problems. ' . +

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

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

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

+ $unhandledCount + ), + $downtimeUnhandledLink, + null, + array('icon' => 'plug') + ); ?> + +
+ qlink( + sprintf( + $this->translatePlural( + 'Acknowledge %u unhandled problem service', + 'Acknowledge %u unhandled problem services', + $unhandledCount + ), + $unhandledCount + ), + $acknowledgeUnhandledLink, + null, + array('icon' => 'ok') + ); ?> @@ -167,55 +159,56 @@

+ getScheduledDowntimes()) ?> - 0 /*&& $auth->hasPermission('monitoring/command/comment/delete')*/): ?> -

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

-

translatePlural( - '%s service currently in downtime.', - '%s services currently in downtime.', - $inDowntimeCount - ), '' . $inDowntimeCount . '') ?> + +

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): ?> +
qlink( - $this->translate('List all'), + sprintf($this->translatePlural( + '%s service', + '%s services', + $inDowntimeCount + ), $inDowntimeCount), $inDowntimeLink, null, array('data-base-target' => '_next') );?> -

+ translate('are currently in downtime.')) ?> + - -getComments()) ?> - 0): ?> -

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

-

translatePlural( - 'There is %s comment.', - 'There are %s comments.', - $commentCount - ), '' . $commentCount . ''); - ?> - qlink( - $this->translate('List all'), - $commentsLink, - null, - array('data-base-target' => '_next') - ); ?> -

- - - - - + array('data-base-target' => '_next') + ); ?> + translate('on all selected services.') ?> + diff --git a/public/css/icinga/monitoring-colors.less b/public/css/icinga/monitoring-colors.less index 3078fdec7..4902bebb1 100644 --- a/public/css/icinga/monitoring-colors.less +++ b/public/css/icinga/monitoring-colors.less @@ -944,7 +944,7 @@ table.statesummary { } td { - font-size: 0.85em; + font-size: 0.9em; line-height: 1.2em; padding-left: 0.2em; margin: 0;

service_state, true); ?>
serviceFlags($service)) ?>escape($service->getName()); ?>escape($service->getHost()->getName()); ?>escape($service->service_output) ?> + serviceFlags($service)) ?> + + escape($service->getName()); ?> + translate('on') ?> + escape($service->getHost()->getName()); ?>
+
+ escape($service->service_output) ?> +