From 9c3da17f2e30752ddaf4a15a6244f8d7c2c7d1e6 Mon Sep 17 00:00:00 2001 From: Jennifer Mourek Date: Mon, 27 May 2019 11:44:02 +0200 Subject: [PATCH] Improve host-service distinction for hosts, services, comments and downtimes --- .../views/scripts/list/services.phtml | 77 ++++++++++++------- .../partials/comment/comment-detail.phtml | 47 +++++++---- .../partials/downtime/downtime-header.phtml | 57 +++++++++----- modules/monitoring/public/css/module.less | 10 +++ modules/monitoring/public/css/tables.less | 4 + 5 files changed, 136 insertions(+), 59 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index 7deacaf59..0c7865316 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -61,33 +61,56 @@ if (! $this->compact): ?>
- iconImage()->service($service) ?> - showHost): ?>qlink( - $service->host_display_name - . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''), - $hostLink, - null, - array( - 'title' => sprintf( - $this->translate('Show detailed information for host %s'), - $service->host_display_name - ) - ) - ) ?>: - qlink( - $service->service_display_name, - $serviceLink, - null, - array( - 'title' => sprintf( - $this->translate('Show detailed information for service %s on host %s'), - $service->service_display_name, - $service->host_display_name - ), - 'class' => 'rowaction' - ) - ) ?> - serviceFlags($service) ?> + + iconImage()->service($service) ?> + showHost) { + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $service->service_display_name, + $serviceLink, + null, + array( + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $service->service_display_name, + $service->host_display_name + ), + 'class' => 'rowaction' + ) + ), + $this->qlink( + $service->host_display_name + . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''), + $hostLink, + null, + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $service->host_display_name + ) + ] + ) + ); + } else { + echo $this->qlink( + $service->service_display_name, + $serviceLink, + null, + array( + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $service->service_display_name, + $service->host_display_name + ), + 'class' => 'rowaction' + ) + ); + } + ?> + + serviceFlags($service) ?>
diff --git a/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml b/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml index e16cba124..4b769d44a 100644 --- a/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml +++ b/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml @@ -1,23 +1,42 @@
objecttype === 'service') { - echo $this->icon('service', $this->translate('Service')); - echo $this->qlink( - $comment->host_display_name . ': ' . $comment->service_display_name, - 'monitoring/service/show', - array( - 'host' => $comment->host_name, - 'service' => $comment->service_description + echo ''; + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $comment->service_display_name, + 'monitoring/service/show', + [ + 'host' => $comment->host_name, + 'service' => $comment->service_description + ], + null, + [ + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $comment->service_display_name, + $comment->host_display_name + ), + 'class' => 'rowaction' + ] ), - array( - 'title' => sprintf( - $this->translate('Show detailed information for this comment about service %s on host %s'), - $comment->service_display_name, - $comment->host_display_name - ) + $this->qlink( + $comment->host_display_name, + $this->href( + 'monitoring/host/show', + ['host' => $comment->host_name] + ), + null, + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $comment->host_display_name + ) + ] ) ); + echo ''; } else { - echo $this->icon('host', $this->translate('Host')); echo $this->qlink( $comment->host_display_name, 'monitoring/host/show', 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 9e733f7aa..d6b05e809 100644 --- a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml @@ -9,24 +9,45 @@
- - icon('service', $this->translate('Service')); ?> qlink( - $downtime->host_display_name . ': ' . $downtime->service_display_name, - 'monitoring/service/show', - array( - 'host' => $downtime->host_name, - 'service' => $downtime->service_description + '; + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $downtime->service_display_name, + 'monitoring/service/show', + [ + 'host' => $downtime->host_name, + 'service' => $downtime->service_description + ], + null, + [ + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $downtime->service_display_name, + $downtime->host_display_name + ), + 'class' => 'rowaction' + ] ), - 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 - ) + $this->qlink( + $downtime->host_display_name, + $this->href( + 'monitoring/host/show', + ['host' => $downtime->host_name] + ), + null, + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $downtime->host_display_name + ) + ] ) - ); ?> - - icon('host', $this->translate('host')); ?> qlink( + ); + echo ''; + } else { + echo $this->qlink( $downtime->host_display_name, 'monitoring/host/show', array('host' => $downtime->host_name, 'downtime_id' => $downtime->id), @@ -36,8 +57,8 @@ $downtime->host_display_name ) ) - ); ?> - + ); + } ?> escape(sprintf( $downtime->is_flexible diff --git a/modules/monitoring/public/css/module.less b/modules/monitoring/public/css/module.less index 8ba1b29d6..e34847214 100644 --- a/modules/monitoring/public/css/module.less +++ b/modules/monitoring/public/css/module.less @@ -175,6 +175,16 @@ } } +.service-on { + color: @text-color-light; + + > a { + color: @text-color; + letter-spacing: normal; + font-weight: bold; + } +} + // State table in the host and service multi-selection and detail views .host-detail-state, .service-detail-state { diff --git a/modules/monitoring/public/css/tables.less b/modules/monitoring/public/css/tables.less index efb4bdbf4..6fa35e8de 100644 --- a/modules/monitoring/public/css/tables.less +++ b/modules/monitoring/public/css/tables.less @@ -205,6 +205,10 @@ // Wraps links, icons and meta in overviews .state-header { .clearfix(); + + > a { + font-weight: bold; + } } // State icons, e.g. acknowledged in overviews