Merge branch 'ent-8532-widget-agent-modulos-no-muestra-modulos' into 'develop'

Fix agentmodules widget conf style

See merge request artica/pandorafms!4693
This commit is contained in:
Daniel Rodriguez 2022-02-22 11:47:55 +00:00
commit 3092a00edb
5 changed files with 56 additions and 19 deletions

View File

@ -1659,17 +1659,31 @@ function html_print_select_multiple_modules_filtered(array $data):string
0 => __('Show common modules'),
1 => __('Show all modules'),
];
$output .= html_print_input(
[
'label' => __('Show common modules'),
'type' => 'select',
'fields' => $selection,
'name' => 'filtered-module-show-common-modules-'.$uniqId,
'selected' => $data['mShowCommonModules'],
'return' => true,
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
]
);
if (true) {
$output .= html_print_input(
[
'label' => __('Only common modules'),
'type' => 'switch',
'value' => 'checked',
'id' => 'filtered-module-show-common-modules-'.$uniqId,
'return' => true,
'onchange' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
]
);
} else {
$output .= html_print_input(
[
'label' => __('Show common modules'),
'type' => 'select',
'fields' => $selection,
'name' => 'filtered-module-show-common-modules-'.$uniqId,
'return' => true,
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
]
);
}
if ($data['mAgents'] !== null) {
$all_modules = get_modules_agents(

View File

@ -214,9 +214,14 @@ function fmAgentChange(uniqId) {
function fmModuleChange(uniqId, isMeta) {
var idModuleGroup = $("#filtered-module-module-group-" + uniqId).val();
var idAgents = $("#filtered-module-agents-" + uniqId).val();
var showCommonModules = $(
var commonSelectorType = $(
"#filtered-module-show-common-modules-" + uniqId
).val();
).attr("type");
var showCommonModules = +(
$("#filtered-module-show-common-modules-" + uniqId).prop("checked") == false
);
jQuery.post(
"ajax.php",
{
@ -227,11 +232,15 @@ function fmModuleChange(uniqId, isMeta) {
selection: showCommonModules
},
function(data) {
debugger;
$("#filtered-module-modules-" + uniqId).html("");
if (data) {
jQuery.each(data, function(id, value) {
var option = $("<option></option>");
if (isMeta === 1) {
if (value["id_node"] == null || value["id_node"] == "") {
option.attr("value", id).html(value);
}
option
.attr(
"value",

View File

@ -388,9 +388,12 @@ function initialiceLayout(data) {
dashboardId: data.dashboardId,
widgetId: widgetId
},
width: widgetId == 14 || widgetId == 2 || widgetId == 23 ? 750 : 450,
maxHeight: 610,
minHeight: 400
width:
widgetId == 14 || widgetId == 2 || widgetId == 23 || widgetId == 16
? 750
: 450,
maxHeight: 650,
minHeight: widgetId == 16 ? 450 : 400
},
onsubmit: {
page: data.page,

View File

@ -267,6 +267,7 @@ class AgentModuleWidget extends Widget
'mShowSelectedOtherGroups' => true,
'mReturnAllGroup' => $return_all_group,
'mMetaFields' => ((bool) is_metaconsole()),
'commonModulesSwitch' => true,
],
];

View File

@ -493,7 +493,7 @@ div#main_pure {
#form-config-widget .info_box,
.content-widget .info_box {
border-radius: 5px;
width: 90%;
width: 100%;
}
#form-config-widget .info_box {
@ -519,16 +519,17 @@ div#main_pure {
#select_multiple_modules_filtered {
border: 1px solid #c1c1c1;
border-radius: 10px;
width: auto;
}
#select_multiple_modules_filtered > div {
display: flex;
flex-direction: row;
justify-content: space-around;
justify-content: space-between;
align-items: center;
margin: 5px;
flex-wrap: wrap;
flex: 1 1 320px;
flex: 1 2 750px;
}
#select_multiple_modules_filtered > div > div {
@ -537,12 +538,21 @@ div#main_pure {
justify-content: center;
align-items: center;
flex-wrap: wrap;
width: 250px;
}
#select_multiple_modules_filtered > div > div > * {
flex: auto;
}
#select_multiple_modules_filtered > div > div > select {
min-width: 250px !important;
}
#select_multiple_modules_filtered > div > div > .select2 {
min-width: 250px !important;
}
.visual-console-container-dashboard div.label strong {
color: inherit;
}