#11687 change ui bulk operations modules
This commit is contained in:
parent
c28c5c35b4
commit
4ace3b205a
|
@ -86,31 +86,39 @@ if ($do_operation) {
|
|||
$groups = users_get_groups();
|
||||
|
||||
$table = new stdClass();
|
||||
$table->class = 'databox filters';
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold;';
|
||||
$table->style[2] = 'font-weight: bold';
|
||||
$table->style[4] = 'font-weight: bold';
|
||||
$table->style[6] = 'font-weight: bold';
|
||||
|
||||
// Source selection
|
||||
$table->id = 'source_table';
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'source_id_group',
|
||||
$source_id_group,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->data = [];
|
||||
|
||||
// Source selection.
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'source_id_group',
|
||||
$source_id_group,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
$table->data[0][2] = __('Group recursion');
|
||||
$table->data[0][3] = html_print_checkbox('source_recursion', 1, $source_recursion, true, false);
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Group recursion'),
|
||||
html_print_checkbox('source_recursion', 1, $source_recursion, true, false)
|
||||
);
|
||||
|
||||
$status_list = [];
|
||||
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
|
||||
$status_list[AGENT_STATUS_WARNING] = __('Warning');
|
||||
|
@ -118,37 +126,52 @@ $status_list[AGENT_STATUS_CRITICAL] = __('Critical');
|
|||
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
||||
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
||||
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
||||
$table->data[0][4] = __('Status');
|
||||
$table->data[0][5] = html_print_select(
|
||||
$status_list,
|
||||
'status_agents_source',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true
|
||||
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$status_list,
|
||||
'status_agents_source',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p'
|
||||
)
|
||||
);
|
||||
$table->data[0][6] = __('Agent');
|
||||
$table->data[0][6] .= ' <span id="source_agent_loading" class="invisible">';
|
||||
$table->data[0][6] .= html_print_image('images/spinner.png', true);
|
||||
$table->data[0][6] .= '</span>';
|
||||
// $table->data[0][7] = html_print_select (agents_get_group_agents ($source_id_group, false, "none"),
|
||||
// 'source_id_agent', $source_id_agent, false, __('Select'), 0, true);
|
||||
|
||||
$agents = ( $source_id_group ? agents_get_group_agents($source_id_group, false, 'none') : agents_get_group_agents(array_keys(users_get_groups($config['id_user'], 'AW', false))) );
|
||||
$table->data[0][7] = html_print_select($agents, 'source_id_agent', $source_id_agent, false, __('Select'), 0, true);
|
||||
|
||||
echo '<form '.'action="index.php?'.'sec=gmassive&'.'sec2=godmode/massive/massive_operations&'.'option=copy_modules" '.'id="manage_config_form" '.'method="post">';
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Agent').' <span id="source_agent_loading" class="invisible">'.html_print_image('images/spinner.png', true).'</span>',
|
||||
html_print_select(
|
||||
$agents,
|
||||
'source_id_agent',
|
||||
$source_id_agent,
|
||||
false,
|
||||
__('Select'),
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '<form action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=copy_modules" id="manage_config_form" method="post" class="max_floating_element_size">';
|
||||
echo '<fieldset id="fieldset_source">';
|
||||
echo '<legend>';
|
||||
echo '<span>'.__('Source');
|
||||
echo '</legend>';
|
||||
echo '<legend><span>'.__('Source').'</span></legend>';
|
||||
html_print_table($table);
|
||||
echo '</fieldset>';
|
||||
|
||||
// Target selection
|
||||
|
||||
unset($table);
|
||||
// Target selection.
|
||||
$table = new stdClass();
|
||||
$table->id = 'target_table';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->data = [];
|
||||
|
||||
$modules = [];
|
||||
|
@ -169,66 +192,61 @@ foreach ($agent_alerts as $alert) {
|
|||
}
|
||||
|
||||
$tags = tags_get_user_tags();
|
||||
$table->data['tags'][0] = __('Tags');
|
||||
$table->data['tags'][1] = html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
$table->colspan[0][0] = 2;
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Tags'),
|
||||
html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data['operations'][0] = __('Operations');
|
||||
$table->data['operations'][1] = '<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">';
|
||||
$table->data['operations'][1] .= html_print_checkbox('copy_modules', 1, true, true);
|
||||
$table->data['operations'][1] .= html_print_label(__('Copy modules'), 'checkbox-copy_modules', true);
|
||||
$table->data['operations'][1] .= '</span><br />';
|
||||
|
||||
$table->data['operations'][1] .= '<span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">';
|
||||
$table->data['operations'][1] .= html_print_checkbox('copy_alerts', 1, true, true);
|
||||
$table->data['operations'][1] .= html_print_label(__('Copy alerts'), 'checkbox-copy_alerts', true);
|
||||
$table->data['operations'][1] .= '</span>';
|
||||
|
||||
$table->data['form_modules_filter'][0] = __('Filter Modules');
|
||||
$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
|
||||
|
||||
$table->data[1][0] = __('Modules');
|
||||
$table->data[1][1] = '<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">';
|
||||
$table->data[1][1] .= html_print_select(
|
||||
$modules,
|
||||
'target_modules[]',
|
||||
0,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Operations'),
|
||||
'<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">'.html_print_checkbox('copy_modules', 1, true, true).html_print_label(__('Copy modules'), 'checkbox-copy_modules', true).'</span><span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">'.html_print_checkbox('copy_alerts', 1, true, true).html_print_label(__('Copy alerts'), 'checkbox-copy_alerts', true).'</span>'
|
||||
);
|
||||
$table->data[1][1] .= '</span>';
|
||||
$table->data[1][1] .= '<span class="without_modules'.(! empty($modules) ? ' invisible' : '').'">';
|
||||
$table->data[1][1] .= '<em>'.__('No modules for this agent').'</em>';
|
||||
$table->data[1][1] .= '</span>';
|
||||
|
||||
$table->data[2][0] = __('Alerts');
|
||||
$table->data[2][1] = '<span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">';
|
||||
$table->data[2][1] .= html_print_select(
|
||||
$alerts,
|
||||
'target_alerts[]',
|
||||
0,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Filter Modules'),
|
||||
html_print_input_text('filter_modules', '', '', 20, 255, true)
|
||||
);
|
||||
|
||||
$table->colspan[2][0] = 2;
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Modules'),
|
||||
'<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">'.html_print_select(
|
||||
$modules,
|
||||
'target_modules[]',
|
||||
0,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true
|
||||
).'</span><span class="without_modules'.(! empty($modules) ? ' invisible' : '').'"><em>'.__('No modules for this agent').'</em></span>'
|
||||
);
|
||||
|
||||
$table->colspan[3][0] = 2;
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Alerts'),
|
||||
'<span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">'.html_print_select(
|
||||
$alerts,
|
||||
'target_alerts[]',
|
||||
0,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true
|
||||
).'</span><span class="without_alerts'.(! empty($modules) ? ' invisible' : '').'"><em>'.__('No alerts for this agent').'</em></span>'
|
||||
);
|
||||
$table->data[2][1] .= '</span>';
|
||||
$table->data[2][1] .= '<span class="without_alerts'.(! empty($modules) ? ' invisible' : '').'">';
|
||||
$table->data[2][1] .= '<em>'.__('No alerts for this agent').'</em>';
|
||||
$table->data[2][1] .= '</span>';
|
||||
|
||||
echo '<div id="modules_loading" class="loading invisible">';
|
||||
html_print_image('images/spinner.png');
|
||||
|
@ -240,35 +258,50 @@ echo '<legend><span>'.__('Targets').'</span></legend>';
|
|||
html_print_table($table);
|
||||
echo '</fieldset>';
|
||||
|
||||
|
||||
// Destiny selection
|
||||
unset($table);
|
||||
// Destiny selection.
|
||||
$table = new stdClass();
|
||||
$table->id = 'destiny_table';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->data = [];
|
||||
$table->size[0] = '20%';
|
||||
$table->size[1] = '30%';
|
||||
$table->size[2] = '20%';
|
||||
$table->size[3] = '30%';
|
||||
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'destiny_id_group',
|
||||
$destiny_id_group,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'destiny_id_group',
|
||||
$destiny_id_group,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
$table->data[0][2] = __('Group recursion');
|
||||
$table->data[0][3] = html_print_checkbox(
|
||||
'destiny_recursion',
|
||||
1,
|
||||
$destiny_recursion,
|
||||
true,
|
||||
false
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Group recursion'),
|
||||
html_print_checkbox(
|
||||
'destiny_recursion',
|
||||
1,
|
||||
$destiny_recursion,
|
||||
true,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Filter Agents'),
|
||||
html_print_input_text('filter_agents', '', '', 20, 255, true)
|
||||
);
|
||||
|
||||
$status_list = [];
|
||||
|
@ -278,32 +311,30 @@ $status_list[AGENT_STATUS_CRITICAL] = __('Critical');
|
|||
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
||||
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
||||
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
||||
$table->data[1][0] = __('Status');
|
||||
$table->data[1][1] = html_print_select(
|
||||
$status_list,
|
||||
'status_agents_destiny',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$status_list,
|
||||
'status_agents_destiny',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data['form_agents_filter'][0] = __('Filter Agents');
|
||||
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
|
||||
|
||||
$table->data[2][0] = __('Agent');
|
||||
$table->data[2][0] .= '<span id="destiny_agent_loading" class="invisible">';
|
||||
$table->data[2][0] .= html_print_image('images/spinner.png', true);
|
||||
$table->data[2][0] .= '</span>';
|
||||
|
||||
$agents = [];
|
||||
if ($source_id_agent) {
|
||||
$agents = ( $destiny_id_group ? agents_get_group_agents($destiny_id_group, false, 'none') : agents_get_group_agents(array_keys(users_get_groups($config['id_user'], 'AW', false))) );
|
||||
unset($agents[$source_id_agent]);
|
||||
}
|
||||
|
||||
$table->data[2][1] = html_print_select($agents, 'destiny_id_agent[]', 0, false, '', '', true, true);
|
||||
$table->colspan[2][0] = 2;
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Agent').'<span id="destiny_agent_loading" class="invisible">'.html_print_image('images/spinner.png', true).'</span>',
|
||||
html_print_select($agents, 'destiny_id_agent[]', 0, false, '', '', true, true)
|
||||
);
|
||||
|
||||
echo '<fieldset id="fieldset_destiny"'.($source_id_agent ? '' : ' class="invisible"').'>';
|
||||
echo '<legend><span>'.__('To agent(s)').'</span></legend>';
|
||||
|
|
|
@ -310,45 +310,47 @@ foreach ($module_types as $type) {
|
|||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->data = [];
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->style[2] = 'font-weight: bold';
|
||||
|
||||
$table->data['selection_mode'][0] = __('Selection mode');
|
||||
$table->data['selection_mode'][1] = '<span class="massive_span">'.__('Select modules first ').'</span>'.html_print_radio_button_extended('selection_mode', 'modules', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true).'<br>';
|
||||
$table->data['selection_mode'][1] .= '<span class="massive_span">'.__('Select agents first ').'</span>'.html_print_radio_button_extended('selection_mode', 'agents', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true);
|
||||
|
||||
$table->rowclass['form_modules_1'] = 'select_modules_row';
|
||||
$table->data['form_modules_1'][0] = __('Module type');
|
||||
$table->data['form_modules_1'][0] .= '<span id="module_loading" class="invisible">';
|
||||
$table->data['form_modules_1'][0] .= html_print_image('images/spinner.png', true);
|
||||
$table->data['form_modules_1'][0] .= '</span>';
|
||||
$types[0] = __('All');
|
||||
$table->colspan['form_modules_1'][1] = 2;
|
||||
$table->data['form_modules_1'][1] = html_print_select(
|
||||
$types,
|
||||
'module_type',
|
||||
'',
|
||||
false,
|
||||
__('Select'),
|
||||
-1,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Selection mode'),
|
||||
'<div class="flex"><span class="massive_span">'.__('Select modules first ').'</span>'.html_print_radio_button_extended('selection_mode', 'modules', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true).'<br><span class="massive_span">'.__('Select agents first ').'</span>'.html_print_radio_button_extended('selection_mode', 'agents', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true).'</div>'
|
||||
);
|
||||
$table->data['form_modules_1'][3] = __('Select all modules of this type').' '.html_print_checkbox_extended(
|
||||
'force_type',
|
||||
'type',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'class="mrgn_right_40px"',
|
||||
true,
|
||||
''
|
||||
|
||||
$table->rowclass[1] = 'select_modules_row';
|
||||
$types[0] = __('All');
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Module type').'<span id="module_loading" class="invisible">'.html_print_image('images/spinner.png', true).'</span>',
|
||||
html_print_select(
|
||||
$types,
|
||||
'module_type',
|
||||
'',
|
||||
false,
|
||||
__('Select'),
|
||||
-1,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Select all modules of this type'),
|
||||
html_print_checkbox_extended(
|
||||
'force_type',
|
||||
'type',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'class="mrgn_right_40px"',
|
||||
true,
|
||||
''
|
||||
)
|
||||
);
|
||||
|
||||
$modules = [];
|
||||
|
@ -368,52 +370,56 @@ foreach ($names as $name) {
|
|||
$modules[$name['nombre']] = $name['nombre'];
|
||||
}
|
||||
|
||||
$table->rowclass['form_agents_1'] = 'select_agents_row';
|
||||
$table->data['form_agents_1'][0] = __('Agent group');
|
||||
$table->rowclass[2] = 'select_agents_row';
|
||||
$groups = users_get_groups($config['id_user'], 'AW', false);
|
||||
$groups[0] = __('All');
|
||||
$table->colspan['form_agents_1'][1] = 2;
|
||||
$table->data['form_agents_1'][1] = html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'groups_select',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
).' '.__('Group recursion').' '.html_print_checkbox('recursion', 1, false, true, false);
|
||||
$table->data['form_agents_1'][3] = __('Select all modules of this group').' '.html_print_checkbox_extended(
|
||||
'force_group',
|
||||
'group',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'class="mrgn_right_40px"',
|
||||
true
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Agent group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'groups_select',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
).' '.__('Group recursion').' '.html_print_checkbox('recursion', 1, false, true, false)
|
||||
);
|
||||
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Select all modules of this group'),
|
||||
html_print_checkbox_extended(
|
||||
'force_group',
|
||||
'group',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'class="mrgn_right_40px"',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$tags = tags_get_user_tags();
|
||||
$table->rowstyle['form_modules_4'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_modules_4'] = 'select_modules_row select_modules_row_2';
|
||||
$table->data['form_modules_4'][0] = __('Tags');
|
||||
$table->data['form_modules_4'][1] = html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
$table->rowclass[3] = 'select_modules_row select_modules_row_2';
|
||||
$table->colspan[3][0] = 2;
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Tags'),
|
||||
html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->rowclass['form_agents_2'] = 'select_agents_row';
|
||||
$table->data['form_agents_2'][0] = __('Status');
|
||||
$table->colspan['form_agents_2'][1] = 2;
|
||||
$status_list = [];
|
||||
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
|
||||
$status_list[AGENT_STATUS_WARNING] = __('Warning');
|
||||
|
@ -421,166 +427,175 @@ $status_list[AGENT_STATUS_CRITICAL] = __('Critical');
|
|||
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
||||
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
||||
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
||||
$table->data['form_agents_2'][1] = html_print_select(
|
||||
$status_list,
|
||||
'status_agents',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true
|
||||
$table->data[4][0] = html_print_label_input_block(
|
||||
__('Module Status'),
|
||||
html_print_select(
|
||||
$status_list,
|
||||
'status_module',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_MODULE_STATUS_ALL,
|
||||
true
|
||||
)
|
||||
);
|
||||
$table->data['form_agents_2'][3] = '';
|
||||
|
||||
$table->rowclass['form_modules_3'] = '';
|
||||
$table->data['form_modules_3'][0] = __('Module Status');
|
||||
$table->colspan['form_modules_3'][1] = 2;
|
||||
$status_list = [];
|
||||
$status_list[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
|
||||
$status_list[AGENT_MODULE_STATUS_WARNING] = __('Warning');
|
||||
$status_list[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
|
||||
$status_list[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
|
||||
$status_list[AGENT_MODULE_STATUS_NOT_NORMAL] = __('Not normal');
|
||||
$status_list[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
|
||||
$table->data['form_modules_3'][1] = html_print_select(
|
||||
$status_list,
|
||||
'status_module',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_MODULE_STATUS_ALL,
|
||||
true
|
||||
$table->cellclass[4][1] = 'select_agents_row';
|
||||
$table->data[4][1] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$status_list,
|
||||
'status_agents',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true
|
||||
)
|
||||
);
|
||||
$table->data['form_modules_3'][3] = '';
|
||||
|
||||
$table->rowstyle['form_modules_filter'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_modules_filter'] = 'select_modules_row select_modules_row_2';
|
||||
$table->data['form_modules_filter'][0] = __('Filter Modules');
|
||||
$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
|
||||
|
||||
$table->rowstyle['form_modules_2'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_modules_2'] = 'select_modules_row select_modules_row_2';
|
||||
$table->data['form_modules_2'][0] = __('Modules');
|
||||
$table->data['form_modules_2'][1] = html_print_select(
|
||||
$modules,
|
||||
'module_name[]',
|
||||
$module_name,
|
||||
false,
|
||||
__('Select'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
).' '.__('Select all modules').' '.html_print_checkbox('select_all_modules', 1, false, true, false, '', false, "class='static'");
|
||||
|
||||
$table->data['form_modules_2'][2] = __('When select modules');
|
||||
$table->data['form_modules_2'][2] .= '<br>';
|
||||
$table->data['form_modules_2'][2] .= html_print_select(
|
||||
[
|
||||
'common' => __('Show common agents'),
|
||||
'all' => __('Show all agents'),
|
||||
],
|
||||
'agents_selection_mode',
|
||||
'common',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
$table->rowclass[5] = 'select_modules_row select_modules_row_2';
|
||||
$table->data[5][0] = html_print_label_input_block(
|
||||
__('Filter Modules'),
|
||||
html_print_input_text('filter_modules', '', '', 20, 255, true)
|
||||
);
|
||||
$table->data['form_modules_2'][3] = html_print_select(
|
||||
[],
|
||||
'agents[]',
|
||||
$agents_select,
|
||||
false,
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
|
||||
$table->data[5][1] = html_print_label_input_block(
|
||||
__('When select modules'),
|
||||
html_print_select(
|
||||
[
|
||||
'common' => __('Show common agents'),
|
||||
'all' => __('Show all agents'),
|
||||
],
|
||||
'agents_selection_mode',
|
||||
'common',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
$table->rowclass[6] = 'select_modules_row select_modules_row_2';
|
||||
$table->data[6][0] = html_print_label_input_block(
|
||||
__('Modules'),
|
||||
html_print_select(
|
||||
$modules,
|
||||
'module_name[]',
|
||||
$module_name,
|
||||
false,
|
||||
__('Select'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
).' '.__('Select all modules').' '.html_print_checkbox('select_all_modules', 1, false, true, false, '', false, "class='static'")
|
||||
);
|
||||
|
||||
$table->data[6][1] = html_print_label_input_block(
|
||||
__('Agents'),
|
||||
html_print_select(
|
||||
[],
|
||||
'agents[]',
|
||||
$agents_select,
|
||||
false,
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
|
||||
$tags = tags_get_user_tags();
|
||||
$table->rowstyle['form_agents_4'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_agents_4'] = 'select_agents_row select_agents_row_2';
|
||||
$table->data['form_agents_4'][0] = __('Tags');
|
||||
$table->data['form_agents_4'][1] = html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
$table->colspan[7] = 2;
|
||||
$table->rowclass[7] = 'select_agents_row select_agents_row_2';
|
||||
$table->data[7][0] = html_print_label_input_block(
|
||||
__('Tags'),
|
||||
html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->rowstyle['form_agents_filter'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_agents_filter'] = 'select_agents_row select_agents_row_2';
|
||||
$table->data['form_agents_filter'][0] = __('Filter Agents');
|
||||
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
|
||||
|
||||
$table->rowstyle['form_agents_3'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_agents_3'] = 'select_agents_row select_agents_row_2';
|
||||
$table->data['form_agents_3'][0] = __('Agents');
|
||||
$table->data['form_agents_3'][1] = html_print_select(
|
||||
$agents,
|
||||
'id_agents[]',
|
||||
$agents_id,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
).' '.__('Select all agents').' '.html_print_checkbox('select_all_agents', 1, false, true, false, '', false, "class='static'");
|
||||
|
||||
$table->data['form_agents_3'][2] = __('When select agents');
|
||||
$table->data['form_agents_3'][2] .= '<br>';
|
||||
$table->data['form_agents_3'][2] .= html_print_select(
|
||||
[
|
||||
'common' => __('Show common modules'),
|
||||
'all' => __('Show all modules'),
|
||||
'unknown' => __('Show unknown and not init modules'),
|
||||
],
|
||||
'modules_selection_mode',
|
||||
'common',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data['form_agents_3'][3] = html_print_select(
|
||||
[],
|
||||
'module[]',
|
||||
$modules_select,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
$table->rowclass[8] = 'select_agents_row select_agents_row_2';
|
||||
$table->data[8][0] = html_print_label_input_block(
|
||||
__('Filter Agents'),
|
||||
html_print_input_text('filter_agents', '', '', 20, 255, true)
|
||||
);
|
||||
|
||||
$table->data[8][1] = html_print_label_input_block(
|
||||
__('When select agents'),
|
||||
html_print_select(
|
||||
[
|
||||
'common' => __('Show common modules'),
|
||||
'all' => __('Show all modules'),
|
||||
'unknown' => __('Show unknown and not init modules'),
|
||||
],
|
||||
'modules_selection_mode',
|
||||
'common',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->rowclass[9] = 'select_agents_row select_agents_row_2';
|
||||
$table->data[9][0] = html_print_label_input_block(
|
||||
__('Agents'),
|
||||
html_print_select(
|
||||
$agents,
|
||||
'id_agents[]',
|
||||
$agents_id,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
).' '.__('Select all agents').' '.html_print_checkbox('select_all_agents', 1, false, true, false, '', false, "class='static'")
|
||||
);
|
||||
|
||||
echo '<form method="post" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >';
|
||||
$table->data[9][1] = html_print_label_input_block(
|
||||
__('Modules'),
|
||||
html_print_select(
|
||||
[],
|
||||
'module[]',
|
||||
$modules_select,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
|
||||
echo '<form method="post" class="max_floating_element_size" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >';
|
||||
html_print_table($table);
|
||||
|
||||
attachActionButton('delete', 'delete', $table->width, false, $SelectAction);
|
||||
|
|
Loading…
Reference in New Issue