Merge branch 'develop' into ent-12251-integracion-de-los-datos-de-seguridad-en-la-vista-ppal-de-agente

This commit is contained in:
Daniel Cebrian 2023-11-27 10:23:37 +01:00
commit 9be216f24e
6 changed files with 31 additions and 2 deletions

View File

@ -0,0 +1,5 @@
START TRANSACTION;
ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL;
COMMIT;

View File

@ -150,6 +150,7 @@ $fullscale = false;
$percentil = false;
$image_threshold = false;
$time_compare_overlapped = false;
$unknowns_graph = false;
// Added for events items.
$server_multiple = [0];
@ -354,6 +355,7 @@ switch ($action) {
$percentil = isset($style['percentil']) ? (bool) $style['percentil'] : 0;
$image_threshold = (isset($style['image_threshold']) === true) ? (bool) $style['image_threshold'] : false;
$graph_render = $item['graph_render'];
$unknowns_graph = $item['check_unknowns_graph'];
// The break hasn't be forgotten.
case 'simple_baseline_graph':
case 'projection_graph':
@ -2954,6 +2956,23 @@ if (is_metaconsole() === true) {
</td>
</tr>
<tr id="row_unknowns_graph" class="datos">
<td class="bolder">
<?php
echo __('Show unknowns in graph');
?>
</td>
<td>
<?php
html_print_checkbox_switch(
'unknowns_graph',
1,
$unknowns_graph
);
?>
</td>
</tr>
<tr id="row_time_compare_overlapped" class="datos">
<td class="bolder">
<?php
@ -6877,6 +6896,7 @@ function chooseType() {
$("#row_group_by").hide();
$("#row_type_show").hide();
$("#row_use_prefix_notation").hide();
$("#row_unknowns_graph").hide();
$("#row_os_selector").hide();
$("#row_os_version_regexp").hide();
$("#row_os_end_of_life").hide();
@ -6969,6 +6989,7 @@ function chooseType() {
$("#row_image_threshold").show();
$("#row_graph_render").show();
$("#row_percentil").show();
$("#row_unknowns_graph").show();
// Force type.
if('<?php echo $action; ?>' === 'new'){

View File

@ -1928,6 +1928,7 @@ switch ($action) {
$values['graph_render'] = (int) get_parameter(
'graph_render'
);
$values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0);
case 'simple_baseline_graph':
// HACK it is saved in show_graph field.
$values['show_graph'] = (int) get_parameter(
@ -2867,6 +2868,7 @@ switch ($action) {
$values['graph_render'] = (int) get_parameter(
'graph_render'
);
$values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0);
case 'simple_baseline_graph':
// HACK it is saved in show_graph field.
$values['show_graph'] = (int) get_parameter(

View File

@ -1745,7 +1745,7 @@ function html_print_select_multiple_modules_filtered(array $data):string
'label' => __('Agents'),
'label_class' => 'font-title-font',
'type' => 'select_from_sql',
'sql' => 'SELECT `id_agente`,`nombre` FROM tagente',
'sql' => 'SELECT `id_agente`,`alias` FROM tagente',
'name' => 'filtered-module-agents-'.$uniqId,
'selected' => explode(',', $data['mAgents']),
'return' => true,

View File

@ -11294,7 +11294,7 @@ function reporting_simple_graph(
),
'ttl' => $ttl,
'compare' => $time_compare_overlapped,
'show_unknown' => true,
'show_unknown' => $content['check_unknowns_graph'],
'percentil' => ($content['style']['percentil'] == 1) ? $config['percentil'] : null,
'fullscale' => $fullscale,
'server_id' => $id_meta,

View File

@ -1646,6 +1646,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
`cat_security_hardening` INT NOT NULL DEFAULT 0,
`ignore_skipped` INT NOT NULL DEFAULT 0,
`status_of_check` TINYTEXT,
`check_unknowns_graph` tinyint DEFAULT '0',
PRIMARY KEY(`id_rc`),
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
ON UPDATE CASCADE ON DELETE CASCADE