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; 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,7 +75,9 @@ $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(
__('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help'),
html_print_select_from_sql(
$sql, $sql,
'type', 'type',
$type, $type,
@ -85,6 +93,7 @@ $table->data[1][1] = html_print_select_from_sql(
false, false,
false, false,
0 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,14 +111,13 @@ 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(
__('Module group'),
html_print_input_hidden(
'type_names', 'type_names',
base64_encode(json_encode($type_names_hash)), base64_encode(json_encode($type_names_hash)),
true true
); ).html_print_select_from_sql(
$table->data[1][2] = __('Module group');
$table->data[1][3] = html_print_select_from_sql(
'SELECT id_mg, name 'SELECT id_mg, name
FROM tmodule_group ORDER BY name', FROM tmodule_group ORDER BY name',
'id_module_group', 'id_module_group',
@ -126,10 +134,12 @@ $table->data[1][3] = html_print_select_from_sql(
false, false,
false, false,
0 0
)
); );
$table->data[2][0] = __('Group'); $table->data[2][0] = html_print_label_input_block(
$table->data[2][1] = html_print_select( __('Group'),
html_print_select(
network_components_get_groups(), network_components_get_groups(),
'id_group', 'id_group',
$id_group, $id_group,
@ -139,13 +149,15 @@ $table->data[2][1] = html_print_select(
true, true,
false, false,
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'); $table->data[2][1] = html_print_label_input_block(
$table->data[3][1] = html_print_extended_select_for_time('dynamic_interval', $dynamic_interval, '', 'None', '0', 10, true, 'width:150px', false); __('Interval'),
$table->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image( html_print_extended_select_for_time('module_interval', $module_interval, '', '', '0', false, true)
);
$dynamic_interval_img = '<a onclick="advanced_option_dynamic()" class="mrgn_lft_5px mrgn_top_6px">'.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( '<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[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',
$min_warning, $min_warning,
'', '',
5, 5,
15, 15,
true true
); ),
$table->data[4][1] .= '<br /><em>'.__('Max.').'</em>&nbsp;'; [
$table->data[4][1] .= html_print_input_text( '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',
$max_warning, $max_warning,
'', '',
5, 5,
15, 15,
true true
).'</span>'; ).'</div>',
$table->data[4][1] .= '<span id="string_warning"><em>'.__('Str.').' </em>&nbsp;'; [
$table->data[4][1] .= html_print_input_text( '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',
$str_warning, $str_warning,
'', '',
5, 5,
1024, 1024,
true true
).'</span>'; ).'</div>',
$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); 'label_class' => 'font-title-font',
$table->data[4][1] .= '</div>'; '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[4][1] .= '<div id="percentage_warning"><em>'.__('Percentage').'</em>'; $table->data[4][1] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
$table->data[4][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true); $table->rowspan[4][1] = 3;
$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][0] = html_print_label_input_block(
$table->data[5][1] .= html_print_input_text( __('Change to critical status after'),
'<div class="inline_flex align-center w100p">'.html_print_input_text(
'warning_time', 'warning_time',
$warning_time, $warning_time,
'', '',
5, 5,
15, 15,
true true
).'&nbsp;&nbsp;<b>'.__('intervals in warning status.').'</b>'.'</div>',
['div_id' => 'warning_time']
); );
$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->data[6][0] = html_print_label_input_block(
$table->colspan[4][2] = 2; __('Critical status'),
$table->rowspan[4][2] = 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.'),
$table->data[6][0] = __('Critical status'); html_print_input_text(
$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',
$min_critical, $min_critical,
'', '',
5, 5,
15, 15,
true true
); ),
$table->data[6][1] .= '<br /><em>'.__('Max.').'</em>&nbsp;'; [
$table->data[6][1] .= html_print_input_text( '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',
$max_critical, $max_critical,
'', '',
5, 5,
15, 15,
true true
).'</span>'; ).'</div>',
$table->data[6][1] .= '<span id="string_critical"><em>'.__('Str.').' </em>&nbsp;'; [
$table->data[6][1] .= html_print_input_text( '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',
$str_critical, $str_critical,
'', '',
5, 5,
1024, 1024,
true true
).'</span>'; ).'</div>',
$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); 'label_class' => 'font-title-font',
$table->data[6][1] .= '</div>'; '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[6][1] .= '<div id="percentage_critical"><em>'.__('Percentage').'</em>'; $table->colspan[7][0] = 2;
$table->data[6][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true); $table->data[7][0] = html_print_label_input_block(
$table->data[6][1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true); __('FF threshold'),
$table->data[6][1] .= '</div>'; '<div class="inline_flex align-center w100p">'.__('Keep counters').'&nbsp;&nbsp;'.html_print_checkbox(
$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', 'ff_type',
1, 1,
$ff_type, $ff_type,
true true
).'<br />'; ).'</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(
$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',
$ff_event, $ff_event,
'', '',
5, 5,
15, 15,
true true
).'<br />'; ).'<span class="w30px">&nbsp;</span>'.html_print_radio_button(
$table->data[7][1] .= html_print_radio_button(
'each_ff', 'each_ff',
1, 1,
'', '',
$each_ff, $each_ff,
true true
).' '.__('Each state changing').' : '; ).' <b>'.__('Each state changing').' :&nbsp;&nbsp;</b>'.__('To normal').html_print_input_text(
$table->data[7][1] .= __('To normal');
$table->data[7][1] .= html_print_input_text(
'ff_event_normal', 'ff_event_normal',
$ff_event_normal, $ff_event_normal,
'', '',
5, 5,
15, 15,
true true
).' '; ).' '.__('To warning').html_print_input_text(
$table->data[7][1] .= __('To warning');
$table->data[7][1] .= html_print_input_text(
'ff_event_warning', 'ff_event_warning',
$ff_event_warning, $ff_event_warning,
'', '',
5, 5,
15, 15,
true true
).' '; ).' '.__('To critical').html_print_input_text(
$table->data[7][1] .= __('To critical');
$table->data[7][1] .= html_print_input_text(
'ff_event_critical', 'ff_event_critical',
$ff_event_critical, $ff_event_critical,
'', '',
5, 5,
15, 15,
true true
).'</div>',
['div_id' => 'warning_time']
); );
$table->data[8][0] = __('Historical data'); $table->data[8][0] = html_print_label_input_block(
$table->data[8][1] = html_print_checkbox('history_data', 1, $history_data, true); __('Historical data'),
html_print_checkbox('history_data', 1, $history_data, true)
);
$table->data[9][0] = __('Min. Value'); $table->data[9][0] = html_print_label_input_block(
$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); __('Min. Value'),
$table->data[9][2] = __('Max. Value'); html_print_input_text('min', $min, '', 5, 15, true)
$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[9][1] = html_print_label_input_block(
$table->data[10][3] = html_print_checkbox( __('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', 'throw_unknown_events',
1, 1,
network_components_is_disable_type_event(($id === 0) ? false : $id, EVENTS_GOING_UNKNOWN), network_components_is_disable_type_event(($id === 0) ? false : $id, EVENTS_GOING_UNKNOWN),
true true
)
); );
$table->data[11][0] = __('Critical instructions').ui_print_help_tip(__('Instructions when the status is critical'), true); $table->data[11][0] = html_print_label_input_block(
$table->data[11][1] = html_print_textarea('critical_instructions', 2, 65, $critical_instructions, '', true); __('Critical instructions').ui_print_help_tip(__('Instructions when the status is critical'), true),
$table->colspan[11][1] = 3; html_print_textarea('critical_instructions', 2, 65, $critical_instructions, '', true)
);
$table->data[12][0] = __('Warning instructions').ui_print_help_tip(__('Instructions when the status is warning'), true); $table->data[11][1] = html_print_label_input_block(
$table->data[12][1] = html_print_textarea('warning_instructions', 2, 65, $warning_instructions, '', true); __('Warning instructions').ui_print_help_tip(__('Instructions when the status is warning'), true),
$table->colspan[12][1] = 3; html_print_textarea('warning_instructions', 2, 65, $warning_instructions, '', true)
);
$table->data[13][0] = __('Unknown instructions').ui_print_help_tip(__('Instructions when the status is unknown'), true); $table->data[12][0] = html_print_label_input_block(
$table->data[13][1] = html_print_textarea('unknown_instructions', 2, 65, $unknown_instructions, '', true); __('Unknown instructions').ui_print_help_tip(__('Instructions when the status is unknown'), true),
$table->colspan[13][1] = 3; html_print_textarea('unknown_instructions', 2, 65, $unknown_instructions, '', true)
);
$table->data[14][0] = __('Description'); $table->data[12][1] = html_print_label_input_block(
$table->data[14][1] = html_print_textarea('description', 2, 65, $description, '', true); __('Description'),
$table->colspan[14][1] = 3; html_print_textarea('description', 2, 65, $description, '', true)
);
$next_row = 15; $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,8 +478,10 @@ 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(
__('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 "SELECT name AS name1, name AS name2
FROM ttag FROM ttag
WHERE $tags_condition_not WHERE $tags_condition_not
@ -387,11 +497,23 @@ $table->data[$next_row][1] .= html_print_select_from_sql(
false, false,
'width: 200px', 'width: 200px',
'5' '5'
); ).'</div><div>'.html_print_image(
$table->data[$next_row][2] = html_print_image('images/darrowright.png', true, ['id' => 'right', 'title' => __('Add tags to module'), 'class' => 'invert_filter']); 'images/darrowright.png',
$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']); true,
$table->data[$next_row][3] = '<b>'.__('Tags selected').'</b><br>'; [
$table->data[$next_row][3] .= html_print_select_from_sql( '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 "SELECT name AS name1, name AS name2
FROM ttag FROM ttag
WHERE $tags_condition_in WHERE $tags_condition_in
@ -407,6 +529,7 @@ $table->data[$next_row][3] .= html_print_select_from_sql(
false, false,
'width: 200px', 'width: 200px',
'5' '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,8 +50,9 @@ $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'),
html_print_input_text_extended(
'target_ip', 'target_ip',
$target_ip, $target_ip,
'target_ip', 'target_ip',
@ -62,9 +63,12 @@ $data[1] = html_print_input_text_extended(
'', '',
'', '',
true true
)
); );
$data[2] = __('SNMP version');
$data[3] = html_print_select( $data[1] = html_print_label_input_block(
__('SNMP version'),
html_print_select(
$snmp_versions, $snmp_versions,
'snmp_version', 'snmp_version',
$snmp_version, $snmp_version,
@ -75,79 +79,105 @@ $data[3] = html_print_select(
false, false,
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( );
$data[1] = html_print_label_input_block(
__('SNMP community'),
html_print_input_text(
'snmp_community', 'snmp_community',
$snmp_community, $snmp_community,
'', '',
15, 15,
60, 60,
true 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'),
html_print_input_text(
'snmp_oid', 'snmp_oid',
$snmp_oid, $snmp_oid,
'', '',
30, 30,
400, 400,
true true
)
); );
$data[2] = __('Auth password');
$data[3] = html_print_input_password( $data[1] = html_print_label_input_block(
__('Auth password'),
html_print_input_password(
'snmp3_auth_pass', 'snmp3_auth_pass',
$snmp3_auth_pass, $snmp3_auth_pass,
'', '',
15, 15,
60, 60,
true,
false,
false,
'',
'off',
true true
); ).html_print_input_hidden_extended(
$data[3] .= html_print_input_hidden_extended(
'active_snmp_v3', 'active_snmp_v3',
0, 0,
'active_snmp_v3_mncfn', 'active_snmp_v3_mncfn',
true 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'),
html_print_input_text(
'snmp3_auth_user', 'snmp3_auth_user',
$snmp3_auth_user, $snmp3_auth_user,
'', '',
15, 15,
60, 60,
true true
)
); );
$data[2] = __('Privacy pass');
$data[3] = html_print_input_password( $data[1] = html_print_label_input_block(
__('Privacy pass'),
html_print_input_password(
'snmp3_privacy_pass', 'snmp3_privacy_pass',
$snmp3_privacy_pass, $snmp3_privacy_pass,
'', '',
15, 15,
60, 60,
true,
false,
false,
'',
'off',
true 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'), 'DES' => __('DES'),
'AES' => __('AES'), 'AES' => __('AES'),
@ -158,9 +188,12 @@ $data[1] = html_print_select(
'', '',
'', '',
true true
)
); );
$data[2] = __('Security level');
$data[3] = html_print_select( $data[1] = html_print_label_input_block(
__('Security level'),
html_print_select(
[ [
'noAuthNoPriv' => __('Not auth and not privacy method'), 'noAuthNoPriv' => __('Not auth and not privacy method'),
'authNoPriv' => __('Auth and not privacy method'), 'authNoPriv' => __('Auth and not privacy method'),
@ -172,13 +205,15 @@ $data[3] = html_print_select(
'', '',
'', '',
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'), 'MD5' => __('MD5'),
'SHA' => __('SHA'), 'SHA' => __('SHA'),
@ -189,9 +224,12 @@ $data[1] = html_print_select(
'', '',
'', '',
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').'&nbsp;'.ui_print_help_icon('xxx', true),
html_print_input_text_extended(
'name_oid', 'name_oid',
$name_oid, $name_oid,
'name_oid', 'name_oid',
@ -202,13 +240,15 @@ $data[3] = html_print_input_text_extended(
'', '',
'', '',
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'),
html_print_extended_select_for_post_process(
'post_process', 'post_process',
$post_process, $post_process,
'', '',
@ -218,28 +258,39 @@ $data[1] = html_print_extended_select_for_post_process(
true, true,
false, false,
true true
)
);
$data[1] = html_print_label_input_block(
'',
''
); );
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'),
html_print_input_text_extended(
'command_text', 'command_text',
$command_text, $command_text,
'command_text', 'command_text',
@ -250,15 +301,17 @@ $data[1] = html_print_input_text_extended(
'', '',
$largeClassDisabledBecauseInPolicy, $largeClassDisabledBecauseInPolicy,
true 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'),
html_print_select(
$array_credential_identifier, $array_credential_identifier,
'command_credential_identifier', 'command_credential_identifier',
$command_credential_identifier, $command_credential_identifier,
@ -270,6 +323,7 @@ $data[1] = html_print_select(
false, false,
'', '',
$disabledBecauseInPolicy $disabledBecauseInPolicy
)
); );
$array_os = [ $array_os = [
@ -278,8 +332,9 @@ $array_os = [
'windows' => __('Windows'), 'windows' => __('Windows'),
]; ];
$data[2] = __('Target OS'); $data[1] = html_print_label_input_block(
$data[3] = html_print_select( __('Target OS'),
html_print_select(
$array_os, $array_os,
'command_os', 'command_os',
$command_os, $command_os,
@ -291,6 +346,7 @@ $data[3] = html_print_select(
false, false,
'', '',
$disabledBecauseInPolicy $disabledBecauseInPolicy
)
); );
push_table_row($data, 'row-cmd-row-2'); push_table_row($data, 'row-cmd-row-2');

View File

@ -32,8 +32,9 @@ 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'),
html_print_select_from_sql(
'SELECT id, name FROM tplugin ORDER BY name', 'SELECT id, name FROM tplugin ORDER BY name',
'id_plugin', 'id_plugin',
$id_plugin, $id_plugin,
@ -42,12 +43,16 @@ $data[1] = html_print_select_from_sql(
0, 0,
true, true,
false, 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[2] = __('Post process');
$data[3] = html_print_extended_select_for_post_process( $data[1] = html_print_label_input_block(
__('Post process'),
html_print_extended_select_for_post_process(
'post_process', 'post_process',
$post_process, $post_process,
'', '',
@ -57,16 +62,19 @@ $data[3] = html_print_extended_select_for_post_process(
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

@ -62,8 +62,8 @@ function generateExtraFields($extra_fields, $protocol)
} }
$data = []; $data = [];
$data[0] = '<div class="right">'.$extraFieldText.'</div>'; $data[0] = '<div class="left">'.$extraFieldText.'</div>';
$data[1] = html_print_input_text_extended( $data[0] .= html_print_input_text_extended(
'extra_field_'.$protocol.'_'.$idField, 'extra_field_'.$protocol.'_'.$idField,
$field, $field,
'extra_field_'.$protocol.'_'.$idField, 'extra_field_'.$protocol.'_'.$idField,
@ -76,7 +76,7 @@ function generateExtraFields($extra_fields, $protocol)
true true
); );
$table->colspan['oid-list-'.$rowId.'-row-'.$idField][1] = 3; $data[1] = '';
push_table_row($data, 'oid-list-'.$rowId.'-row-'.$idField); push_table_row($data, 'oid-list-'.$rowId.'-row-'.$idField);
} }
@ -110,7 +110,7 @@ function generateExtraFields($extra_fields, $protocol)
'title' => __('Remove last macro oid'), 'title' => __('Remove last macro oid'),
'onclick' => 'manageComponentFields(\'del\', \'oid-list-'.$rowId.'\');', 'onclick' => 'manageComponentFields(\'del\', \'oid-list-'.$rowId.'\');',
'style' => 'margin-left: 1em;', 'style' => 'margin-left: 1em;',
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
), ),
], ],
@ -121,6 +121,7 @@ function generateExtraFields($extra_fields, $protocol)
[ [
'id' => 'combo_oid_button', 'id' => 'combo_oid_button',
'content' => $image_del.$image_add, 'content' => $image_del.$image_add,
'class' => 'combo-oid-button',
], ],
true true
); );
@ -234,18 +235,19 @@ $table->id = 'network_component';
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox'; $table->class = 'databox';
$table->style = []; $table->style = [];
$table->style[0] = 'font-weight: bold'; $table->style[0] = 'font-weight: bold;';
$table->style[2] = 'font-weight: bold'; $table->style[1] = 'font-weight: bold;';
$table->colspan = []; $table->colspan = [];
if (!enterprise_installed()) { if (!enterprise_installed()) {
$table->colspan[0][1] = 3; $data[1] = '';
} }
$table->data = []; $table->data = [];
$data = []; $data = [];
$data[0] = __('Enabled'); $data[0] = html_print_label_input_block(
$data[1] = html_print_checkbox_switch( __('Enabled'),
html_print_checkbox_switch(
'enabled', 'enabled',
1, 1,
$enabled, $enabled,
@ -253,10 +255,12 @@ $data[1] = html_print_checkbox_switch(
false, false,
'', '',
false false
)
); );
$data[2] = __('Add by default'); $data[1] = html_print_label_input_block(
$data[3] = html_print_checkbox_switch( __('Add by default'),
html_print_checkbox_switch(
'module_enabled', 'module_enabled',
1, 1,
$module_enabled, $module_enabled,
@ -264,13 +268,15 @@ $data[3] = html_print_checkbox_switch(
false, false,
'', '',
false false
)
); );
push_table_row($data, 'module-enable-row'); push_table_row($data, 'module-enable-row');
$data = []; $data = [];
$data[0] = __('Module name'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('Module name'),
html_print_input_text_extended(
'name', 'name',
$name, $name,
'name', 'name',
@ -281,10 +287,13 @@ $data[1] = html_print_input_text_extended(
'', '',
'', '',
true true
)
); );
$data[2] = __('Module protocol'); $type = 4;
$data[3] = html_print_select( $data[1] = html_print_label_input_block(
__('Module protocol'),
'<div class="inline_flex">'.html_print_select(
$module_protocol_list, $module_protocol_list,
'module_protocol', 'module_protocol',
$module_protocol, $module_protocol,
@ -301,22 +310,23 @@ $data[3] = html_print_select(
[ [
'title' => strtoupper($module_protocol).'&nbsp;'.__('Protocol'), 'title' => strtoupper($module_protocol).'&nbsp;'.__('Protocol'),
'class' => 'add_comments_button ', 'class' => 'add_comments_button ',
'style' => 'width: 18px;', 'style' => 'height: 25px;',
'id' => 'module_protocol_symbol', 'id' => 'module_protocol_symbol',
] ]
).html_print_input_hidden('type', $type, true).'</div>'
); );
$type = 4;
$data[4] = html_print_input_hidden('type', $type, true);
push_table_row($data, 'module-name-type-row'); push_table_row($data, 'module-name-type-row');
$data = []; $data = [];
$data[0] = html_print_label_input_block(
__('Name OID'),
html_print_input_text('name_oid', $name_oid, '', 50, 255, true)
);
$data[0] = __('Name OID'); $data[1] = html_print_label_input_block(
$data[1] = html_print_input_text('name_oid', $name_oid, '', 50, 255, true); __('Manufacturer ID'),
html_print_select_from_sql(
$data[2] = __('Manufacturer ID');
$data[3] = html_print_select_from_sql(
'SELECT manufacturer as `id`, manufacturer FROM tpen GROUP BY manufacturer', 'SELECT manufacturer as `id`, manufacturer FROM tpen GROUP BY manufacturer',
'manufacturer_id', 'manufacturer_id',
$manufacturer_id, $manufacturer_id,
@ -326,15 +336,17 @@ $data[3] = html_print_select_from_sql(
true, true,
false, false,
false, false,
'' false,
'width: 100%;'
)
); );
push_table_row($data, 'manufacturer-nameOID-snmpRow-row'); push_table_row($data, 'manufacturer-nameOID-snmpRow-row');
$data = []; $data = [];
$data[0] = html_print_label_input_block(
$data[0] = __('Module type'); __('Module type'),
$data[1] = html_print_select( html_print_select(
$module_type_list, $module_type_list,
'module_type', 'module_type',
$module_type, $module_type,
@ -345,10 +357,12 @@ $data[1] = html_print_select(
false, false,
false, false,
'' ''
)
); );
$data[2] = __('Component Group'); $data[1] = html_print_label_input_block(
$data[3] = html_print_select( __('Component Group'),
html_print_select(
$component_group_list, $component_group_list,
'id_group', 'id_group',
$id_group, $id_group,
@ -359,14 +373,15 @@ $data[3] = html_print_select(
false, false,
false, false,
'' ''
)
); );
push_table_row($data, 'moduleType-blockName-row'); push_table_row($data, 'moduleType-blockName-row');
$data = []; $data = [];
$data[0] = html_print_label_input_block(
$data[0] = __('Module unit'); __('Module unit'),
$data[1] = html_print_extended_select_for_unit( html_print_extended_select_for_unit(
'unit', 'unit',
$unit, $unit,
'', '',
@ -376,93 +391,181 @@ $data[1] = html_print_extended_select_for_unit(
true, true,
false, false,
false false
)
);
$data[1] = html_print_label_input_block(
'',
''
); );
push_table_row($data, 'moduleUnit-blockName-row'); push_table_row($data, 'moduleUnit-blockName-row');
$data = []; $data = [];
$data[0] = __('Warning'); $data[0] = html_print_label_input_block(
// Warning interval values. __('Warning status'),
$data[1] = '<span class="minmax_values" id="warning_minmax_values">'; '<div class="inline_flex align-center mrgn_top_10px"><div id="warning_minmax_values" class="inline_flex align-center">'.html_print_label_input_block(
$data[1] .= '<em>'.__('Min.').'</em>&nbsp;'; __('Min.'),
$data[1] .= html_print_input_text('min_warning', $min_warning, '', 5, 15, true); html_print_input_text(
$data[1] .= '<br /><em>'.__('Max.').'</em>&nbsp;'; 'min_warning',
$data[1] .= html_print_input_text('max_warning', $max_warning, '', 5, 15, true); $min_warning,
$data[1] .= '</span>'; '',
// Warning string values. 5,
$data[1] .= '<span class="string_values" id="warning_string_values"><em>'.__('String').' </em>&nbsp;'; 15,
$data[1] .= html_print_input_text('str_warning', $str_warning, '', 5, 1024, true).'</span>'; true
// Warning inverse values. ),
$data[1] .= '<div id="warning_inverse"><em>'.__('Inverse interval').'</em>&nbsp;'; [
$data[1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true); 'label_class' => 'font-title-font',
$data[1] .= '</div>'; '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']
);
$data[1] .= '<div id="percentage_warning"><em>'.__('Percentage').'</em>&nbsp;'; $data[1] = '<svg id="svg_dinamic" width="200" height="300"> </svg>';
$data[1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true); $table->rowspan['warning-svg-row'][1] = 3;
$data[1] .= html_print_checkbox('percentage_warning', 1, $percentage_warning, true);
$data[1] .= '</div>';
$data[2] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
$table->colspan['warning-svg-row'][2] = 2;
$table->rowspan['warning-svg-row'][2] = 3;
push_table_row($data, 'warning-svg-row'); push_table_row($data, 'warning-svg-row');
$data = []; $data = [];
$data[0] .= __('Change to critical status after'); $data[0] = html_print_label_input_block(
$data[1] .= html_print_input_text('warning_time', $warning_time, '', 5, 15, true); __('Change to critical status after'),
$data[1] .= '&nbsp;&nbsp;<b>'.__('intervals in warning status.').'</b>'; '<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']
);
$data[1] = '';
push_table_row($data, 'title-warning-time'); push_table_row($data, 'title-warning-time');
$data = []; $data = [];
$data[0] = __('Critical'); $data[0] = html_print_label_input_block(
// Critical interval values. __('Critical status'),
$data[1] = '<span class="minmax_values" id="critical_minmax_values">'; '<div class="inline_flex align-center mrgn_top_10px"><div id="minmax_critical" class="inline_flex align-center">'.html_print_label_input_block(
$data[1] .= '<em>'.__('Min.').'</em>&nbsp;'; __('Min.'),
$data[1] .= html_print_input_text( html_print_input_text(
'min_critical', 'min_critical',
$min_critical, $min_critical,
'', '',
5, 5,
15, 15,
true true
); ),
$data[1] .= '<br /><em>'.__('Max.').'</em>&nbsp;'; [
$data[1] .= html_print_input_text( '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',
$max_critical, $max_critical,
'', '',
5, 5,
15, 15,
true 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']
); );
$data[1] .= '</span>';
// Critical string values.
$data[1] .= '<span class="string_values" id="critical_string_values"><em>'.__('String').' </em>&nbsp;';
$data[1] .= html_print_input_text('str_critical', $str_critical, '', 5, 1024, true).'</span>';
// Critical inverse values.
$data[1] .= '<div id="critical_inverse"><em>'.__('Inverse interval').'</em>&nbsp;';
$data[1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true);
$data[1] .= '</div>';
$data[1] .= '<Ddiv id="percentage_critical"><em>'.__('Percentage').'</em>&nbsp;';
$data[1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true);
$data[1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true);
$data[1] .= '</div>';
push_table_row($data, 'critical-row'); push_table_row($data, 'critical-row');
$data = []; $data = [];
$data[0] = __('Description'); $data[0] = html_print_label_input_block(
$data[1] = html_print_textarea('description', 2, 65, $description, '', true); __('Description'),
$table->colspan['module-description-row'][1] = 3; html_print_textarea('description', 2, 65, $description, '', true)
);
$data[1] = '';
push_table_row($data, 'module-description-row'); push_table_row($data, 'module-description-row');
$data = []; $data = [];
$data[0] = __('Scan Type'); $data[0] = html_print_label_input_block(
$data[1] = html_print_select( __('Scan Type'),
html_print_select(
$scan_type_list, $scan_type_list,
'scan_type', 'scan_type',
$scan_type, $scan_type,
@ -473,10 +576,12 @@ $data[1] = html_print_select(
false, false,
false, false,
'' ''
)
); );
$data[2] = __('Execution type'); $data[1] = html_print_label_input_block(
$data[3] = html_print_select( __('Execution type'),
html_print_select(
$execution_type_list, $execution_type_list,
'execution_type', 'execution_type',
$execution_type, $execution_type,
@ -487,6 +592,7 @@ $data[3] = html_print_select(
false, false,
false, false,
'' ''
)
); );
push_table_row($data, 'scan-execution-row'); push_table_row($data, 'scan-execution-row');
@ -495,8 +601,9 @@ push_table_row($data, 'scan-execution-row');
// SNMP rows. // SNMP rows.
// //
$data = []; $data = [];
$data[0] = __('Value OID'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('Value OID'),
html_print_input_text_extended(
'value_oid', 'value_oid',
(string) $value, (string) $value,
'value_oid', 'value_oid',
@ -505,14 +612,17 @@ $data[1] = html_print_input_text_extended(
10000, 10000,
'', '',
'', '',
'', 'style="width: 100%; max-width: 100%;"',
true true
)
); );
$table->colspan['value-oid-networkRow-snmpRow'][1] = 3;
$data[1] = '';
push_table_row($data, 'value-oid-networkRow-snmpRow'); push_table_row($data, 'value-oid-networkRow-snmpRow');
$data = []; $data = [];
$data[0] = __('Macros OID'); $data[0] = __('Macros OID');
$data[1] = '';
push_table_row($data, 'title-oid-macros-pluginRow-snmpRow'); push_table_row($data, 'title-oid-macros-pluginRow-snmpRow');
@ -520,8 +630,9 @@ push_table_row($data, 'title-oid-macros-pluginRow-snmpRow');
generateExtraFields($macros, 'snmp'); generateExtraFields($macros, 'snmp');
$data = []; $data = [];
$data[0] = __('Value operation'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('Value operation'),
html_print_input_text_extended(
'value_operation_snmp', 'value_operation_snmp',
$macros->value_operation, $macros->value_operation,
'value_operation_snmp', 'value_operation_snmp',
@ -530,15 +641,17 @@ $data[1] = html_print_input_text_extended(
10000, 10000,
'', '',
'', '',
'', 'style="width: 100%; max-width: 100%;"',
true true
)
); );
$table->colspan['value-operation-pluginRow-snmpRow'][1] = 3; $data[1] = '';
push_table_row($data, 'value-operation-pluginRow-snmpRow'); push_table_row($data, 'value-operation-pluginRow-snmpRow');
$data = []; $data = [];
$data[0] = __('Satellite execution'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('Satellite execution'),
html_print_input_text_extended(
'satellite_execution_snmp', 'satellite_execution_snmp',
$macros->satellite_execution, $macros->satellite_execution,
'satellite_execution_snmp', 'satellite_execution_snmp',
@ -547,15 +660,17 @@ $data[1] = html_print_input_text_extended(
10000, 10000,
'', '',
'', '',
'', 'style="width: 100%; max-width: 100%;"',
true true
)
); );
$table->colspan['satellite-execution-pluginRow-snmpRow'][1] = 3; $data[1] = '';
push_table_row($data, 'satellite-execution-pluginRow-snmpRow'); push_table_row($data, 'satellite-execution-pluginRow-snmpRow');
$data = []; $data = [];
$data[0] = __('Server plugin'); $data[0] = html_print_label_input_block(
$data[1] = html_print_select( __('Server plugin'),
html_print_select(
$server_plugin_list, $server_plugin_list,
'server_plugin_snmp', 'server_plugin_snmp',
$macros->server_plugin, $macros->server_plugin,
@ -565,8 +680,13 @@ $data[1] = html_print_select(
true, true,
false, false,
false, false,
'' '',
).'&nbsp;&nbsp;&nbsp;<span id="selected_plugin_description_snmp"></span>'; false,
'width: 100%; max-width: 100%;'
).'&nbsp;&nbsp;&nbsp;<span id="selected_plugin_description_snmp"></span>'
);
$data[1] = '';
push_table_row($data, 'server-plugin-pluginRow-snmpRow'); push_table_row($data, 'server-plugin-pluginRow-snmpRow');
@ -592,8 +712,9 @@ push_table_row($data, 'plugin-snmp-fields-dynamicMacroRow-pluginRow-snmpRow-0');
// WMI Fields. // WMI Fields.
// //
$data = []; $data = [];
$data[0] = __('WMI class'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('WMI class'),
html_print_input_text_extended(
'wmi_class', 'wmi_class',
$wmi_class, $wmi_class,
'wmi_class', 'wmi_class',
@ -604,13 +725,16 @@ $data[1] = html_print_input_text_extended(
'', '',
'', '',
true true
)
); );
$table->colspan['wmi-class-wmiRow'][1] = 3;
$data[1] = '';
push_table_row($data, 'wmi-class-wmiRow'); push_table_row($data, 'wmi-class-wmiRow');
$data = []; $data = [];
$data[0] = __('Query key field').'&nbsp;(_field_wmi_0_)'; $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('Query key field').'&nbsp;(_field_wmi_0_)',
html_print_input_text_extended(
'query_key_field', 'query_key_field',
$query_key_field, $query_key_field,
'query_key_field', 'query_key_field',
@ -621,12 +745,15 @@ $data[1] = html_print_input_text_extended(
'', '',
'', '',
true true
)
); );
$table->colspan['query-key-field-wmiRow'][1] = 3;
$data[1] = '';
push_table_row($data, 'query-key-field-wmiRow'); push_table_row($data, 'query-key-field-wmiRow');
$data = []; $data = [];
$data[0] = __('Query extra fields'); $data[0] = __('Query extra fields');
$data[1] = '';
push_table_row($data, 'title-extra-field-wmiRow'); push_table_row($data, 'title-extra-field-wmiRow');
@ -635,13 +762,15 @@ generateExtraFields($macros, 'wmi');
$data = []; $data = [];
$data[0] = __('Query filters'); $data[0] = __('Query filters');
$data[1] = '';
$table->style[0] = 'font-weight: bold;'; $table->style[0] = 'font-weight: bold;';
push_table_row($data, 'title-query-filters-wmiRow'); push_table_row($data, 'title-query-filters-wmiRow');
$data = []; $data = [];
$data[0] = '<div class="right">'.__('Scan').'</div>'; $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('Scan'),
html_print_input_text_extended(
'query_filter_scan', 'query_filter_scan',
$query_filter['scan'], $query_filter['scan'],
'query_filter_scan', 'query_filter_scan',
@ -652,14 +781,17 @@ $data[1] = html_print_input_text_extended(
'', '',
'', '',
true true
)
); );
$table->colspan['query-filter-scan-wmiRow'][1] = 3;
$data[1] = '';
push_table_row($data, 'query-filter-scan-wmiRow'); push_table_row($data, 'query-filter-scan-wmiRow');
if ($execution_type == EXECUTION_TYPE_NETWORK) { if ($execution_type == EXECUTION_TYPE_NETWORK) {
$data = []; $data = [];
$data[0] = '<div class="right">'.__('Execution').'</div>'; $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('Execution'),
html_print_input_text_extended(
'query_filter_execution', 'query_filter_execution',
$query_filter['execution'], $query_filter['execution'],
'query_filter_execution', 'query_filter_execution',
@ -670,15 +802,18 @@ if ($execution_type == EXECUTION_TYPE_NETWORK) {
'', '',
'', '',
true true
)
); );
$table->colspan['query-filter-execution-wmiRow'][1] = 3;
$data[1] = '';
push_table_row($data, 'query-filter-execution-wmiRow'); push_table_row($data, 'query-filter-execution-wmiRow');
} }
$data = []; $data = [];
$data[0] = __('Field value'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_number( __('Field value'),
html_print_input_number(
[ [
'name' => 'field_value_filter', 'name' => 'field_value_filter',
'value' => $query_filter['field'], 'value' => $query_filter['field'],
@ -686,10 +821,12 @@ $data[1] = html_print_input_number(
'min' => 0, 'min' => 0,
'return' => true, 'return' => true,
] ]
)
); );
$data[2] = __('Key string'); $data[1] = html_print_label_input_block(
$data[3] = html_print_input_text_extended( __('Key string'),
html_print_input_text_extended(
'key_string_filter', 'key_string_filter',
$query_filter['key_string'], $query_filter['key_string'],
'key_string_filter', 'key_string_filter',
@ -700,13 +837,15 @@ $data[3] = html_print_input_text_extended(
'', '',
'', '',
true true
)
); );
push_table_row($data, 'filters-list-fields-networkRow-wmiRow'); push_table_row($data, 'filters-list-fields-networkRow-wmiRow');
$data = []; $data = [];
$data[0] = __('Value operation'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('Value operation'),
html_print_input_text_extended(
'value_operation_wmi', 'value_operation_wmi',
$macros->value_operation, $macros->value_operation,
'value_operation_wmi', 'value_operation_wmi',
@ -717,13 +856,15 @@ $data[1] = html_print_input_text_extended(
'', '',
'', '',
true true
)
); );
$table->colspan['value-operation-pluginRow-wmiRow'][1] = 3; $data[1] = '';
push_table_row($data, 'value-operation-pluginRow-wmiRow'); push_table_row($data, 'value-operation-pluginRow-wmiRow');
$data = []; $data = [];
$data[0] = __('Satellite execution'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text_extended( __('Satellite execution'),
html_print_input_text_extended(
'satellite_execution_wmi', 'satellite_execution_wmi',
$macros->satellite_execution, $macros->satellite_execution,
'satellite_execution_wmi', 'satellite_execution_wmi',
@ -734,13 +875,15 @@ $data[1] = html_print_input_text_extended(
'', '',
'', '',
true true
)
); );
$table->colspan['satellite-execution-pluginRow-wmiRow'][1] = 3; $data[1] = '';
push_table_row($data, 'satellite-execution-pluginRow-wmiRow'); push_table_row($data, 'satellite-execution-pluginRow-wmiRow');
$data = []; $data = [];
$data[0] = __('Server plugin'); $data[0] = html_print_label_input_block(
$data[1] = html_print_select( __('Server plugin'),
html_print_select(
$server_plugin_list, $server_plugin_list,
'server_plugin_wmi', 'server_plugin_wmi',
$macros->server_plugin, $macros->server_plugin,
@ -751,7 +894,9 @@ $data[1] = html_print_select(
false, false,
false, false,
'' ''
).'&nbsp;&nbsp;&nbsp;<span id="selected_plugin_description_wmi"></span>'; ).'&nbsp;&nbsp;&nbsp;<span id="selected_plugin_description_wmi"></span>'
);
$data[1] = '';
push_table_row($data, 'server-plugin-pluginRow-wmiRow'); push_table_row($data, 'server-plugin-pluginRow-wmiRow');

View File

@ -28,32 +28,60 @@ 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'),
html_print_extended_select_for_post_process(
'post_process', 'post_process',
$post_process, $post_process,
'', '',
@ -63,6 +91,7 @@ $data[1] = html_print_extended_select_for_post_process(
true, true,
false, false,
true 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;
}