fixed errors VC

This commit is contained in:
Daniel Barbero Martin 2020-01-23 17:52:59 +01:00
parent 481f08bd5f
commit cd3691ecc3
12 changed files with 41 additions and 14 deletions

View File

@ -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']
);

View File

@ -490,7 +490,7 @@ final class BarsGraph extends Item
'return' => true,
'module_input' => true,
'module_name' => 'moduleId',
'module_none' => 'false',
'module_none' => false,
],
];

View File

@ -399,7 +399,7 @@ final class ColorCloud extends Item
'return' => true,
'module_input' => true,
'module_name' => 'moduleId',
'module_none' => 'false',
'module_none' => false,
],
];

View File

@ -218,7 +218,7 @@ final class DonutGraph extends Item
'return' => true,
'module_input' => true,
'module_name' => 'moduleId',
'module_none' => 'false',
'module_none' => false,
],
];

View File

@ -188,7 +188,7 @@ final class EventsHistory extends Item
'return' => true,
'module_input' => true,
'module_name' => 'moduleId',
'module_none' => 'false',
'module_none' => false,
],
];

View File

@ -521,7 +521,7 @@ final class ModuleGraph extends Item
'return' => true,
'module_input' => true,
'module_name' => 'moduleId',
'module_none' => 'false',
'module_none' => false,
],
];

View File

@ -562,7 +562,7 @@ final class Percentile extends Item
'return' => true,
'module_input' => true,
'module_name' => 'moduleId',
'module_none' => 'false',
'module_none' => false,
],
];

View File

@ -335,7 +335,7 @@ final class SimpleValue extends Item
'return' => true,
'module_input' => true,
'module_name' => 'moduleId',
'module_none' => 'false',
'module_none' => false,
],
];

View File

@ -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,
],
];

View File

@ -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'
);

View File

@ -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;
}

View File

@ -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');