diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 8852785e6e..fc99e0eda1 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -3744,7 +3744,11 @@ function html_print_input($data, $wrapper='div', $input_only=false) case 'autocomplete_module': // Module. - if (isset($data['selected']) === false || $data['selected'] === 0) { + if (($data['agent_id'] === false + || empty($data['agent_id']) === true) + && (isset($data['selected']) === false + || $data['selected'] === 0) + ) { $fields = [ 0 => __('Select an Agent first'), ]; @@ -3758,7 +3762,7 @@ function html_print_input($data, $wrapper='div', $input_only=false) ); if (is_metaconsole() === true) { - $connection = metaconsole_get_connection_id( + $connection = metaconsole_get_connection_by_id( $data['metaconsole_id'] ); diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/BarsGraph.php b/pandora_console/include/rest-api/models/VisualConsole/Items/BarsGraph.php index 4216364416..8ef6827cc2 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/BarsGraph.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/BarsGraph.php @@ -490,7 +490,7 @@ final class BarsGraph extends Item 'return' => true, 'module_input' => true, 'module_name' => 'moduleId', - 'module_none' => 'false', + 'module_none' => false, ], ]; diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/ColorCloud.php b/pandora_console/include/rest-api/models/VisualConsole/Items/ColorCloud.php index 768f131c5e..af8ef5512b 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/ColorCloud.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/ColorCloud.php @@ -399,7 +399,7 @@ final class ColorCloud extends Item 'return' => true, 'module_input' => true, 'module_name' => 'moduleId', - 'module_none' => 'false', + 'module_none' => false, ], ]; diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php b/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php index fd33ca652c..c5d2121d51 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php @@ -218,7 +218,7 @@ final class DonutGraph extends Item 'return' => true, 'module_input' => true, 'module_name' => 'moduleId', - 'module_none' => 'false', + 'module_none' => false, ], ]; diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/EventsHistory.php b/pandora_console/include/rest-api/models/VisualConsole/Items/EventsHistory.php index 5f9e2e8695..b53f768825 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/EventsHistory.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/EventsHistory.php @@ -188,7 +188,7 @@ final class EventsHistory extends Item 'return' => true, 'module_input' => true, 'module_name' => 'moduleId', - 'module_none' => 'false', + 'module_none' => false, ], ]; diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/ModuleGraph.php b/pandora_console/include/rest-api/models/VisualConsole/Items/ModuleGraph.php index 4a46151b21..0375a63b54 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/ModuleGraph.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/ModuleGraph.php @@ -521,7 +521,7 @@ final class ModuleGraph extends Item 'return' => true, 'module_input' => true, 'module_name' => 'moduleId', - 'module_none' => 'false', + 'module_none' => false, ], ]; diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/Percentile.php b/pandora_console/include/rest-api/models/VisualConsole/Items/Percentile.php index 062120b944..2f7f5c6a7a 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/Percentile.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/Percentile.php @@ -562,7 +562,7 @@ final class Percentile extends Item 'return' => true, 'module_input' => true, 'module_name' => 'moduleId', - 'module_none' => 'false', + 'module_none' => false, ], ]; diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/SimpleValue.php b/pandora_console/include/rest-api/models/VisualConsole/Items/SimpleValue.php index 4da22ecce5..d5305c3f2e 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/SimpleValue.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/SimpleValue.php @@ -335,7 +335,7 @@ final class SimpleValue extends Item 'return' => true, 'module_input' => true, 'module_name' => 'moduleId', - 'module_none' => 'false', + 'module_none' => false, ], ]; diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/StaticGraph.php b/pandora_console/include/rest-api/models/VisualConsole/Items/StaticGraph.php index e364d92bf6..1cd4a3bd41 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/StaticGraph.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/StaticGraph.php @@ -311,6 +311,26 @@ final class StaticGraph extends Item 'server_id_hidden' => $values['metaconsoleId'], 'name_server_hidden' => 'metaconsoleId', 'return' => true, + 'module_input' => true, + 'module_name' => 'moduleId', + 'module_none' => true, + ], + ]; + + // Autocomplete module. + $inputs[] = [ + 'label' => __('Module'), + 'arguments' => [ + 'type' => 'autocomplete_module', + 'fields' => $fields, + 'name' => 'moduleId', + 'selected' => $values['moduleId'], + 'return' => true, + 'sort' => false, + 'agent_id' => $values['agentId'], + 'metaconsole_id' => $values['metaconsoleId'], + 'nothing' => '--', + 'nothing_value' => 0, ], ]; diff --git a/pandora_console/include/rest-api/models/VisualConsole/View.php b/pandora_console/include/rest-api/models/VisualConsole/View.php index 2eb22b3812..c35342ef00 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/View.php +++ b/pandora_console/include/rest-api/models/VisualConsole/View.php @@ -355,6 +355,7 @@ class View extends \HTML $data['imageSrc'] = \get_parameter('imageSrc'); $data['agentId'] = \get_parameter('agentId'); $data['metaconsoleId'] = \get_parameter('metaconsoleId'); + $data['moduleId'] = \get_parameter('moduleId'); $data['showLastValueTooltip'] = \get_parameter( 'showLastValueTooltip' ); diff --git a/pandora_console/include/styles/visual_maps.css b/pandora_console/include/styles/visual_maps.css index 874ccd77fc..cae331117c 100644 --- a/pandora_console/include/styles/visual_maps.css +++ b/pandora_console/include/styles/visual_maps.css @@ -70,7 +70,8 @@ input.vs_button_ghost { #toolbox { margin-top: 13px; } -input.visual_editor_button_toolbox { + +div#edit-controls input.visual_editor_button_toolbox { padding-right: 20px; padding-top: 12px; padding-bottom: 12px; @@ -80,14 +81,14 @@ input.visual_editor_button_toolbox { border-radius: initial; } -button.sub:hover, -input.sub:hover { +div#edit-controls button.sub:hover, +div#edit-controls input.sub:hover { border: 0px; border-bottom: 3px solid #82b92e; } -button.sub[disabled], -input.sub[disabled] { +div#edit-controls button.sub[disabled], +div#edit-controls input.sub[disabled] { border-color: transparent; } diff --git a/pandora_console/operation/visual_console/view.php b/pandora_console/operation/visual_console/view.php index 3e6be05639..ebe531ab7e 100644 --- a/pandora_console/operation/visual_console/view.php +++ b/pandora_console/operation/visual_console/view.php @@ -67,6 +67,7 @@ function visual_map_print_button_editor_refactor( ui_require_css_file('visual_maps'); +ui_require_css_file('register'); // Query parameters. $visualConsoleId = (int) get_parameter(!is_metaconsole() ? 'id' : 'id_visualmap');