From 3f884d9aff0df3655a34dce3aab57b54023979db Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Fri, 10 Mar 2023 11:09:36 +0100 Subject: [PATCH] Tree View fixed --- .../include/class/TreeService.class.php | 32 +++++-------------- pandora_console/include/styles/tree.css | 24 +++++++++----- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/pandora_console/include/class/TreeService.class.php b/pandora_console/include/class/TreeService.class.php index 69b06fd684..bfb1556202 100644 --- a/pandora_console/include/class/TreeService.class.php +++ b/pandora_console/include/class/TreeService.class.php @@ -424,21 +424,21 @@ class TreeService extends Tree switch ($item->agent()->lastStatus()) { case AGENT_STATUS_NORMAL: - $tmp['statusImageHTML'] = 'NORMAL status.'; + $tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #82b92e', 'title' => __('Normal status') ], true); break; case AGENT_STATUS_CRITICAL: case AGENT_STATUS_ALERT_FIRED: - $tmp['statusImageHTML'] = 'CRITICAL status.'; + $tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #e63c52', 'title' => __('Critical status') ], true); break; case AGENT_STATUS_WARNING: - $tmp['statusImageHTML'] = 'WARNING status.'; + $tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #f3b200', 'title' => __('Warning status') ], true); break; case AGENT_STATUS_UNKNOWN: default: - $tmp['statusImageHTML'] = 'UNKNOWN status.'; + $tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #B2B2B2', 'title' => __('Unknown status') ], true); break; } @@ -634,36 +634,20 @@ class TreeService extends Tree $tmp['rootID'] = $this->rootID; switch ($item->service()->lastStatus()) { case SERVICE_STATUS_NORMAL: - $tmp['statusImageHTML'] = 'NORMAL status.'; + $tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #82b92e', 'title' => __('Normal status') ], true); break; case SERVICE_STATUS_CRITICAL: - $tmp['statusImageHTML'] = 'CRITICAL status.'; + $tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #e63c52', 'title' => __('Critical status') ], true); break; case SERVICE_STATUS_WARNING: - $tmp['statusImageHTML'] = 'WARNING status.'; + $tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #f3b200', 'title' => __('Warning status') ], true); break; case SERVICE_STATUS_UNKNOWN: default: - $tmp['statusImageHTML'] = 'UNKNOWN status.'; + $tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #B2B2B2', 'title' => __('Unknown status') ], true); break; } break; diff --git a/pandora_console/include/styles/tree.css b/pandora_console/include/styles/tree.css index 61ad75716d..a987a751d9 100644 --- a/pandora_console/include/styles/tree.css +++ b/pandora_console/include/styles/tree.css @@ -1,6 +1,6 @@ .tree-root { margin-top: 0px; - margin-bottom: 0px; + margin-bottom: 40px; } .tree-node.tree-node-header { @@ -8,12 +8,6 @@ flex-direction: row; flex-wrap: wrap; align-items: center; - /* - width: calc(100% - 24px); - border: 1px solid #eaeaea; - border-radius: 4px; - background-color: #fff; - */ margin-bottom: 8px; } @@ -392,6 +386,20 @@ div#tree-controller-recipient { .tree-node > .node-content > .agent-alerts-fired { float: left; position: relative; - left: 26px; + left: 13px; top: -5px; } + +.tree-node > .node-content > div.tree-service-status { + width: 7px; + height: 20px; + margin-left: 0; + border-radius: 5px; +} + +.tree-node > .node-content.node-service > div.tree-service-status { + width: 7px; + height: 20px; + margin-left: 5px; + border-radius: 5px; +}