mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Merge branch 'ent-13182-fallo-de-interface-en-operaciones-masivas-agentes' into 'develop'
Ent 13182 fallo de interface en operaciones masivas agentes See merge request artica/pandorafms!7072
This commit is contained in:
commit
f95abfd722
@ -628,7 +628,7 @@ if (is_metaconsole() === true) {
|
|||||||
$url = 'index.php?sec=advanced&sec2=advanced/massive_operations&tab=massive_agents&pure=0&option=edit_agents';
|
$url = 'index.php?sec=advanced&sec2=advanced/massive_operations&tab=massive_agents&pure=0&option=edit_agents';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<form method="post" autocomplete="off" id="form_agent" action="'.$url.'">';
|
echo '<form method="post" autocomplete="off" id="form_agent" class="form-agent-bulk-operation" action="'.$url.'">';
|
||||||
echo html_print_avoid_autocomplete();
|
echo html_print_avoid_autocomplete();
|
||||||
$params = [
|
$params = [
|
||||||
'id_group' => ($id_group ?? ''),
|
'id_group' => ($id_group ?? ''),
|
||||||
@ -651,14 +651,11 @@ echo '<div id="form_agents" style="display:none">';
|
|||||||
|
|
||||||
$table = new StdClass();
|
$table = new StdClass();
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->class = 'databox filters';
|
$table->class = 'databox filters filter-table-adv';
|
||||||
$table->head = [];
|
$table->head = [];
|
||||||
$table->style = [];
|
$table->style = [];
|
||||||
$table->style[0] = 'font-weight: bold; width: 150px;';
|
$table->size[0] = '50%';
|
||||||
$table->size[0] = '15%';
|
$table->size[1] = '50%';
|
||||||
$table->size[1] = '35%';
|
|
||||||
$table->size[2] = '15%';
|
|
||||||
$table->size[3] = '35%';
|
|
||||||
|
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
|
|
||||||
@ -683,7 +680,6 @@ if (is_metaconsole() === false) {
|
|||||||
$modules_values[$m['id_module']] = $m['name'];
|
$modules_values[$m['id_module']] = $m['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[0][0] = __('Parent');
|
|
||||||
$params = [];
|
$params = [];
|
||||||
$params['return'] = true;
|
$params['return'] = true;
|
||||||
$params['show_helptip'] = true;
|
$params['show_helptip'] = true;
|
||||||
@ -694,10 +690,16 @@ if (is_metaconsole() === false) {
|
|||||||
$params['value'] = db_get_value('alias', 'tagente', 'id_agente', $id_parent);
|
$params['value'] = db_get_value('alias', 'tagente', 'id_agente', $id_parent);
|
||||||
$params['selectbox_id'] = 'cascade_protection_module';
|
$params['selectbox_id'] = 'cascade_protection_module';
|
||||||
$params['javascript_is_function_select'] = true;
|
$params['javascript_is_function_select'] = true;
|
||||||
$table->data[0][1] = ui_print_agent_autocomplete_input($params);
|
|
||||||
|
|
||||||
$table->data[0][1] .= '<b>'.__('Cascade protection').'</b>';
|
$table->data[0][0] = html_print_label_input_block(
|
||||||
$table->data[0][1] .= html_print_select(
|
__('Parent'),
|
||||||
|
ui_print_agent_autocomplete_input($params)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$table->data[0][1] = html_print_label_input_block(
|
||||||
|
__('Cascade protection'),
|
||||||
|
'<div class="flex-row-center">'.html_print_select(
|
||||||
[
|
[
|
||||||
1 => __('Yes'),
|
1 => __('Yes'),
|
||||||
0 => __('No'),
|
0 => __('No'),
|
||||||
@ -707,24 +709,32 @@ if (is_metaconsole() === false) {
|
|||||||
'',
|
'',
|
||||||
__('No change'),
|
__('No change'),
|
||||||
-1,
|
-1,
|
||||||
true
|
true,
|
||||||
);
|
false,
|
||||||
|
true,
|
||||||
$table->data[0][1] .= ' '.__('Module').' ';
|
'w50p',
|
||||||
$table->data[0][1] .= html_print_select(
|
false,
|
||||||
|
'width: 48%;'
|
||||||
|
).'<div class="flex-row-center mrgn_lft_20px">'.__('Module').' '.html_print_select(
|
||||||
($modules ?? ''),
|
($modules ?? ''),
|
||||||
'cascade_protection_module',
|
'cascade_protection_module',
|
||||||
($cascade_protection_module ?? ''),
|
($cascade_protection_module ?? ''),
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
0,
|
0,
|
||||||
true
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'width: 100%;'
|
||||||
|
).'</div></div>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[1][0] = __('Group');
|
$table->data[1][0] = html_print_label_input_block(
|
||||||
$table->data[1][1] = '<div class="w290px inline">';
|
__('Group'),
|
||||||
$table->data[1][1] .= html_print_select_groups(
|
html_print_select_groups(
|
||||||
false,
|
false,
|
||||||
'AR',
|
'AR',
|
||||||
false,
|
false,
|
||||||
@ -737,14 +747,13 @@ $table->data[1][1] .= html_print_select_groups(
|
|||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
'',
|
'',
|
||||||
false,
|
false
|
||||||
'width: 150px;'
|
)
|
||||||
);
|
);
|
||||||
$table->data[1][1] .= '</div>';
|
|
||||||
|
|
||||||
$table->data[2][0] = __('Interval');
|
$table->data[1][1] = html_print_label_input_block(
|
||||||
|
__('Interval'),
|
||||||
$table->data[2][1] = html_print_extended_select_for_time(
|
html_print_extended_select_for_time(
|
||||||
'interval',
|
'interval',
|
||||||
-2,
|
-2,
|
||||||
'',
|
'',
|
||||||
@ -752,17 +761,23 @@ $table->data[2][1] = html_print_extended_select_for_time(
|
|||||||
'0',
|
'0',
|
||||||
10,
|
10,
|
||||||
true,
|
true,
|
||||||
'width: 150px',
|
false,
|
||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
true
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[3][0] = __('OS');
|
$os_preview = ' <span id="os_preview" class="mrgn_lft_10px">';
|
||||||
$table->data[3][1] = html_print_select_from_sql(
|
$os_preview .= ui_print_os_icon($id_os, false, true);
|
||||||
|
$os_preview .= '</span>';
|
||||||
|
|
||||||
|
$table->data[2][0] = html_print_label_input_block(
|
||||||
|
__('OS'),
|
||||||
|
'<div class="flex-row-center">'.html_print_select_from_sql(
|
||||||
'SELECT id_os, name FROM tconfig_os',
|
'SELECT id_os, name FROM tconfig_os',
|
||||||
'id_os',
|
'id_os',
|
||||||
$id_os,
|
$id_os,
|
||||||
@ -773,11 +788,9 @@ $table->data[3][1] = html_print_select_from_sql(
|
|||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
'width: 105px;'
|
'width: 100%;'
|
||||||
|
).$os_preview.'</div>'
|
||||||
);
|
);
|
||||||
$table->data[3][1] .= ' <span id="os_preview">';
|
|
||||||
$table->data[3][1] .= ui_print_os_icon($id_os, false, true);
|
|
||||||
$table->data[3][1] .= '</span>';
|
|
||||||
|
|
||||||
// Network server.
|
// Network server.
|
||||||
$none = '';
|
$none = '';
|
||||||
@ -785,8 +798,9 @@ if ($server_name == '' && $id_agente) {
|
|||||||
$none = __('None');
|
$none = __('None');
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[4][0] = __('Server');
|
$table->data[2][1] = html_print_label_input_block(
|
||||||
$table->data[4][1] = html_print_select(
|
__('Server'),
|
||||||
|
html_print_select(
|
||||||
servers_get_names(),
|
servers_get_names(),
|
||||||
'server_name',
|
'server_name',
|
||||||
$server_name,
|
$server_name,
|
||||||
@ -797,19 +811,21 @@ $table->data[4][1] = html_print_select(
|
|||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
'',
|
'',
|
||||||
false,
|
false
|
||||||
'width: 150px;'
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Description.
|
// Description.
|
||||||
$table->data[5][0] = __('Description');
|
$table->data[3][0] = html_print_label_input_block(
|
||||||
$table->data[5][1] = html_print_input_text(
|
__('Description'),
|
||||||
|
html_print_input_text(
|
||||||
'description',
|
'description',
|
||||||
$description,
|
$description,
|
||||||
'',
|
'',
|
||||||
45,
|
45,
|
||||||
255,
|
255,
|
||||||
true
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
@ -827,12 +843,10 @@ $quiet_select = -1;
|
|||||||
|
|
||||||
$table = new StdClass();
|
$table = new StdClass();
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->class = 'databox filters';
|
$table->class = 'databox filters filter-table-adv';
|
||||||
|
|
||||||
$table->size[0] = '15%';
|
$table->size[0] = '50%';
|
||||||
$table->size[1] = '35%';
|
$table->size[1] = '50%';
|
||||||
$table->size[2] = '15%';
|
|
||||||
$table->size[3] = '35%';
|
|
||||||
|
|
||||||
$table->head = [];
|
$table->head = [];
|
||||||
$table->style = [];
|
$table->style = [];
|
||||||
@ -840,21 +854,24 @@ $table->style[0] = 'font-weight: bold; width: 150px;';
|
|||||||
$table->data = [];
|
$table->data = [];
|
||||||
|
|
||||||
// Custom ID.
|
// Custom ID.
|
||||||
$table->data[0][0] = __('Custom ID');
|
$table->data[0][0] = html_print_label_input_block(
|
||||||
$table->data[0][1] = html_print_input_text(
|
__('Custom ID'),
|
||||||
|
html_print_input_text(
|
||||||
'custom_id',
|
'custom_id',
|
||||||
$custom_id,
|
$custom_id,
|
||||||
'',
|
'',
|
||||||
16,
|
16,
|
||||||
255,
|
255,
|
||||||
true
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Secondary Groups.
|
// Secondary Groups.
|
||||||
if (enterprise_installed() === true) {
|
if (enterprise_installed() === true) {
|
||||||
$groups = users_get_groups($config['id_user'], 'AW', false);
|
$groups = users_get_groups($config['id_user'], 'AW', false);
|
||||||
$table->data['secondary_groups_added'][0] = __('Add secondary groups');
|
$table->data[1][0] = html_print_label_input_block(
|
||||||
$table->data['secondary_groups_added'][1] = html_print_select(
|
__('Add secondary groups'),
|
||||||
|
html_print_select(
|
||||||
$groups,
|
$groups,
|
||||||
'secondary_groups_added[]',
|
'secondary_groups_added[]',
|
||||||
0,
|
0,
|
||||||
@ -877,10 +894,12 @@ if (enterprise_installed() === true) {
|
|||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
true
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data['secondary_groups_removed'][0] = __('Remove secondary groups');
|
$table->data[1][1] = html_print_label_input_block(
|
||||||
$table->data['secondary_groups_removed'][1] = html_print_select(
|
__('Remove secondary groups'),
|
||||||
|
html_print_select(
|
||||||
$groups,
|
$groups,
|
||||||
'secondary_groups_removed[]',
|
'secondary_groups_removed[]',
|
||||||
0,
|
0,
|
||||||
@ -903,13 +922,13 @@ if (enterprise_installed() === true) {
|
|||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
true
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Learn mode / Normal mode.
|
// Learn mode / Normal mode.
|
||||||
$table->data[1][0] = __('Module definition');
|
$module_definition = __('No change').' ';
|
||||||
$table->data[1][1] = __('No change').' ';
|
$module_definition .= html_print_radio_button_extended(
|
||||||
$table->data[1][1] .= html_print_radio_button_extended(
|
|
||||||
'mode',
|
'mode',
|
||||||
-1,
|
-1,
|
||||||
'',
|
'',
|
||||||
@ -919,8 +938,8 @@ $table->data[1][1] .= html_print_radio_button_extended(
|
|||||||
'class="mrgn_right_40px"',
|
'class="mrgn_right_40px"',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[1][1] .= __('Learning mode').' ';
|
$module_definition .= __('Learning mode').' ';
|
||||||
$table->data[1][1] .= html_print_radio_button_extended(
|
$module_definition .= html_print_radio_button_extended(
|
||||||
'mode',
|
'mode',
|
||||||
1,
|
1,
|
||||||
'',
|
'',
|
||||||
@ -930,8 +949,8 @@ $table->data[1][1] .= html_print_radio_button_extended(
|
|||||||
'class="mrgn_right_40px"',
|
'class="mrgn_right_40px"',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[1][1] .= __('Normal mode').' ';
|
$module_definition .= __('Normal mode').' ';
|
||||||
$table->data[1][1] .= html_print_radio_button_extended(
|
$module_definition .= html_print_radio_button_extended(
|
||||||
'mode',
|
'mode',
|
||||||
0,
|
0,
|
||||||
'',
|
'',
|
||||||
@ -941,8 +960,8 @@ $table->data[1][1] .= html_print_radio_button_extended(
|
|||||||
'class="mrgn_right_40px"',
|
'class="mrgn_right_40px"',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[1][1] .= __('Autodisable mode').' ';
|
$module_definition .= __('Autodisable mode').' ';
|
||||||
$table->data[1][1] .= html_print_radio_button_extended(
|
$module_definition .= html_print_radio_button_extended(
|
||||||
'mode',
|
'mode',
|
||||||
2,
|
2,
|
||||||
'',
|
'',
|
||||||
@ -953,10 +972,14 @@ $table->data[1][1] .= html_print_radio_button_extended(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$table->data[2][0] = html_print_label_input_block(
|
||||||
|
__('Module definition'),
|
||||||
|
'<div class="flex-row-center">'.$module_definition.'</div>'
|
||||||
|
);
|
||||||
|
|
||||||
// Status (Disabled / Enabled).
|
// Status (Disabled / Enabled).
|
||||||
$table->data[2][0] = __('Status');
|
$status_item = __('No change').' ';
|
||||||
$table->data[2][1] = __('No change').' ';
|
$status_item .= html_print_radio_button_extended(
|
||||||
$table->data[2][1] .= html_print_radio_button_extended(
|
|
||||||
'disabled',
|
'disabled',
|
||||||
-1,
|
-1,
|
||||||
'',
|
'',
|
||||||
@ -966,12 +989,12 @@ $table->data[2][1] .= html_print_radio_button_extended(
|
|||||||
'class="mrgn_right_40px"',
|
'class="mrgn_right_40px"',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[2][1] .= __('Disabled').' ';
|
$status_item .= __('Disabled').' ';
|
||||||
$table->data[2][1] .= ui_print_help_tip(
|
$status_item .= ui_print_help_tip(
|
||||||
__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'),
|
__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'),
|
||||||
true
|
true
|
||||||
).' ';
|
).' ';
|
||||||
$table->data[2][1] .= html_print_radio_button_extended(
|
$status_item .= html_print_radio_button_extended(
|
||||||
'disabled',
|
'disabled',
|
||||||
1,
|
1,
|
||||||
'',
|
'',
|
||||||
@ -981,8 +1004,8 @@ $table->data[2][1] .= html_print_radio_button_extended(
|
|||||||
'class="mrgn_right_40px"',
|
'class="mrgn_right_40px"',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[2][1] .= __('Active').' ';
|
$status_item .= __('Active').' ';
|
||||||
$table->data[2][1] .= html_print_radio_button_extended(
|
$status_item .= html_print_radio_button_extended(
|
||||||
'disabled',
|
'disabled',
|
||||||
0,
|
0,
|
||||||
'',
|
'',
|
||||||
@ -993,15 +1016,19 @@ $table->data[2][1] .= html_print_radio_button_extended(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$table->data[2][1] = html_print_label_input_block(
|
||||||
|
__('Status'),
|
||||||
|
'<div class="flex-row-center">'.$status_item.'</div>'
|
||||||
|
);
|
||||||
|
|
||||||
// Remote configuration.
|
// Remote configuration.
|
||||||
$table->data[3][0] = __('Remote configuration');
|
|
||||||
// Delete remote configuration.
|
// Delete remote configuration.
|
||||||
$table->data[3][1] = '<div id="delete_configurations" class="invisible">';
|
$remote_config = '<div id="delete_configurations" class="invisible">';
|
||||||
$table->data[3][1] .= __('Delete available remote configurations');
|
$remote_config .= __('Delete available remote configurations');
|
||||||
$table->data[3][1] .= ' (';
|
$remote_config .= ' (';
|
||||||
$table->data[3][1] .= '<span id="n_configurations"></span>';
|
$remote_config .= '<span id="n_configurations"></span>';
|
||||||
$table->data[3][1] .= ') ';
|
$remote_config .= ') ';
|
||||||
$table->data[3][1] .= html_print_checkbox_extended(
|
$remote_config .= html_print_checkbox_extended(
|
||||||
'delete_conf',
|
'delete_conf',
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
@ -1010,11 +1037,16 @@ $table->data[3][1] .= html_print_checkbox_extended(
|
|||||||
'class="mrgn_right_40px"',
|
'class="mrgn_right_40px"',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[3][1] .= '</div>';
|
$remote_config .= '</div>';
|
||||||
|
|
||||||
$table->data[3][1] .= '<div id="not_available_configurations" class="invisible"><em>';
|
$remote_config .= '<div id="not_available_configurations" class="invisible"><em>';
|
||||||
$table->data[3][1] .= __('Not available');
|
$remote_config .= __('Not available');
|
||||||
$table->data[3][1] .= '</em></div>';
|
$remote_config .= '</em></div>';
|
||||||
|
|
||||||
|
$table->data[3][0] = html_print_label_input_block(
|
||||||
|
__('Remote configuration'),
|
||||||
|
'<div class="flex-row-center">'.$remote_config.'</div>'
|
||||||
|
);
|
||||||
|
|
||||||
$listIcons = gis_get_array_list_icons();
|
$listIcons = gis_get_array_list_icons();
|
||||||
|
|
||||||
@ -1042,8 +1074,7 @@ if ($icon_path == '') {
|
|||||||
$path_warning = $path.$icon_path.'.warning.png';
|
$path_warning = $path.$icon_path.'.warning.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[4][0] = __('Agent icon');
|
$agent_icon = html_print_select(
|
||||||
$table->data[4][1] = html_print_select(
|
|
||||||
$arraySelectIcon,
|
$arraySelectIcon,
|
||||||
'icon_path',
|
'icon_path',
|
||||||
$icon_path,
|
$icon_path,
|
||||||
@ -1052,9 +1083,9 @@ $table->data[4][1] = html_print_select(
|
|||||||
'',
|
'',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[4][1] .= ' ';
|
$agent_icon .= ' ';
|
||||||
$table->data[4][1] .= __('Without status').': ';
|
$agent_icon .= __('Without status').': ';
|
||||||
$table->data[4][1] .= html_print_image(
|
$agent_icon .= html_print_image(
|
||||||
$path_without,
|
$path_without,
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -1062,8 +1093,8 @@ $table->data[4][1] .= html_print_image(
|
|||||||
'style' => 'display:'.$display_icons.';',
|
'style' => 'display:'.$display_icons.';',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$table->data[4][1] .= ' '.__('Default').': ';
|
$agent_icon .= ' '.__('Default').': ';
|
||||||
$table->data[4][1] .= html_print_image(
|
$agent_icon .= html_print_image(
|
||||||
$path_default,
|
$path_default,
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -1071,8 +1102,8 @@ $table->data[4][1] .= html_print_image(
|
|||||||
'style' => 'display:'.$display_icons.';',
|
'style' => 'display:'.$display_icons.';',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$table->data[4][1] .= ' '.__('Ok').': ';
|
$agent_icon .= ' '.__('Ok').': ';
|
||||||
$table->data[4][1] .= html_print_image(
|
$agent_icon .= html_print_image(
|
||||||
$path_ok,
|
$path_ok,
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -1080,8 +1111,8 @@ $table->data[4][1] .= html_print_image(
|
|||||||
'style' => 'display:'.$display_icons.';',
|
'style' => 'display:'.$display_icons.';',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$table->data[4][1] .= ' '.__('Bad').': ';
|
$agent_icon .= ' '.__('Bad').': ';
|
||||||
$table->data[4][1] .= html_print_image(
|
$agent_icon .= html_print_image(
|
||||||
$path_bad,
|
$path_bad,
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -1089,8 +1120,8 @@ $table->data[4][1] .= html_print_image(
|
|||||||
'style' => 'display:'.$display_icons.';',
|
'style' => 'display:'.$display_icons.';',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$table->data[4][1] .= ' '.__('Warning').': ';
|
$agent_icon .= ' '.__('Warning').': ';
|
||||||
$table->data[4][1] .= html_print_image(
|
$agent_icon .= html_print_image(
|
||||||
$path_warning,
|
$path_warning,
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -1099,10 +1130,14 @@ $table->data[4][1] .= html_print_image(
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$table->data[3][1] = html_print_label_input_block(
|
||||||
|
__('Agent icon'),
|
||||||
|
'<div class="flex-row-center">'.$agent_icon.'</div>'
|
||||||
|
);
|
||||||
|
|
||||||
if ($config['activate_gis']) {
|
if ($config['activate_gis']) {
|
||||||
$table->data[5][0] = __('Ignore new GIS data:');
|
$ignore_gis = __('No change').' ';
|
||||||
$table->data[5][1] = __('No change').' ';
|
$ignore_gis .= html_print_radio_button_extended(
|
||||||
$table->data[5][1] .= html_print_radio_button_extended(
|
|
||||||
'update_gis_data',
|
'update_gis_data',
|
||||||
-1,
|
-1,
|
||||||
'',
|
'',
|
||||||
@ -1112,8 +1147,8 @@ if ($config['activate_gis']) {
|
|||||||
'class="mrgn_right_40px"',
|
'class="mrgn_right_40px"',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[5][1] .= __('Yes').' ';
|
$ignore_gis .= __('Yes').' ';
|
||||||
$table->data[5][1] .= html_print_radio_button_extended(
|
$ignore_gis .= html_print_radio_button_extended(
|
||||||
'update_gis_data',
|
'update_gis_data',
|
||||||
0,
|
0,
|
||||||
'',
|
'',
|
||||||
@ -1123,8 +1158,8 @@ if ($config['activate_gis']) {
|
|||||||
'class="mrgn_right_40px"',
|
'class="mrgn_right_40px"',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[5][1] .= __('No').' ';
|
$ignore_gis .= __('No').' ';
|
||||||
$table->data[5][1] .= html_print_radio_button_extended(
|
$ignore_gis .= html_print_radio_button_extended(
|
||||||
'update_gis_data',
|
'update_gis_data',
|
||||||
1,
|
1,
|
||||||
'',
|
'',
|
||||||
@ -1134,14 +1169,20 @@ if ($config['activate_gis']) {
|
|||||||
'class="mrgn_right_40px"',
|
'class="mrgn_right_40px"',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$table->data[4][0] = html_print_label_input_block(
|
||||||
|
__('Ignore new GIS data:'),
|
||||||
|
'<div class="flex-row-center">'.$ignore_gis.'</div>'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[6][0] = __('Quiet');
|
|
||||||
$table->data[6][0] .= ui_print_help_tip(
|
$table->data[5][0] = html_print_label_input_block(
|
||||||
|
__('Quiet:').ui_print_help_tip(
|
||||||
__('The agent still runs but the alerts and events will be stop'),
|
__('The agent still runs but the alerts and events will be stop'),
|
||||||
true
|
true
|
||||||
);
|
),
|
||||||
$table->data[6][1] = html_print_select(
|
html_print_select(
|
||||||
[
|
[
|
||||||
-1 => __('No change'),
|
-1 => __('No change'),
|
||||||
1 => __('Yes'),
|
1 => __('Yes'),
|
||||||
@ -1153,16 +1194,18 @@ $table->data[6][1] = html_print_select(
|
|||||||
'',
|
'',
|
||||||
0,
|
0,
|
||||||
true
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[7][0] = __('Safe operation mode').': '.ui_print_help_tip(
|
$table->data[5][1] = html_print_label_input_block(
|
||||||
|
__('Safe operation mode').': '.ui_print_help_tip(
|
||||||
__(
|
__(
|
||||||
'This mode allow %s to disable all modules of this agent while the selected module is on CRITICAL status',
|
'This mode allow %s to disable all modules of this agent while the selected module is on CRITICAL status',
|
||||||
get_product_name()
|
get_product_name()
|
||||||
),
|
),
|
||||||
true
|
true
|
||||||
);
|
),
|
||||||
$table->data[7][1] = html_print_select(
|
'<div class="flex-row-center">'.html_print_select(
|
||||||
[
|
[
|
||||||
1 => __('Enabled'),
|
1 => __('Enabled'),
|
||||||
0 => __('Disabled'),
|
0 => __('Disabled'),
|
||||||
@ -1173,10 +1216,7 @@ $table->data[7][1] = html_print_select(
|
|||||||
__('No change'),
|
__('No change'),
|
||||||
-1,
|
-1,
|
||||||
true
|
true
|
||||||
).' ';
|
).'<div class="flex-row-center mrgn_lft_20px">'.__('Module').' '.html_print_select(
|
||||||
|
|
||||||
$table->data[7][1] .= __('Module').' ';
|
|
||||||
$table->data[7][1] .= html_print_select(
|
|
||||||
'',
|
'',
|
||||||
'safe_mode_module',
|
'safe_mode_module',
|
||||||
'',
|
'',
|
||||||
@ -1184,10 +1224,12 @@ $table->data[7][1] .= html_print_select(
|
|||||||
__('Any'),
|
__('Any'),
|
||||||
-1,
|
-1,
|
||||||
true
|
true
|
||||||
|
).'</div></div>'
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[8][0] = __('Ignore unknown').ui_print_help_tip(_('This disables the calculation of the unknown state in the agent and any of its modules, so it will never transition to unknown. The state it reflects is the last known status.'), true);
|
$table->data[6][0] = html_print_label_input_block(
|
||||||
$table->data[8][1] = html_print_select(
|
__('Ignore unknown').ui_print_help_tip(_('This disables the calculation of the unknown state in the agent and any of its modules, so it will never transition to unknown. The state it reflects is the last known status.'), true),
|
||||||
|
html_print_select(
|
||||||
[
|
[
|
||||||
'' => __('No change'),
|
'' => __('No change'),
|
||||||
'1' => __('Yes'),
|
'1' => __('Yes'),
|
||||||
@ -1202,6 +1244,7 @@ $table->data[8][1] = html_print_select(
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
'w100p'
|
'w100p'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
ui_toggle(html_print_table($table, true), __('Advanced options'));
|
ui_toggle(html_print_table($table, true), __('Advanced options'));
|
||||||
@ -1209,16 +1252,13 @@ unset($table);
|
|||||||
|
|
||||||
$table = new StdClass();
|
$table = new StdClass();
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->class = 'databox filters';
|
$table->class = 'databox filters filter-table-adv';
|
||||||
|
|
||||||
$table->head = [];
|
$table->head = [];
|
||||||
$table->style = [];
|
$table->style = [];
|
||||||
$table->style[0] = 'font-weight: bold; width: 150px;';
|
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
$table->size[0] = '15%';
|
$table->size[0] = '50%';
|
||||||
$table->size[1] = '35%';
|
$table->size[1] = '50%';
|
||||||
$table->size[2] = '15%';
|
|
||||||
$table->size[3] = '35%';
|
|
||||||
|
|
||||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||||
|
|
||||||
@ -1226,6 +1266,8 @@ if ($fields === false) {
|
|||||||
$fields = [];
|
$fields = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$row = 0;
|
||||||
|
$col = 0;
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$data[0] = '<b>'.$field['name'].'</b>';
|
$data[0] = '<b>'.$field['name'].'</b>';
|
||||||
$combo = [];
|
$combo = [];
|
||||||
@ -1270,7 +1312,7 @@ foreach ($fields as $field) {
|
|||||||
2,
|
2,
|
||||||
65,
|
65,
|
||||||
$custom_value,
|
$custom_value,
|
||||||
'class="mrgn_right_30px"',
|
'class=""',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1290,7 +1332,20 @@ foreach ($fields as $field) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
array_push($table->data, $data);
|
$output = html_print_label_input_block(
|
||||||
|
$data[0],
|
||||||
|
$data[1]
|
||||||
|
);
|
||||||
|
|
||||||
|
// array_push($table->data, $output);
|
||||||
|
$table->data[$row][$col] = $output;
|
||||||
|
|
||||||
|
if ($col === 1) {
|
||||||
|
$col = 0;
|
||||||
|
$row++;
|
||||||
|
} else {
|
||||||
|
$col++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($fields) === false) {
|
if (empty($fields) === false) {
|
||||||
|
@ -1010,6 +1010,10 @@ function html_print_select(
|
|||||||
ui_require_javascript_file('select2.min');
|
ui_require_javascript_file('select2.min');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($placeholder === '' && $select2_multiple_enable === true) {
|
||||||
|
$placeholder = __('Select one or more elements');
|
||||||
|
}
|
||||||
|
|
||||||
$output .= '<script type="text/javascript">';
|
$output .= '<script type="text/javascript">';
|
||||||
$output .= '$("#'.$id.'").select2({
|
$output .= '$("#'.$id.'").select2({
|
||||||
closeOnSelect: '.(($select2_multiple_enable === true) ? 'false' : 'true').',
|
closeOnSelect: '.(($select2_multiple_enable === true) ? 'false' : 'true').',
|
||||||
|
@ -108,21 +108,20 @@ function get_table_inputs_masive_agents($params)
|
|||||||
|
|
||||||
$table = new stdClass;
|
$table = new stdClass;
|
||||||
$table->id = 'delete_table';
|
$table->id = 'delete_table';
|
||||||
$table->class = 'databox filters';
|
$table->class = 'databox filters filter-table-adv';
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
$table->style = [];
|
$table->style = [];
|
||||||
$table->style[0] = 'font-weight: bold;';
|
$table->style[0] = 'font-weight: bold;';
|
||||||
$table->style[2] = 'font-weight: bold';
|
$table->style[2] = 'font-weight: bold';
|
||||||
$table->size = [];
|
$table->size = [];
|
||||||
$table->size[0] = '15%';
|
$table->size[0] = '50%';
|
||||||
$table->size[1] = '35%';
|
$table->size[1] = '50%';
|
||||||
$table->size[2] = '15%';
|
|
||||||
$table->size[3] = '35%';
|
|
||||||
|
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
$table->data[0][0] = __('Group');
|
$table->data[0][0] = html_print_label_input_block(
|
||||||
$table->data[0][1] = html_print_select_groups(
|
__('Group'),
|
||||||
|
html_print_select_groups(
|
||||||
false,
|
false,
|
||||||
'AW',
|
'AW',
|
||||||
true,
|
true,
|
||||||
@ -131,15 +130,24 @@ function get_table_inputs_masive_agents($params)
|
|||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
true
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'width:100%; max-width: 420px;'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
$table->data[0][2] = __('Group recursion');
|
|
||||||
$table->data[0][3] = html_print_checkbox(
|
$table->data[0][1] = html_print_label_input_block(
|
||||||
|
__('Group recursion'),
|
||||||
|
html_print_checkbox(
|
||||||
'recursion',
|
'recursion',
|
||||||
1,
|
1,
|
||||||
$params['recursion'],
|
$params['recursion'],
|
||||||
true,
|
true,
|
||||||
false
|
false
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$status_list = [];
|
$status_list = [];
|
||||||
@ -149,19 +157,27 @@ function get_table_inputs_masive_agents($params)
|
|||||||
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
||||||
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
||||||
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
||||||
$table->data[1][0] = __('Status');
|
$table->data[1][0] = html_print_label_input_block(
|
||||||
$table->data[1][1] = html_print_select(
|
__('Status'),
|
||||||
|
html_print_select(
|
||||||
$status_list,
|
$status_list,
|
||||||
'status_agents',
|
'status_agents',
|
||||||
'selected',
|
'selected',
|
||||||
'',
|
'',
|
||||||
__('All'),
|
__('All'),
|
||||||
AGENT_STATUS_ALL,
|
AGENT_STATUS_ALL,
|
||||||
true
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'width:100%; max-width: 420px;'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[1][2] = __('Show agents');
|
$table->data[1][1] = html_print_label_input_block(
|
||||||
$table->data[1][3] = html_print_select(
|
__('Show agents'),
|
||||||
|
html_print_select(
|
||||||
[
|
[
|
||||||
0 => 'Only enabled',
|
0 => 'Only enabled',
|
||||||
1 => 'Only disabled',
|
1 => 'Only disabled',
|
||||||
@ -176,7 +192,8 @@ function get_table_inputs_masive_agents($params)
|
|||||||
true,
|
true,
|
||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
'width:30%;'
|
'width:100%; max-width: 420px;'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
@ -186,8 +203,9 @@ function get_table_inputs_masive_agents($params)
|
|||||||
$server_fields[$key] = $server['server_name'];
|
$server_fields[$key] = $server['server_name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[2][2] = __('Node');
|
$table->data[2][0] = html_print_label_input_block(
|
||||||
$table->data[2][3] = html_print_select(
|
__('Node'),
|
||||||
|
html_print_select(
|
||||||
$server_fields,
|
$server_fields,
|
||||||
'nodes[]',
|
'nodes[]',
|
||||||
0,
|
0,
|
||||||
@ -199,7 +217,7 @@ function get_table_inputs_masive_agents($params)
|
|||||||
true,
|
true,
|
||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
'min-width: 500px; max-width: 500px; max-height: 100px',
|
'width:100%; max-width: 420px; max-height: 100px',
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -211,36 +229,50 @@ function get_table_inputs_masive_agents($params)
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
true
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$os_list = os_get_os(true);
|
$os_list = os_get_os(true);
|
||||||
|
|
||||||
$table->data[3][0] = __('OS');
|
$table->data[3][0] = html_print_label_input_block(
|
||||||
$table->data[3][1] = html_print_select(
|
__('OS'),
|
||||||
|
html_print_select(
|
||||||
$os_list,
|
$os_list,
|
||||||
'os_agent',
|
'os_agent',
|
||||||
'selected',
|
'selected',
|
||||||
'',
|
'',
|
||||||
__('All'),
|
__('All'),
|
||||||
'',
|
'',
|
||||||
true
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'width:100%; max-width: 420px;'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[3][2] = __('OS Version');
|
$table->data[3][1] = html_print_label_input_block(
|
||||||
$table->data[3][3] = html_print_input_text(
|
__('OS Version'),
|
||||||
|
html_print_input_text(
|
||||||
'os_agent_version',
|
'os_agent_version',
|
||||||
'',
|
'',
|
||||||
__('Select OS version'),
|
__('Select OS version'),
|
||||||
35,
|
35,
|
||||||
255,
|
255,
|
||||||
true
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'w100p'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[4][0] = __('Agents');
|
$label_agents = __('Agents');
|
||||||
$table->data[4][0] .= '<span id="agent_loading" class="invisible">';
|
$label_agents .= '<span id="agent_loading" class="invisible">';
|
||||||
$table->data[4][0] .= html_print_image('images/spinner.png', true);
|
$label_agents .= html_print_image('images/spinner.png', true);
|
||||||
$table->data[4][0] .= '</span>';
|
$label_agents .= '</span>';
|
||||||
|
|
||||||
$agents = [];
|
$agents = [];
|
||||||
if (is_metaconsole() === false) {
|
if (is_metaconsole() === false) {
|
||||||
@ -251,7 +283,9 @@ function get_table_inputs_masive_agents($params)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[4][1] = html_print_select(
|
$table->data[4][0] = html_print_label_input_block(
|
||||||
|
$label_agents,
|
||||||
|
html_print_select(
|
||||||
$agents,
|
$agents,
|
||||||
'id_agents[]',
|
'id_agents[]',
|
||||||
0,
|
0,
|
||||||
@ -263,7 +297,7 @@ function get_table_inputs_masive_agents($params)
|
|||||||
true,
|
true,
|
||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
'min-width: 500px; max-width: 500px; max-height: 100px',
|
'width: 100%; max-height: 100px',
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -275,6 +309,7 @@ function get_table_inputs_masive_agents($params)
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
true
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$output = html_print_table($table, true);
|
$output = html_print_table($table, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user