From 92ff71365194c8b251bc3cd6b9bc822fe49191d5 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 5 May 2020 18:58:45 +0200 Subject: [PATCH] 1st approach --- .../include/javascript/tree/TreeController.js | 32 ++++++++----------- pandora_console/include/styles/pandora.css | 9 ++++++ pandora_console/include/styles/tree.css | 15 ++++++++- pandora_console/operation/tree.php | 2 +- 4 files changed, 37 insertions(+), 21 deletions(-) diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index eaac70d8ec..fc10404190 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -1,3 +1,5 @@ +/* eslint-disable */ + // Pandora FMS - http://pandorafms.com // ================================================== // Copyright (c) 2005-2010 Artica Soluciones Tecnologicas @@ -20,7 +22,7 @@ var TreeController = { recipient: "", tree: [], emptyMessage: "No data found.", - foundMessage: "Found groups", + foundMessage: "Groups found", errorMessage: "Error", baseURL: "", ajaxURL: "ajax.php", @@ -48,9 +50,15 @@ var TreeController = { .addClass("tree-root") .hide() .prepend( - '' + + '' + 'images/pandora.png" />' + + "" + + (controller.tree.length > 0 + ? controller.foundMessage + ": " + controller.tree.length + : "") + + "" ); } // Normal group @@ -315,7 +323,7 @@ var TreeController = { _processNodeCounterTitle($totalCounter, type, "total"); // Open the parentheses - $counters.append(" ("); + $counters.append("      [ "); $counters.append($totalCounter); @@ -409,7 +417,7 @@ var TreeController = { } // Close the parentheses - $counters.append(")"); + $counters.append(" ]"); hasCounters = true; } @@ -1086,20 +1094,6 @@ var TreeController = { } controller.recipient.empty(); - if ( - controller.tree.length !== undefined && - controller.foundMessage !== "not" - ) { - controller.recipient.html( - "
" + - controller.foundMessage + - ": " + - controller.tree.length + - "
" + - "
" - ); - } - var $children = _processGroup(this.recipient, this.tree, true); $children.show(); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index b9f3b2a1ed..abdeb95fb2 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -588,9 +588,18 @@ select:-internal-list-box { .padding-6 { padding: 6em; } +.margin-right-1 { + margin-right: 1em; +} +.margin-left-1 { + margin-left: 1em; +} .margin-right-2 { margin-right: 2em; } +.margin-left-2 { + margin-left: 2em; +} .no-border { border: none; } diff --git a/pandora_console/include/styles/tree.css b/pandora_console/include/styles/tree.css index 42649bd048..1113a2beb9 100644 --- a/pandora_console/include/styles/tree.css +++ b/pandora_console/include/styles/tree.css @@ -4,7 +4,7 @@ } .tree-group { - margin-left: 19px; + margin-left: 24px; padding-top: 1px; } @@ -18,12 +18,24 @@ min-height: 26px; } +div.tree-node { + background: 0 0; +} + +div.tree-node span { + font-size: 1.2em; +} + .tree-node:last-child { background: 0 0; } .node-content { height: 26px; font-size: 1.2em; + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items: center; } .node-content > img { @@ -121,6 +133,7 @@ } .tree-node > .node-content > .tree-node-counters { + font-size: 1em; } .tree-node > .node-content > img { diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index 41a6b9c5d2..91c23d164f 100755 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -345,7 +345,7 @@ enterprise_hook('close_meta_frame'); detailRecipient: $.fixedBottomBox({ width: 400, height: window.innerHeight * 0.9 }), page: parameters['page'], emptyMessage: "", - foundMessage: "", + foundMessage: "", tree: data.tree, baseURL: "", ajaxURL: "",