Merge branch 'ent-13188-no-salen-todos-lo-modulos-en-custom-graphs' into 'develop'

Ent 13188 no salen todos lo modulos en custom graphs

See merge request artica/pandorafms!7243
This commit is contained in:
Enrique Martin 2024-04-29 08:12:12 +00:00
commit 0d71fc98e1
5 changed files with 103 additions and 39 deletions

View File

@ -154,14 +154,16 @@ $table->data[0][1] = html_print_label_input_block(
echo '<span id ="none_text" class="invisible">'.__('None').'</span>';
echo "<form id='agentmodules' method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&add_module=1&edit_graph=1&id=".$id_graph."'>";
echo "<table width='100%' cellpadding='4' cellpadding='4' class='databox filters max_floating_element_size'>";
echo "<table width='100%' cellpadding='4' cellpadding='4' class='databox filters max_floating_element_size custom-graph-editor'>";
echo '<tr>';
echo '<td class="w50p pdd_50px" id="select_multiple_modules_filtered">'.html_print_input(
[
'type' => 'select_multiple_modules_filtered',
'uniqId' => 'modules',
'class' => 'flex flex-row',
'searchBar' => false,
'searchBar' => true,
'searchBarAgents' => false,
'searchBarModules' => true,
'placeholderAgents' => __('Search agent name'),
]
).'</td>';

View File

@ -1686,34 +1686,56 @@ function html_print_select_multiple_modules_filtered(array $data):string
);
$output .= '</div>';
$agent_class = '';
if (empty($data['searchBar']) === false && $data['searchBar'] === true) {
$output .= '<div>';
$output .= '<div class="agents-modules-multiple-search-bar">';
$output .= '<div>';
$output .= html_print_input(
[
'type' => 'text',
'name' => 'agent-searchBar-'.$uniqId,
'onKeyUp' => 'searchAgent(\''.$uniqId.'\')',
'placeholder' => __('Type to search agents'),
'return' => true,
]
);
if (isset($data['searchBarAgents']) === false) {
$data['searchBarAgents'] = true;
}
$output .= '</div>';
if (isset($data['searchBarModules']) === false) {
$data['searchBarModules'] = true;
}
$output .= '<div>';
$output .= html_print_input(
[
'type' => 'text',
'name' => 'module-searchBar-'.$uniqId,
'onKeyUp' => 'searchModule(\''.$uniqId.'\')',
'return' => true,
'placeholder' => __('Type to search modules'),
]
);
if ($data['searchBarAgents'] === true) {
$output .= '<div>';
$output .= html_print_input(
[
'type' => 'text',
'label_class' => 'font-title-font',
'label' => __('Filter agent'),
'name' => 'agent-searchBar-'.$uniqId,
'onKeyUp' => 'searchAgent(\''.$uniqId.'\')',
'placeholder' => __('Type to search agents'),
'return' => true,
]
);
$output .= '</div>';
$output .= '</div>';
} else {
$agent_class = 'custom-graph-editor-agents-module-filter';
$output .= '<div></div>';
}
if ($data['searchBarModules'] === true) {
$output .= '<div>';
$output .= html_print_input(
[
'type' => 'text',
'label_class' => 'font-title-font',
'label' => __('Filter module'),
'name' => 'module-searchBar-'.$uniqId,
'onKeyUp' => 'searchModule(\''.$uniqId.'\')',
'return' => true,
'placeholder' => __('Type to search modules'),
]
);
$output .= '</div>';
} else {
$output .= '<div></div>';
}
$output .= '</div>';
}
@ -1770,6 +1792,7 @@ function html_print_select_multiple_modules_filtered(array $data):string
'style' => 'min-width: 200px;max-width:200px;',
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
'placeholder' => (isset($data['placeholderAgents']) === true) ? $data['placeholderAgents'] : '',
'input_class' => $agent_class,
]
);
} else {
@ -1786,6 +1809,7 @@ function html_print_select_multiple_modules_filtered(array $data):string
'style' => 'min-width: 200px;max-width:200px;',
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
'placeholder' => (isset($data['placeholderAgents']) === true) ? $data['placeholderAgents'] : '',
'input_class' => $agent_class,
]
);
}
@ -1929,7 +1953,7 @@ function html_print_select_multiple_modules_filtered_formated(array $data):strin
'return' => true,
'nothing' => __('All'),
'nothing_value' => 0,
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().', true)',
]
);
$output .= '</div>';
@ -1965,7 +1989,7 @@ function html_print_select_multiple_modules_filtered_formated(array $data):strin
'name' => 'filtered-module-show-common-modules-'.$uniqId,
'id' => 'filtered-module-show-common-modules-'.$uniqId,
'return' => true,
'onchange' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
'onchange' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().', true)',
]
);
@ -2053,7 +2077,7 @@ function html_print_select_multiple_modules_filtered_formated(array $data):strin
'return' => true,
'multiple' => true,
'style' => 'min-width: 200px;max-width:200px;',
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().', true)',
'placeholder' => (isset($data['placeholderAgents']) === true) ? $data['placeholderAgents'] : '',
'truncate_size' => 300,
]
@ -2070,7 +2094,7 @@ function html_print_select_multiple_modules_filtered_formated(array $data):strin
'return' => true,
'multiple' => true,
'style' => 'min-width: 200px;max-width:200px;',
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().', true)',
'placeholder' => (isset($data['placeholderAgents']) === true) ? $data['placeholderAgents'] : '',
'truncate_size' => 300,
]

View File

@ -211,7 +211,7 @@ function fmAgentChange(uniqId) {
}
// eslint-disable-next-line no-unused-vars
function fmModuleChange(uniqId, isMeta) {
function fmModuleChange(uniqId, isMeta, valueID = false) {
var idModuleGroup = $("#filtered-module-module-group-" + uniqId).val();
var idAgents = $("#filtered-module-agents-" + uniqId).val();
var commonSelectorType = $(
@ -253,7 +253,7 @@ function fmModuleChange(uniqId, isMeta) {
.html(value["nombre"]);
} else {
option
.attr("value", id)
.attr("value", valueID === false ? value : id)
.attr("title", value)
.html(value);
}

View File

@ -14222,14 +14222,6 @@ button.ui-button-text-only.ui-widget.sub:hover,
box-shadow: none;
}
.black-and-white {
filter: saturate(0);
}
.invert_filter.black-and-white {
filter: invert(1) saturate(0) !important;
}
div.tox .tox-editor-header {
z-index: 1;
}
@ -14277,3 +14269,41 @@ div.fixed-bottom-box.tree-view-bottom-modal {
z-index: 1;
border: 1px solid var(--border-color);
}
.custom-graph-editor
#select_multiple_modules_filtered
> div.agents-modules-multiple-search-bar
> div {
width: 37%;
}
.custom-graph-editor
#select_multiple_modules_filtered
> div.agents-modules-multiple-search-bar
> div
> div
> input {
width: 100%;
max-width: 100%;
}
.custom-graph-editor
#select_multiple_modules_filtered
> div.agents-modules-multiple-search-bar
> div
> div {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex-wrap: wrap;
width: 100%;
}
.custom-graph-editor-agents-module-filter {
margin-top: -69px;
}
.custom-graph-editor-agents-module-filter > span.select2.select2-container {
height: 189px;
}

View File

@ -2114,3 +2114,11 @@ select option:checked {
.color_666 {
color: var(--text-color);
}
.black-and-white {
filter: saturate(0);
}
.invert_filter.black-and-white {
filter: invert(1) saturate(0) !important;
}