Merge branch 'ent-10953-actualizar-estilos-del-editor-de-componentes-locales-editor-de-componentes-remotos-y-editor' into 'develop'

Ent 10953 actualizar estilos del editor de componentes locales editor de componentes remotos y editor

See merge request 
This commit is contained in:
Rafael Ameijeiras 2023-06-26 07:32:28 +00:00
commit 359ea37a29
9 changed files with 1292 additions and 888 deletions

View File

@ -351,10 +351,12 @@ if ($id_component_type == COMPONENT_TYPE_WMI) {
return; return;
} }
echo '<form name="component" method="post">'; echo '<form name="component" method="post" class="max_floating_element_size">';
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters filter-table-adv';
$table->style[0] = 'width: 50%; max-width: 50%; font-weight: bold;';
$table->style[2] = 'width: 50%; max-width: 50%; font-weight: bold;';
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
if ($id) { if ($id) {

View File

@ -28,10 +28,10 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'],
$table = new stdClass(); $table = new stdClass();
$table->id = 'network_component'; $table->id = 'network_component';
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox'; $table->class = 'databox filters filter-table-adv';
$table->style = []; $table->style = [];
$table->style[0] = 'font-weight: bold'; $table->style[0] = 'width: 50%';
$table->style[2] = 'font-weight: bold'; $table->style[2] = 'width: 50%';
$table->colspan = []; $table->colspan = [];
if (!enterprise_installed()) { if (!enterprise_installed()) {
$table->colspan[0][1] = 3; $table->colspan[0][1] = 3;
@ -43,8 +43,10 @@ $table_simple->colspan[8][1] = 4;
$table_simple->colspan[9][1] = 4; $table_simple->colspan[9][1] = 4;
$table->data = []; $table->data = [];
$table->data[0][0] = __('Name'); $table->data[0][0] = html_print_label_input_block(
$table->data[0][1] = html_print_input_text('name', $name, '', 55, 255, true); __('Name'),
html_print_input_text('name', $name, '', 55, 255, true)
);
if (enterprise_installed()) { if (enterprise_installed()) {
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
$table->data[0][2] = __('Wizard level'); $table->data[0][2] = __('Wizard level');
@ -53,15 +55,19 @@ if (enterprise_installed()) {
'advanced' => __('Advanced'), 'advanced' => __('Advanced'),
]; ];
// TODO review help tips on meta. // TODO review help tips on meta.
$table->data[0][3] = html_print_select($wizard_levels, 'wizard_level', $wizard_level, '', '', -1, true, false, false).' '; $table->data[0][1] = html_print_label_input_block(
__('Wizard level'),
html_print_select($wizard_levels, 'wizard_level', $wizard_level, '', '', -1, true, false, false).' '
);
// .ui_print_help_icon('meta_access', true) // .ui_print_help_icon('meta_access', true)
} else { } else {
$table->data[0][2] = ''; $table->data[0][1] = html_print_label_input_block(
$table->data[0][3] = html_print_input_hidden('wizard_level', $wizard_level, true); '',
html_print_input_hidden('wizard_level', $wizard_level, true)
);
} }
} }
$table->data[1][0] = __('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help');
$sql = sprintf( $sql = sprintf(
'SELECT id_tipo, descripcion 'SELECT id_tipo, descripcion
FROM ttipo_modulo FROM ttipo_modulo
@ -69,22 +75,25 @@ $sql = sprintf(
ORDER BY id_tipo ASC', ORDER BY id_tipo ASC',
implode(',', $categories) implode(',', $categories)
); );
$table->data[1][1] = html_print_select_from_sql( $table->data[1][0] = html_print_label_input_block(
$sql, __('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help'),
'type', html_print_select_from_sql(
$type, $sql,
'javascript: type_change();', 'type',
'', $type,
'', 'javascript: type_change();',
true, '',
false, '',
false, true,
false, false,
true, false,
false, false,
false, true,
false, false,
0 false,
false,
0
)
); );
// Store the relation between id and name of the types on a hidden field // Store the relation between id and name of the types on a hidden field
@ -102,50 +111,53 @@ foreach ($type_names as $tn) {
$type_names_hash[$tn['id_tipo']] = $tn['nombre']; $type_names_hash[$tn['id_tipo']] = $tn['nombre'];
} }
$table->data[1][1] .= html_print_input_hidden( $table->data[1][1] = html_print_label_input_block(
'type_names', __('Module group'),
base64_encode(json_encode($type_names_hash)), html_print_input_hidden(
true 'type_names',
base64_encode(json_encode($type_names_hash)),
true
).html_print_select_from_sql(
'SELECT id_mg, name
FROM tmodule_group ORDER BY name',
'id_module_group',
$id_module_group,
'',
'',
'',
true,
false,
false,
false,
true,
false,
false,
false,
0
)
); );
$table->data[1][2] = __('Module group'); $table->data[2][0] = html_print_label_input_block(
$table->data[1][3] = html_print_select_from_sql( __('Group'),
'SELECT id_mg, name html_print_select(
FROM tmodule_group ORDER BY name', network_components_get_groups(),
'id_module_group', 'id_group',
$id_module_group, $id_group,
'', '',
'', '',
'', '',
true, true,
false, false,
false, false
false, )
true,
false,
false,
false,
0
); );
$table->data[2][0] = __('Group'); $table->data[2][1] = html_print_label_input_block(
$table->data[2][1] = html_print_select( __('Interval'),
network_components_get_groups(), html_print_extended_select_for_time('module_interval', $module_interval, '', '', '0', false, true)
'id_group',
$id_group,
'',
'',
'',
true,
false,
false
); );
$table->data[2][2] = __('Interval');
$table->data[2][3] = html_print_extended_select_for_time('module_interval', $module_interval, '', '', '0', false, true);
$table->data[3][0] = __('Dynamic Interval'); $dynamic_interval_img = '<a onclick="advanced_option_dynamic()" class="mrgn_lft_5px mrgn_top_6px">'.html_print_image(
$table->data[3][1] = html_print_extended_select_for_time('dynamic_interval', $dynamic_interval, '', 'None', '0', 10, true, 'width:150px', false);
$table->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image(
'images/cog.png', 'images/cog.png',
true, true,
[ [
@ -154,6 +166,22 @@ $table->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image(
] ]
).'</a>'; ).'</a>';
$table->data[3][0] = html_print_label_input_block(
__('Dynamic Interval'),
'<div class="inline_flex align-center w100p">'.html_print_extended_select_for_time(
'dynamic_interval',
$dynamic_interval,
'',
'None',
'0',
10,
true,
'width: 200px;',
false,
'w100p'
).$dynamic_interval_img.'</div>'
);
$table->data[3][2] = '<span><em>'.__('Dynamic Min. ').'</em>'; $table->data[3][2] = '<span><em>'.__('Dynamic Min. ').'</em>';
$table->data[3][2] .= html_print_input_text('dynamic_min', $dynamic_min, '', 10, 255, true); $table->data[3][2] .= html_print_input_text('dynamic_min', $dynamic_min, '', 10, 255, true);
$table->data[3][2] .= '<br /><em>'.__('Dynamic Max.').'</em>'; $table->data[3][2] .= '<br /><em>'.__('Dynamic Max.').'</em>';
@ -161,206 +189,286 @@ $table->data[3][2] .= html_print_input_text('dynamic_max', $dynamic_max, '', 10,
$table->data[3][3] = '<span><em>'.__('Dynamic Two Tailed: ').'</em>'; $table->data[3][3] = '<span><em>'.__('Dynamic Two Tailed: ').'</em>';
$table->data[3][3] .= html_print_checkbox('dynamic_two_tailed', 1, $dynamic_two_tailed, true); $table->data[3][3] .= html_print_checkbox('dynamic_two_tailed', 1, $dynamic_two_tailed, true);
$table->data[4][0] = __('Warning status'); $table->data[3][1] = html_print_label_input_block(
$table->data[4][1] = '<span id="minmax_warning"><em>'.__('Min.').'&nbsp;</em>&nbsp;';
$table->data[4][1] .= html_print_input_text(
'min_warning',
$min_warning,
'', '',
5, '<div class="inline_flex align-center">'.html_print_label_input_block(
15, __('Dynamic Min. '),
true html_print_input_text('dynamic_min', $dynamic_min, '', 10, 255, true, false, false, '', 'w100p mrgn_top_10px'),
); [
$table->data[4][1] .= '<br /><em>'.__('Max.').'</em>&nbsp;'; 'label_class' => 'font-title-font',
$table->data[4][1] .= html_print_input_text( 'div_class' => 'mrgn_right_10px',
'max_warning', ]
$max_warning, ).html_print_label_input_block(
'', __('Dynamic Max. '),
5, html_print_input_text('dynamic_max', $dynamic_max, '', 10, 255, true, false, false, '', 'w100p mrgn_top_10px'),
15, [
true 'label_class' => 'font-title-font',
).'</span>'; 'div_class' => 'mrgn_right_10px',
$table->data[4][1] .= '<span id="string_warning"><em>'.__('Str.').' </em>&nbsp;'; ]
$table->data[4][1] .= html_print_input_text( ).html_print_label_input_block(
'str_warning', __('Dynamic Two Tailed: '),
$str_warning, html_print_checkbox('dynamic_two_tailed', 1, $dynamic_two_tailed, true, false, '', false, 'class="mrgn_top_10px"'),
'', [
5, 'label_class' => 'font-title-font',
1024, 'div_class' => 'mrgn_right_10px',
true ]
).'</span>'; ).'</div>',
$table->data[4][1] .= '<div id="warning_inverse"><em>'.__('Inverse interval').'</em>'; ['label_class' => 'mrgn_btn_0']
$table->data[4][1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true);
$table->data[4][1] .= '</div>';
$table->data[4][1] .= '<div id="percentage_warning"><em>'.__('Percentage').'</em>';
$table->data[4][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true);
$table->data[4][1] .= html_print_checkbox('percentage_warning', 1, $percentage_warning, true);
$table->data[4][1] .= '</div>';
$table->data[5][0] .= '<span id="warning_time">'.__('Change to critical status after');
$table->data[5][1] .= html_print_input_text(
'warning_time',
$warning_time,
'',
5,
15,
true
);
$table->data[5][1] .= '&nbsp;&nbsp;<b>'.__('intervals in warning status.').'</b>';
$table->data[4][2] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
$table->colspan[4][2] = 2;
$table->rowspan[4][2] = 3;
$table->data[6][0] = __('Critical status');
$table->data[6][1] = '<span id="minmax_critical"><em>'.__('Min.').'&nbsp;</em>&nbsp;';
$table->data[6][1] .= html_print_input_text(
'min_critical',
$min_critical,
'',
5,
15,
true
);
$table->data[6][1] .= '<br /><em>'.__('Max.').'</em>&nbsp;';
$table->data[6][1] .= html_print_input_text(
'max_critical',
$max_critical,
'',
5,
15,
true
).'</span>';
$table->data[6][1] .= '<span id="string_critical"><em>'.__('Str.').' </em>&nbsp;';
$table->data[6][1] .= html_print_input_text(
'str_critical',
$str_critical,
'',
5,
1024,
true
).'</span>';
$table->data[6][1] .= '<div id="critical_inverse"><em>'.__('Inverse interval').'</em>';
$table->data[6][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true);
$table->data[6][1] .= '</div>';
$table->data[6][1] .= '<div id="percentage_critical"><em>'.__('Percentage').'</em>';
$table->data[6][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true);
$table->data[6][1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true);
$table->data[6][1] .= '</div>';
$table->data[7][0] = __('FF threshold');
$table->colspan[7][1] = 3;
$table->data[7][1] = __('Keep counters');
$table->data[7][1] .= html_print_checkbox(
'ff_type',
1,
$ff_type,
true
).'<br />';
$table->data[7][1] .= html_print_radio_button(
'each_ff',
0,
'',
$each_ff,
true
).' '.__('All state changing').' : ';
$table->data[7][1] .= html_print_input_text(
'ff_event',
$ff_event,
'',
5,
15,
true
).'<br />';
$table->data[7][1] .= html_print_radio_button(
'each_ff',
1,
'',
$each_ff,
true
).' '.__('Each state changing').' : ';
$table->data[7][1] .= __('To normal');
$table->data[7][1] .= html_print_input_text(
'ff_event_normal',
$ff_event_normal,
'',
5,
15,
true
).' ';
$table->data[7][1] .= __('To warning');
$table->data[7][1] .= html_print_input_text(
'ff_event_warning',
$ff_event_warning,
'',
5,
15,
true
).' ';
$table->data[7][1] .= __('To critical');
$table->data[7][1] .= html_print_input_text(
'ff_event_critical',
$ff_event_critical,
'',
5,
15,
true
); );
$table->data[8][0] = __('Historical data'); $table->data[4][0] = html_print_label_input_block(
$table->data[8][1] = html_print_checkbox('history_data', 1, $history_data, true); __('Warning status'),
'<div class="inline_flex align-center mrgn_top_10px"><div id="minmax_warning" class="inline_flex align-center">'.html_print_label_input_block(
$table->data[9][0] = __('Min. Value'); __('Min.'),
$table->data[9][1] = html_print_input_text('min', $min, '', 5, 15, true).' '.ui_print_help_tip(__('Any value below this number is discarted'), true); html_print_input_text(
$table->data[9][2] = __('Max. Value'); 'min_warning',
$table->data[9][3] = html_print_input_text('max', $max, '', 5, 15, true).' '.ui_print_help_tip(__('Any value over this number is discarted'), true); $min_warning,
$table->data[10][0] = __('Unit'); '',
$table->data[10][1] = html_print_input_text('unit', $unit, '', 12, 25, true); 5,
15,
$table->data[10][2] = __('Discard unknown events'); true
$table->data[10][3] = html_print_checkbox( ),
'throw_unknown_events', [
1, 'label_class' => 'font-title-font',
network_components_is_disable_type_event(($id === 0) ? false : $id, EVENTS_GOING_UNKNOWN), 'div_class' => 'mrgn_right_10px flex flex_column',
true ]
).html_print_label_input_block(
__('Max.'),
html_print_input_text(
'max_warning',
$max_warning,
'',
5,
15,
true
).'</div>',
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px flex flex_column',
]
).'<div id="string_warning" class="inline_flex align-center">'.html_print_label_input_block(
__('Str.'),
html_print_input_text(
'str_warning',
$str_warning,
'',
5,
1024,
true
).'</div>',
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px flex flex_column',
]
).'<div id="warning_inverse" class="inline_flex align-center">'.html_print_label_input_block(
__('Inverse interval'),
html_print_checkbox('warning_inverse', 1, $warning_inverse, true).'</div>',
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px flex flex_column',
]
).'<div id="percentage_warning" class="inline_flex align-center">'.html_print_label_input_block(
__('Percentage').ui_print_help_tip(__('Defines threshold as a percentage of value decrease/increment'), true),
html_print_checkbox('percentage_warning', 1, $percentage_warning, true).'</div>',
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px flex flex_column',
]
).'</div></div>',
['label_class' => 'mrgn_btn_0']
); );
$table->data[11][0] = __('Critical instructions').ui_print_help_tip(__('Instructions when the status is critical'), true); $table->data[4][1] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
$table->data[11][1] = html_print_textarea('critical_instructions', 2, 65, $critical_instructions, '', true); $table->rowspan[4][1] = 3;
$table->colspan[11][1] = 3;
$table->data[12][0] = __('Warning instructions').ui_print_help_tip(__('Instructions when the status is warning'), true); $table->data[5][0] = html_print_label_input_block(
$table->data[12][1] = html_print_textarea('warning_instructions', 2, 65, $warning_instructions, '', true); __('Change to critical status after'),
$table->colspan[12][1] = 3; '<div class="inline_flex align-center w100p">'.html_print_input_text(
'warning_time',
$warning_time,
'',
5,
15,
true
).'&nbsp;&nbsp;<b>'.__('intervals in warning status.').'</b>'.'</div>',
['div_id' => 'warning_time']
);
$table->data[13][0] = __('Unknown instructions').ui_print_help_tip(__('Instructions when the status is unknown'), true); $table->data[6][0] = html_print_label_input_block(
$table->data[13][1] = html_print_textarea('unknown_instructions', 2, 65, $unknown_instructions, '', true); __('Critical status'),
$table->colspan[13][1] = 3; '<div class="inline_flex align-center mrgn_top_10px"><div id="minmax_critical" class="inline_flex align-center">'.html_print_label_input_block(
__('Min.'),
html_print_input_text(
'min_critical',
$min_critical,
'',
5,
15,
true
),
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px flex flex_column',
]
).html_print_label_input_block(
__('Max.'),
html_print_input_text(
'max_critical',
$max_critical,
'',
5,
15,
true
).'</div>',
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px flex flex_column',
]
).'<div id="string_critical" class="inline_flex align-center">'.html_print_label_input_block(
__('Str.'),
html_print_input_text(
'str_critical',
$str_critical,
'',
5,
1024,
true
).'</div>',
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px flex flex_column',
]
).'<div id="critical_inverse" class="inline_flex align-center">'.html_print_label_input_block(
__('Inverse interval'),
html_print_checkbox('critical_inverse', 1, $critical_inverse, true).'</div>',
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px flex flex_column',
]
).'<div id="percentage_critical" class="inline_flex align-center">'.html_print_label_input_block(
__('Percentage'),
html_print_checkbox('percentage_critical', 1, $percentage_warning, true).'</div>',
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px flex flex_column',
]
).'</div></div>',
['label_class' => 'mrgn_btn_0']
);
$table->data[14][0] = __('Description'); $table->colspan[7][0] = 2;
$table->data[14][1] = html_print_textarea('description', 2, 65, $description, '', true); $table->data[7][0] = html_print_label_input_block(
$table->colspan[14][1] = 3; __('FF threshold'),
'<div class="inline_flex align-center w100p">'.__('Keep counters').'&nbsp;&nbsp;'.html_print_checkbox(
'ff_type',
1,
$ff_type,
true
).'</div><div class="inline_flex align-center w100p">'.html_print_radio_button('each_ff', 0, '', $each_ff, true).' <b>'.__('All state changing').' :&nbsp;&nbsp;</b>'.html_print_input_text(
'ff_event',
$ff_event,
'',
5,
15,
true
).'<span class="w30px">&nbsp;</span>'.html_print_radio_button(
'each_ff',
1,
'',
$each_ff,
true
).' <b>'.__('Each state changing').' :&nbsp;&nbsp;</b>'.__('To normal').html_print_input_text(
'ff_event_normal',
$ff_event_normal,
'',
5,
15,
true
).' '.__('To warning').html_print_input_text(
'ff_event_warning',
$ff_event_warning,
'',
5,
15,
true
).' '.__('To critical').html_print_input_text(
'ff_event_critical',
$ff_event_critical,
'',
5,
15,
true
).'</div>',
['div_id' => 'warning_time']
);
$next_row = 15; $table->data[8][0] = html_print_label_input_block(
__('Historical data'),
html_print_checkbox('history_data', 1, $history_data, true)
);
$table->data[9][0] = html_print_label_input_block(
__('Min. Value'),
html_print_input_text('min', $min, '', 5, 15, true)
);
$table->data[9][1] = html_print_label_input_block(
__('Max. Value').' '.ui_print_help_tip(__('Any value over this number is discarted'), true),
html_print_input_text('max', $max, '', 5, 15, true)
);
$table->data[10][0] = html_print_label_input_block(
__('Unit'),
html_print_input_text('unit', $unit, '', 12, 25, true)
);
$table->data[10][1] = html_print_label_input_block(
__('Discard unknown events'),
html_print_checkbox(
'throw_unknown_events',
1,
network_components_is_disable_type_event(($id === 0) ? false : $id, EVENTS_GOING_UNKNOWN),
true
)
);
$table->data[11][0] = html_print_label_input_block(
__('Critical instructions').ui_print_help_tip(__('Instructions when the status is critical'), true),
html_print_textarea('critical_instructions', 2, 65, $critical_instructions, '', true)
);
$table->data[11][1] = html_print_label_input_block(
__('Warning instructions').ui_print_help_tip(__('Instructions when the status is warning'), true),
html_print_textarea('warning_instructions', 2, 65, $warning_instructions, '', true)
);
$table->data[12][0] = html_print_label_input_block(
__('Unknown instructions').ui_print_help_tip(__('Instructions when the status is unknown'), true),
html_print_textarea('unknown_instructions', 2, 65, $unknown_instructions, '', true)
);
$table->data[12][1] = html_print_label_input_block(
__('Description'),
html_print_textarea('description', 2, 65, $description, '', true)
);
$next_row = 13;
if (check_acl($config['id_user'], 0, 'PM')) { if (check_acl($config['id_user'], 0, 'PM')) {
$table->data[$next_row][0] = __('Category'); $table->data[$next_row][0] = html_print_label_input_block(
$table->data[$next_row][1] = html_print_select(categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true); __('Category'),
$table->data[$next_row][2] = $table->data[$next_row][3] = $table->data[$next_row][4] = ''; html_print_select(categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true)
);
$table->data[$next_row][1] = '';
$next_row++; $next_row++;
} else { } else {
// Store in a hidden field if is not visible to avoid delete the value // Store in a hidden field if is not visible to avoid delete the value
$table->data[12][1] .= html_print_input_hidden('id_category', $id_category, true); $table->data[$next_row][0] = html_print_label_input_block(
'',
html_print_input_hidden('id_category', $id_category, true)
);
} }
$table->data[$next_row][0] = __('Tags');
if ($tags == '') { if ($tags == '') {
$tags_condition_not = '1 = 1'; $tags_condition_not = '1 = 1';
$tags_condition_in = '1 = 0'; $tags_condition_in = '1 = 0';
@ -370,43 +478,58 @@ if ($tags == '') {
$tags_condition_in = "name IN ('".$tags."')"; $tags_condition_in = "name IN ('".$tags."')";
} }
$table->data[$next_row][1] = '<b>'.__('Tags available').'</b><br>'; $table->colspan[$next_row][0] = 2;
$table->data[$next_row][1] .= html_print_select_from_sql( $table->data[$next_row][0] = html_print_label_input_block(
"SELECT name AS name1, name AS name2 __('Tags'),
FROM ttag '<div class="inline_flex align-center flex-space-around w100p"><div><b>'.__('Tags available').'</b><br>'.html_print_select_from_sql(
WHERE $tags_condition_not "SELECT name AS name1, name AS name2
ORDER BY name", FROM ttag
'id_tag_available[]', WHERE $tags_condition_not
'', ORDER BY name",
'', 'id_tag_available[]',
'', '',
'', '',
true, '',
true, '',
false, true,
false, true,
'width: 200px', false,
'5' false,
); 'width: 200px',
$table->data[$next_row][2] = html_print_image('images/darrowright.png', true, ['id' => 'right', 'title' => __('Add tags to module'), 'class' => 'invert_filter']); '5'
$table->data[$next_row][2] .= '<br><br><br><br>'.html_print_image('images/darrowleft.png', true, ['id' => 'left', 'title' => __('Delete tags to module'), 'class' => 'invert_filter']); ).'</div><div>'.html_print_image(
$table->data[$next_row][3] = '<b>'.__('Tags selected').'</b><br>'; 'images/darrowright.png',
$table->data[$next_row][3] .= html_print_select_from_sql( true,
"SELECT name AS name1, name AS name2 [
FROM ttag 'id' => 'right',
WHERE $tags_condition_in 'title' => __('Add tags to module'),
ORDER BY name", 'class' => 'invert_filter',
'id_tag_selected[]', ]
'', ).'<br><br><br><br>'.html_print_image(
'', 'images/darrowleft.png',
'', true,
'', [
true, 'id' => 'left',
true, 'title' => __('Delete tags to module'),
false, 'class' => 'invert_filter',
false, ]
'width: 200px', ).'</div><div><b>'.__('Tags selected').'</b><br>'.html_print_select_from_sql(
'5' "SELECT name AS name1, name AS name2
FROM ttag
WHERE $tags_condition_in
ORDER BY name",
'id_tag_selected[]',
'',
'',
'',
'',
true,
true,
false,
false,
'width: 200px',
'5'
).'</div></div>'
); );
$next_row++; $next_row++;
@ -685,12 +808,12 @@ $next_row++;
//Dynamic_options_advance; //Dynamic_options_advance;
function advanced_option_dynamic() { function advanced_option_dynamic() {
if($('#network_component-3-2').is(":visible")){ if($('#network_component-3-1').is(":visible")){
$('#network_component-3-2').hide(); $('#network_component-3-1').hide();
$('#network_component-3-3').hide(); $('#network_component-3-1').hide();
} else { } else {
$('#network_component-3-2').show(); $('#network_component-3-1').show();
$('#network_component-3-3').show(); $('#network_component-3-1').show();
} }
} }

View File

@ -50,226 +50,280 @@ $snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3'; $snmp_versions['3'] = 'v. 3';
$data = []; $data = [];
$data[0] = __('Target IP'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('Target IP'),
'target_ip', html_print_input_text_extended(
$target_ip, 'target_ip',
'target_ip', $target_ip,
'', 'target_ip',
30, '',
10000, 30,
'', 10000,
'', '',
'', '',
true '',
true
)
); );
$data[2] = __('SNMP version');
$data[3] = html_print_select( $data[1] = html_print_label_input_block(
$snmp_versions, __('SNMP version'),
'snmp_version', html_print_select(
$snmp_version, $snmp_versions,
'', 'snmp_version',
'', $snmp_version,
'', '',
true, '',
false, '',
false, true,
'' false,
false,
''
)
); );
push_table_row($data, 'row1'); push_table_row($data, 'row1');
$data = []; $data = [];
$data[0] = __('Port'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text('tcp_port', $tcp_port, '', 5, 20, true); __('Port'),
$data[2] = __('SNMP community'); html_print_input_text('tcp_port', $tcp_port, '', 5, 20, true)
$data[3] = html_print_input_text( );
'snmp_community',
$snmp_community, $data[1] = html_print_label_input_block(
'', __('SNMP community'),
15, html_print_input_text(
60, 'snmp_community',
true $snmp_community,
'',
15,
60,
true
)
); );
push_table_row($data, 'snmp_port'); push_table_row($data, 'snmp_port');
$data = []; $data = [];
$data[0] = __('SNMP Enterprise String'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text( __('SNMP Enterprise String'),
'snmp_oid', html_print_input_text(
$snmp_oid, 'snmp_oid',
'', $snmp_oid,
30, '',
400, 30,
true 400,
true
)
); );
$data[2] = __('Auth password');
$data[3] = html_print_input_password( $data[1] = html_print_label_input_block(
'snmp3_auth_pass', __('Auth password'),
$snmp3_auth_pass, html_print_input_password(
'', 'snmp3_auth_pass',
15, $snmp3_auth_pass,
60, '',
true 15,
); 60,
$data[3] .= html_print_input_hidden_extended( true,
'active_snmp_v3', false,
0, false,
'active_snmp_v3_mncfn', '',
true 'off',
true
).html_print_input_hidden_extended(
'active_snmp_v3',
0,
'active_snmp_v3_mncfn',
true
)
); );
push_table_row($data, 'snmp_2'); push_table_row($data, 'snmp_2');
$data = []; $data = [];
$data[0] = __('Auth user'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text( __('Auth user'),
'snmp3_auth_user', html_print_input_text(
$snmp3_auth_user, 'snmp3_auth_user',
'', $snmp3_auth_user,
15, '',
60, 15,
true 60,
true
)
); );
$data[2] = __('Privacy pass');
$data[3] = html_print_input_password( $data[1] = html_print_label_input_block(
'snmp3_privacy_pass', __('Privacy pass'),
$snmp3_privacy_pass, html_print_input_password(
'', 'snmp3_privacy_pass',
15, $snmp3_privacy_pass,
60, '',
true 15,
60,
true,
false,
false,
'',
'off',
true
)
); );
push_table_row($data, 'field_snmpv3_row1'); push_table_row($data, 'field_snmpv3_row1');
$data = []; $data = [];
$data[0] = __('Privacy method'); $data[0] = html_print_label_input_block(
$data[1] = html_print_select( __('Privacy method'),
[ html_print_select(
'DES' => __('DES'), [
'AES' => __('AES'), 'DES' => __('DES'),
], 'AES' => __('AES'),
'snmp3_privacy_method', ],
$snmp3_privacy_method, 'snmp3_privacy_method',
'', $snmp3_privacy_method,
'', '',
'', '',
true '',
true
)
); );
$data[2] = __('Security level');
$data[3] = html_print_select( $data[1] = html_print_label_input_block(
[ __('Security level'),
'noAuthNoPriv' => __('Not auth and not privacy method'), html_print_select(
'authNoPriv' => __('Auth and not privacy method'), [
'authPriv' => __('Auth and privacy method'), 'noAuthNoPriv' => __('Not auth and not privacy method'),
], 'authNoPriv' => __('Auth and not privacy method'),
'snmp3_security_level', 'authPriv' => __('Auth and privacy method'),
$snmp3_security_level, ],
'', 'snmp3_security_level',
'', $snmp3_security_level,
'', '',
true '',
'',
true
)
); );
push_table_row($data, 'field_snmpv3_row2'); push_table_row($data, 'field_snmpv3_row2');
$data = []; $data = [];
$data[0] = __('Auth method'); $data[0] = html_print_label_input_block(
$data[1] = html_print_select( __('Auth method'),
[ html_print_select(
'MD5' => __('MD5'), [
'SHA' => __('SHA'), 'MD5' => __('MD5'),
], 'SHA' => __('SHA'),
'snmp3_auth_method', ],
$snmp3_auth_method, 'snmp3_auth_method',
'', $snmp3_auth_method,
'', '',
'', '',
true '',
true
)
); );
$data[2] = __('Name OID').'&nbsp;'.ui_print_help_icon('xxx', true);
$data[3] = html_print_input_text_extended( $data[1] = html_print_label_input_block(
'name_oid', __('Name OID').'&nbsp;'.ui_print_help_icon('xxx', true),
$name_oid, html_print_input_text_extended(
'name_oid', 'name_oid',
'', $name_oid,
30, 'name_oid',
10000, '',
'', 30,
'', 10000,
'', '',
true '',
'',
true
)
); );
push_table_row($data, 'field_snmpv3_row3'); push_table_row($data, 'field_snmpv3_row3');
$data = []; $data = [];
$data[0] = __('Post process'); $data[0] = html_print_label_input_block(
$data[1] = html_print_extended_select_for_post_process( __('Post process'),
'post_process', html_print_extended_select_for_post_process(
$post_process, 'post_process',
$post_process,
'',
'',
'0',
false,
true,
false,
true
)
);
$data[1] = html_print_label_input_block(
'', '',
'', ''
'0',
false,
true,
false,
true
); );
push_table_row($data, 'field_process'); push_table_row($data, 'field_process');
// Advanced stuff. // Advanced stuff.
$data = []; $data = [];
$data[0] = __('TCP send'); $data[0] = html_print_label_input_block(
$data[1] = html_print_textarea('tcp_send', 2, 65, $tcp_send, '', true); __('TCP send'),
$table->colspan['tcp_send'][1] = 3; html_print_textarea('tcp_send', 2, 65, $tcp_send, '', true)
);
$table->colspan['tcp_send'][0] = 2;
push_table_row($data, 'tcp_send'); push_table_row($data, 'tcp_send');
$data = []; $data = [];
$data[0] = __('TCP receive'); $data[0] = html_print_label_input_block(
$data[1] = html_print_textarea('tcp_rcv', 2, 65, $tcp_rcv, '', true); __('TCP receive'),
$table->colspan['tcp_receive'][1] = 3; html_print_textarea('tcp_rcv', 2, 65, $tcp_rcv, '', true)
);
$table->colspan['tcp_receive'][0] = 2;
push_table_row($data, 'tcp_receive'); push_table_row($data, 'tcp_receive');
$data = []; $data = [];
$data[0] = __('Command'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('Command'),
'command_text', html_print_input_text_extended(
$command_text, 'command_text',
'command_text', $command_text,
'', 'command_text',
100, '',
10000, 100,
$disabledBecauseInPolicy, 10000,
'', $disabledBecauseInPolicy,
$largeClassDisabledBecauseInPolicy, '',
true $largeClassDisabledBecauseInPolicy,
true
)
); );
$table->colspan['row-cmd-row-1'][1] = 3; $table->colspan['row-cmd-row-1'][0] = 2;
push_table_row($data, 'row-cmd-row-1'); push_table_row($data, 'row-cmd-row-1');
require_once $config['homedir'].'/include/class/CredentialStore.class.php'; require_once $config['homedir'].'/include/class/CredentialStore.class.php';
$array_credential_identifier = CredentialStore::getKeys('CUSTOM'); $array_credential_identifier = CredentialStore::getKeys('CUSTOM');
$data[0] = __('Credential identifier'); $data[0] = html_print_label_input_block(
$data[1] = html_print_select( __('Credential identifier'),
$array_credential_identifier, html_print_select(
'command_credential_identifier', $array_credential_identifier,
$command_credential_identifier, 'command_credential_identifier',
'', $command_credential_identifier,
__('None'), '',
'', __('None'),
true, '',
false, true,
false, false,
'', false,
$disabledBecauseInPolicy '',
$disabledBecauseInPolicy
)
); );
$array_os = [ $array_os = [
@ -278,19 +332,21 @@ $array_os = [
'windows' => __('Windows'), 'windows' => __('Windows'),
]; ];
$data[2] = __('Target OS'); $data[1] = html_print_label_input_block(
$data[3] = html_print_select( __('Target OS'),
$array_os, html_print_select(
'command_os', $array_os,
$command_os, 'command_os',
'', $command_os,
'', '',
'', '',
true, '',
false, true,
false, false,
'', false,
$disabledBecauseInPolicy '',
$disabledBecauseInPolicy
)
); );
push_table_row($data, 'row-cmd-row-2'); push_table_row($data, 'row-cmd-row-2');

View File

@ -32,41 +32,49 @@ global $config;
check_login(); check_login();
$data = []; $data = [];
$data[0] = __('Plugin'); $data[0] = html_print_label_input_block(
$data[1] = html_print_select_from_sql( __('Plugin'),
'SELECT id, name FROM tplugin ORDER BY name', html_print_select_from_sql(
'id_plugin', 'SELECT id, name FROM tplugin ORDER BY name',
$id_plugin, 'id_plugin',
'javascript: load_plugin_macros_fields(\'network_component-macro\')', $id_plugin,
__('None'), 'javascript: load_plugin_macros_fields(\'network_component-macro\')',
0, __('None'),
true, 0,
false, true,
false false,
false,
false,
'width: 100%;'
).html_print_input_hidden('macros', base64_encode($macros), true)
// Store the macros in base64 into a hidden control to move between pages.
); );
// Store the macros in base64 into a hidden control to move between pages.
$data[1] .= html_print_input_hidden('macros', base64_encode($macros), true); $data[1] = html_print_label_input_block(
$data[2] = __('Post process'); __('Post process'),
$data[3] = html_print_extended_select_for_post_process( html_print_extended_select_for_post_process(
'post_process', 'post_process',
$post_process, $post_process,
'', '',
__('Empty'), __('Empty'),
'0', '0',
false, false,
true, true,
false, false,
true true
)
); );
push_table_row($data, 'plugin_1'); push_table_row($data, 'plugin_1');
// A hidden "model row" to clone it from javascript to add fields dynamicly. // A hidden "model row" to clone it from javascript to add fields dynamicly.
$data = []; $data = [];
$data[0] = 'macro_desc'; $data[0] = html_print_label_input_block(
$data[0] .= ui_print_help_tip('macro_help', true); __('macro_desc').ui_print_help_tip('macro_help', true),
$data[1] = html_print_input_text('macro_name', 'macro_value', '', 100, 1024, true); html_print_input_text('macro_name', 'macro_value', '', 100, 1024, true)
$table->colspan['macro_field'][1] = 3; );
$table->colspan['macro_field'][0] = 2;
$table->rowstyle['macro_field'] = 'display:none'; $table->rowstyle['macro_field'] = 'display:none';
push_table_row($data, 'macro_field'); push_table_row($data, 'macro_field');
@ -77,32 +85,44 @@ if (!empty($macros)) {
foreach ($macros as $k => $m) { foreach ($macros as $k => $m) {
$data = []; $data = [];
$data[0] = $m['desc']; $macro_label = $m['desc'];
if (!empty($m['help'])) { if (!empty($m['help'])) {
$data[0] .= ui_print_help_tip($m['help'], true); $macro_label .= ui_print_help_tip($m['help'], true);
} }
if ($m['hide'] == 1) { if ($m['hide'] == 1) {
$data[1] = html_print_input_text( $macro_input = html_print_input_text(
$m['macro'], $m['macro'],
io_output_password($m['value']), io_output_password($m['value']),
'', '',
100, 100,
1024, 1024,
true true,
false,
'',
'w50p'
); );
} else { } else {
$data[1] = html_print_input_text( $macro_input = html_print_input_text(
$m['macro'], $m['macro'],
$m['value'], $m['value'],
'', '',
100, 100,
1024, 1024,
true true,
false,
false,
'',
'w50p'
); );
} }
$table->colspan['macro'.$m['macro']][1] = 3; $data[0] = html_print_label_input_block(
$macro_label,
$macro_input
);
$table->colspan['macro'.$m['macro']][0] = 2;
$table->rowclass['macro'.$m['macro']] = 'macro_field'; $table->rowclass['macro'.$m['macro']] = 'macro_field';
push_table_row($data, 'macro'.$m['macro']); push_table_row($data, 'macro'.$m['macro']);

View File

@ -28,41 +28,70 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_modules.php';
$data = []; $data = [];
$data[0] = __('WMI query').' '.ui_print_help_icon('wmi_query_tab', true); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text('snmp_oid', $snmp_oid, '', 25, 255, true); __('WMI query').' '.ui_print_help_icon('wmi_query_tab', true),
$data[2] = __('Key string'); html_print_input_text('snmp_oid', $snmp_oid, '', 25, 255, true)
$data[3] = html_print_input_text('snmp_community', $snmp_community, '', 25, 255, true); );
$data[1] = html_print_label_input_block(
__('Key string'),
html_print_input_text('snmp_community', $snmp_community, '', 25, 255, true)
);
push_table_row($data, 'wmi_1'); push_table_row($data, 'wmi_1');
$data = []; $data = [];
$data[0] = __('Field number'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text('tcp_port', $tcp_port, '', 5, 25, true); __('Field number'),
$data[2] = __('Namespace'); html_print_input_text('tcp_port', $tcp_port, '', 5, 25, true)
$data[3] = html_print_input_text('tcp_send', $tcp_send, '', 25, 255, true); );
$data[1] = html_print_label_input_block(
__('Namespace'),
html_print_input_text('tcp_send', $tcp_send, '', 25, 255, true)
);
push_table_row($data, 'wmi_2'); push_table_row($data, 'wmi_2');
$data = []; $data = [];
$data[0] = __('Username'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text('plugin_user', $plugin_user, '', 15, 255, true); __('Username'),
$data[2] = __('Password'); html_print_input_text('plugin_user', $plugin_user, '', 15, 255, true)
$data[3] = html_print_input_password('plugin_pass', $plugin_pass, '', 25, 255, true); );
$data[1] = html_print_label_input_block(
__('Password'),
html_print_input_password(
'plugin_pass',
$plugin_pass,
'',
25,
255,
true,
false,
false,
'',
'off',
true
)
);
push_table_row($data, 'wmi_3'); push_table_row($data, 'wmi_3');
$data = []; $data = [];
$data[0] = __('Post process'); $data[0] = html_print_label_input_block(
$data[1] = html_print_extended_select_for_post_process( __('Post process'),
'post_process', html_print_extended_select_for_post_process(
$post_process, 'post_process',
'', $post_process,
__('Empty'), '',
'0', __('Empty'),
false, '0',
true, false,
false, true,
true false,
true
)
); );
$data[2] = $data[3] = ''; $data[1] = '';
push_table_row($data, 'field_process'); push_table_row($data, 'field_process');

View File

@ -3115,7 +3115,7 @@ function alerts_get_alert_fired($filters=[], $groupsBy=[])
$fields[] = $table.'.id_agente as agent'; $fields[] = $table.'.id_agente as agent';
$group_array[] = $table.'.id_agente'; $group_array[] = $table.'.id_agente';
$names_search = agents_get_alias_array( $names_search = agents_get_alias_array(
array_values($filters['agents'] ?? []) array_values(($filters['agents'] ?? []))
); );
if (is_metaconsole() === true) { if (is_metaconsole() === true) {

View File

@ -1553,10 +1553,10 @@ function changePlugin() {
if (executionType == EXECUTION_TYPE_NETWORK) { if (executionType == EXECUTION_TYPE_NETWORK) {
displayShow = "none"; displayShow = "none";
} else { } else {
displayShow = "table-row"; displayShow = "grid";
} }
var cntMacrosToGo = 4; var cntMacrosToGo = 2;
var cntMacrosLine = 0; var cntMacrosLine = 0;
var thisIdLine = ""; var thisIdLine = "";
// Clear older macros rows. // Clear older macros rows.
@ -1589,7 +1589,7 @@ function changePlugin() {
description = "unknown"; description = "unknown";
} }
if (cntMacrosToGo == 4) { if (cntMacrosToGo == 2) {
cntMacrosToGo = 0; cntMacrosToGo = 0;
cntMacrosLine++; cntMacrosLine++;
thisIdLine = thisIdLine =

View File

@ -650,6 +650,10 @@ select:-internal-list-box {
display: inline-flex; display: inline-flex;
} }
.align-center {
align-items: center;
}
.relative { .relative {
position: relative; position: relative;
} }
@ -12249,3 +12253,28 @@ div#visual-console-container * {
font-size: unset; font-size: unset;
line-height: unset; line-height: unset;
} }
.combo-oid-button {
display: flex !important;
flex-direction: row !important;
flex-wrap: wrap !important;
justify-content: flex-start !important;
align-items: flex-start !important;
}
tr[id^="network_component-plugin-wmi-fields-dynamicMacroRow-"] > td:first-child,
tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"]
> td:first-child {
padding-bottom: 0px !important;
}
tr[id^="network_component-plugin-wmi-fields-dynamicMacroRow-"] > td:last-child,
tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"]
> td:last-child {
padding-top: 0px !important;
}
tr[id^="network_component-plugin-wmi-fields-dynamicMacroRow-"] input,
tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
width: 100% !important;
}