From 3287223b4d761e3420f9c1455be8a8387818c947 Mon Sep 17 00:00:00 2001 From: Kike Date: Mon, 26 Oct 2020 12:05:37 +0100 Subject: [PATCH] Use service description instead of name in tree view --- .../include/class/TreeService.class.php | 6 ++++++ .../include/javascript/tree/TreeController.js | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/TreeService.class.php b/pandora_console/include/class/TreeService.class.php index b9721b3eb0..0afa46af73 100644 --- a/pandora_console/include/class/TreeService.class.php +++ b/pandora_console/include/class/TreeService.class.php @@ -264,6 +264,7 @@ class TreeService extends Tree ts.id_agent_module, ts.name, ts.name as `alias`, + ts.description as `description`, ts.id as `rootID`, "services" as `rootType`, "services" as `type`, @@ -311,6 +312,7 @@ class TreeService extends Tree ]; $services[$service['id']]['name'] = $service['name']; $services[$service['id']]['id'] = $service['id']; + $services[$service['id']]['description'] = $service['description']; $services[$service['id']]['serviceDetail'] = 'index.php?sec=network&sec2=enterprise/operation/services/services&tab=service_map&id_service='.(int) $service['id']; } @@ -512,6 +514,8 @@ class TreeService extends Tree $tmp['id'] = (int) $item->service()->id(); $tmp['name'] = $item->service()->name(); $tmp['alias'] = $item->service()->name(); + $tmp['description'] = $item->service()->description(); + $tmp['elementDescription'] = $item->description(); if ($this->connectedToNode === false && is_metaconsole() === true @@ -643,6 +647,8 @@ class TreeService extends Tree ts.id_agent_module, ts.name, ts.name as `alias`, + ts.description as `description`, + tse.description as `elementDescription`, tse.id_service as `rootID`, "services" as `rootType`, "services" as `type`, diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index f3e6ecec52..497e18c266 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -637,7 +637,20 @@ var TreeController = { .css("cursor", "pointer"); $content.append($serviceDetailImage); - $content.append(" " + element.name); + if ( + typeof element.elementDescription !== "undefined" && + element.elementDescription != "" + ) { + $content.append(" " + element.elementDescription); + } else if ( + typeof element.description !== "undefined" && + element.description != "" + ) { + $content.append(" " + element.description); + } else { + $content.append(" " + element.name); + } + // $content.append(" " + element.name); } else { $content.remove($node); }