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 artica/pandorafms!6029
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;
}
echo '<form name="component" method="post">';
echo '<form name="component" method="post" class="max_floating_element_size">';
$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 ($id) {

View File

@ -28,10 +28,10 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'],
$table = new stdClass();
$table->id = 'network_component';
$table->width = '100%';
$table->class = 'databox';
$table->class = 'databox filters filter-table-adv';
$table->style = [];
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
$table->style[0] = 'width: 50%';
$table->style[2] = 'width: 50%';
$table->colspan = [];
if (!enterprise_installed()) {
$table->colspan[0][1] = 3;
@ -43,8 +43,10 @@ $table_simple->colspan[8][1] = 4;
$table_simple->colspan[9][1] = 4;
$table->data = [];
$table->data[0][0] = __('Name');
$table->data[0][1] = html_print_input_text('name', $name, '', 55, 255, true);
$table->data[0][0] = html_print_label_input_block(
__('Name'),
html_print_input_text('name', $name, '', 55, 255, true)
);
if (enterprise_installed()) {
if (defined('METACONSOLE')) {
$table->data[0][2] = __('Wizard level');
@ -53,15 +55,19 @@ if (enterprise_installed()) {
'advanced' => __('Advanced'),
];
// 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)
} else {
$table->data[0][2] = '';
$table->data[0][3] = html_print_input_hidden('wizard_level', $wizard_level, true);
$table->data[0][1] = html_print_label_input_block(
'',
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(
'SELECT id_tipo, descripcion
FROM ttipo_modulo
@ -69,22 +75,25 @@ $sql = sprintf(
ORDER BY id_tipo ASC',
implode(',', $categories)
);
$table->data[1][1] = html_print_select_from_sql(
$sql,
'type',
$type,
'javascript: type_change();',
'',
'',
true,
false,
false,
false,
true,
false,
false,
false,
0
$table->data[1][0] = html_print_label_input_block(
__('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help'),
html_print_select_from_sql(
$sql,
'type',
$type,
'javascript: type_change();',
'',
'',
true,
false,
false,
false,
true,
false,
false,
false,
0
)
);
// 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'];
}
$table->data[1][1] .= html_print_input_hidden(
'type_names',
base64_encode(json_encode($type_names_hash)),
true
$table->data[1][1] = html_print_label_input_block(
__('Module group'),
html_print_input_hidden(
'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[1][3] = 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[2][0] = html_print_label_input_block(
__('Group'),
html_print_select(
network_components_get_groups(),
'id_group',
$id_group,
'',
'',
'',
true,
false,
false
)
);
$table->data[2][0] = __('Group');
$table->data[2][1] = html_print_select(
network_components_get_groups(),
'id_group',
$id_group,
'',
'',
'',
true,
false,
false
$table->data[2][1] = html_print_label_input_block(
__('Interval'),
html_print_extended_select_for_time('module_interval', $module_interval, '', '', '0', false, true)
);
$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');
$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(
$dynamic_interval_img = '<a onclick="advanced_option_dynamic()" class="mrgn_lft_5px mrgn_top_6px">'.html_print_image(
'images/cog.png',
true,
[
@ -154,6 +166,22 @@ $table->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image(
]
).'</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] .= html_print_input_text('dynamic_min', $dynamic_min, '', 10, 255, true);
$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] .= html_print_checkbox('dynamic_two_tailed', 1, $dynamic_two_tailed, true);
$table->data[4][0] = __('Warning status');
$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,
$table->data[3][1] = html_print_label_input_block(
'',
5,
15,
true
);
$table->data[4][1] .= '<br /><em>'.__('Max.').'</em>&nbsp;';
$table->data[4][1] .= html_print_input_text(
'max_warning',
$max_warning,
'',
5,
15,
true
).'</span>';
$table->data[4][1] .= '<span id="string_warning"><em>'.__('Str.').' </em>&nbsp;';
$table->data[4][1] .= html_print_input_text(
'str_warning',
$str_warning,
'',
5,
1024,
true
).'</span>';
$table->data[4][1] .= '<div id="warning_inverse"><em>'.__('Inverse interval').'</em>';
$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
'<div class="inline_flex align-center">'.html_print_label_input_block(
__('Dynamic Min. '),
html_print_input_text('dynamic_min', $dynamic_min, '', 10, 255, true, false, false, '', 'w100p mrgn_top_10px'),
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px',
]
).html_print_label_input_block(
__('Dynamic Max. '),
html_print_input_text('dynamic_max', $dynamic_max, '', 10, 255, true, false, false, '', 'w100p mrgn_top_10px'),
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px',
]
).html_print_label_input_block(
__('Dynamic Two Tailed: '),
html_print_checkbox('dynamic_two_tailed', 1, $dynamic_two_tailed, true, false, '', false, 'class="mrgn_top_10px"'),
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_right_10px',
]
).'</div>',
['label_class' => 'mrgn_btn_0']
);
$table->data[8][0] = __('Historical data');
$table->data[8][1] = html_print_checkbox('history_data', 1, $history_data, true);
$table->data[9][0] = __('Min. Value');
$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);
$table->data[9][2] = __('Max. Value');
$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);
$table->data[10][0] = __('Unit');
$table->data[10][1] = html_print_input_text('unit', $unit, '', 12, 25, true);
$table->data[10][2] = __('Discard unknown events');
$table->data[10][3] = html_print_checkbox(
'throw_unknown_events',
1,
network_components_is_disable_type_event(($id === 0) ? false : $id, EVENTS_GOING_UNKNOWN),
true
$table->data[4][0] = html_print_label_input_block(
__('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(
__('Min.'),
html_print_input_text(
'min_warning',
$min_warning,
'',
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_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[11][1] = html_print_textarea('critical_instructions', 2, 65, $critical_instructions, '', true);
$table->colspan[11][1] = 3;
$table->data[4][1] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
$table->rowspan[4][1] = 3;
$table->data[12][0] = __('Warning instructions').ui_print_help_tip(__('Instructions when the status is warning'), true);
$table->data[12][1] = html_print_textarea('warning_instructions', 2, 65, $warning_instructions, '', true);
$table->colspan[12][1] = 3;
$table->data[5][0] = html_print_label_input_block(
__('Change to critical status after'),
'<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[13][1] = html_print_textarea('unknown_instructions', 2, 65, $unknown_instructions, '', true);
$table->colspan[13][1] = 3;
$table->data[6][0] = html_print_label_input_block(
__('Critical status'),
'<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->data[14][1] = html_print_textarea('description', 2, 65, $description, '', true);
$table->colspan[14][1] = 3;
$table->colspan[7][0] = 2;
$table->data[7][0] = html_print_label_input_block(
__('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')) {
$table->data[$next_row][0] = __('Category');
$table->data[$next_row][1] = html_print_select(categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true);
$table->data[$next_row][2] = $table->data[$next_row][3] = $table->data[$next_row][4] = '';
$table->data[$next_row][0] = html_print_label_input_block(
__('Category'),
html_print_select(categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true)
);
$table->data[$next_row][1] = '';
$next_row++;
} else {
// 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 == '') {
$tags_condition_not = '1 = 1';
$tags_condition_in = '1 = 0';
@ -370,43 +478,58 @@ if ($tags == '') {
$tags_condition_in = "name IN ('".$tags."')";
}
$table->data[$next_row][1] = '<b>'.__('Tags available').'</b><br>';
$table->data[$next_row][1] .= html_print_select_from_sql(
"SELECT name AS name1, name AS name2
FROM ttag
WHERE $tags_condition_not
ORDER BY name",
'id_tag_available[]',
'',
'',
'',
'',
true,
true,
false,
false,
'width: 200px',
'5'
);
$table->data[$next_row][2] = html_print_image('images/darrowright.png', true, ['id' => 'right', 'title' => __('Add tags to module'), 'class' => 'invert_filter']);
$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']);
$table->data[$next_row][3] = '<b>'.__('Tags selected').'</b><br>';
$table->data[$next_row][3] .= html_print_select_from_sql(
"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'
$table->colspan[$next_row][0] = 2;
$table->data[$next_row][0] = html_print_label_input_block(
__('Tags'),
'<div class="inline_flex align-center flex-space-around w100p"><div><b>'.__('Tags available').'</b><br>'.html_print_select_from_sql(
"SELECT name AS name1, name AS name2
FROM ttag
WHERE $tags_condition_not
ORDER BY name",
'id_tag_available[]',
'',
'',
'',
'',
true,
true,
false,
false,
'width: 200px',
'5'
).'</div><div>'.html_print_image(
'images/darrowright.png',
true,
[
'id' => 'right',
'title' => __('Add tags to module'),
'class' => 'invert_filter',
]
).'<br><br><br><br>'.html_print_image(
'images/darrowleft.png',
true,
[
'id' => 'left',
'title' => __('Delete tags to module'),
'class' => 'invert_filter',
]
).'</div><div><b>'.__('Tags selected').'</b><br>'.html_print_select_from_sql(
"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++;
@ -685,12 +808,12 @@ $next_row++;
//Dynamic_options_advance;
function advanced_option_dynamic() {
if($('#network_component-3-2').is(":visible")){
$('#network_component-3-2').hide();
$('#network_component-3-3').hide();
if($('#network_component-3-1').is(":visible")){
$('#network_component-3-1').hide();
$('#network_component-3-1').hide();
} else {
$('#network_component-3-2').show();
$('#network_component-3-3').show();
$('#network_component-3-1').show();
$('#network_component-3-1').show();
}
}

View File

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

View File

@ -32,41 +32,49 @@ global $config;
check_login();
$data = [];
$data[0] = __('Plugin');
$data[1] = html_print_select_from_sql(
'SELECT id, name FROM tplugin ORDER BY name',
'id_plugin',
$id_plugin,
'javascript: load_plugin_macros_fields(\'network_component-macro\')',
__('None'),
0,
true,
false,
false
$data[0] = html_print_label_input_block(
__('Plugin'),
html_print_select_from_sql(
'SELECT id, name FROM tplugin ORDER BY name',
'id_plugin',
$id_plugin,
'javascript: load_plugin_macros_fields(\'network_component-macro\')',
__('None'),
0,
true,
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[2] = __('Post process');
$data[3] = html_print_extended_select_for_post_process(
'post_process',
$post_process,
'',
__('Empty'),
'0',
false,
true,
false,
true
$data[1] = html_print_label_input_block(
__('Post process'),
html_print_extended_select_for_post_process(
'post_process',
$post_process,
'',
__('Empty'),
'0',
false,
true,
false,
true
)
);
push_table_row($data, 'plugin_1');
// A hidden "model row" to clone it from javascript to add fields dynamicly.
$data = [];
$data[0] = 'macro_desc';
$data[0] .= ui_print_help_tip('macro_help', true);
$data[1] = html_print_input_text('macro_name', 'macro_value', '', 100, 1024, true);
$table->colspan['macro_field'][1] = 3;
$data[0] = html_print_label_input_block(
__('macro_desc').ui_print_help_tip('macro_help', true),
html_print_input_text('macro_name', 'macro_value', '', 100, 1024, true)
);
$table->colspan['macro_field'][0] = 2;
$table->rowstyle['macro_field'] = 'display:none';
push_table_row($data, 'macro_field');
@ -77,32 +85,44 @@ if (!empty($macros)) {
foreach ($macros as $k => $m) {
$data = [];
$data[0] = $m['desc'];
$macro_label = $m['desc'];
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) {
$data[1] = html_print_input_text(
$macro_input = html_print_input_text(
$m['macro'],
io_output_password($m['value']),
'',
100,
1024,
true
true,
false,
'',
'w50p'
);
} else {
$data[1] = html_print_input_text(
$macro_input = html_print_input_text(
$m['macro'],
$m['value'],
'',
100,
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';
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';
$data = [];
$data[0] = __('WMI query').' '.ui_print_help_icon('wmi_query_tab', true);
$data[1] = html_print_input_text('snmp_oid', $snmp_oid, '', 25, 255, true);
$data[2] = __('Key string');
$data[3] = html_print_input_text('snmp_community', $snmp_community, '', 25, 255, true);
$data[0] = html_print_label_input_block(
__('WMI query').' '.ui_print_help_icon('wmi_query_tab', true),
html_print_input_text('snmp_oid', $snmp_oid, '', 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');
$data = [];
$data[0] = __('Field number');
$data[1] = html_print_input_text('tcp_port', $tcp_port, '', 5, 25, true);
$data[2] = __('Namespace');
$data[3] = html_print_input_text('tcp_send', $tcp_send, '', 25, 255, true);
$data[0] = html_print_label_input_block(
__('Field number'),
html_print_input_text('tcp_port', $tcp_port, '', 5, 25, 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');
$data = [];
$data[0] = __('Username');
$data[1] = html_print_input_text('plugin_user', $plugin_user, '', 15, 255, true);
$data[2] = __('Password');
$data[3] = html_print_input_password('plugin_pass', $plugin_pass, '', 25, 255, true);
$data[0] = html_print_label_input_block(
__('Username'),
html_print_input_text('plugin_user', $plugin_user, '', 15, 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');
$data = [];
$data[0] = __('Post process');
$data[1] = html_print_extended_select_for_post_process(
'post_process',
$post_process,
'',
__('Empty'),
'0',
false,
true,
false,
true
$data[0] = html_print_label_input_block(
__('Post process'),
html_print_extended_select_for_post_process(
'post_process',
$post_process,
'',
__('Empty'),
'0',
false,
true,
false,
true
)
);
$data[2] = $data[3] = '';
$data[1] = '';
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';
$group_array[] = $table.'.id_agente';
$names_search = agents_get_alias_array(
array_values($filters['agents'] ?? [])
array_values(($filters['agents'] ?? []))
);
if (is_metaconsole() === true) {

View File

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

View File

@ -650,6 +650,10 @@ select:-internal-list-box {
display: inline-flex;
}
.align-center {
align-items: center;
}
.relative {
position: relative;
}
@ -12249,3 +12253,28 @@ div#visual-console-container * {
font-size: 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;
}