Use service description instead of name in tree view

This commit is contained in:
Kike 2020-10-26 12:05:37 +01:00
parent 76324679ec
commit 3287223b4d
2 changed files with 20 additions and 1 deletions

View File

@ -264,6 +264,7 @@ class TreeService extends Tree
ts.id_agent_module, ts.id_agent_module,
ts.name, ts.name,
ts.name as `alias`, ts.name as `alias`,
ts.description as `description`,
ts.id as `rootID`, ts.id as `rootID`,
"services" as `rootType`, "services" as `rootType`,
"services" as `type`, "services" as `type`,
@ -311,6 +312,7 @@ class TreeService extends Tree
]; ];
$services[$service['id']]['name'] = $service['name']; $services[$service['id']]['name'] = $service['name'];
$services[$service['id']]['id'] = $service['id']; $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']; $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['id'] = (int) $item->service()->id();
$tmp['name'] = $item->service()->name(); $tmp['name'] = $item->service()->name();
$tmp['alias'] = $item->service()->name(); $tmp['alias'] = $item->service()->name();
$tmp['description'] = $item->service()->description();
$tmp['elementDescription'] = $item->description();
if ($this->connectedToNode === false if ($this->connectedToNode === false
&& is_metaconsole() === true && is_metaconsole() === true
@ -643,6 +647,8 @@ class TreeService extends Tree
ts.id_agent_module, ts.id_agent_module,
ts.name, ts.name,
ts.name as `alias`, ts.name as `alias`,
ts.description as `description`,
tse.description as `elementDescription`,
tse.id_service as `rootID`, tse.id_service as `rootID`,
"services" as `rootType`, "services" as `rootType`,
"services" as `type`, "services" as `type`,

View File

@ -637,7 +637,20 @@ var TreeController = {
.css("cursor", "pointer"); .css("cursor", "pointer");
$content.append($serviceDetailImage); $content.append($serviceDetailImage);
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);
}
// $content.append(" " + element.name);
} else { } else {
$content.remove($node); $content.remove($node);
} }