diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index 302bd7f5b2..1a67873625 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -211,7 +211,7 @@ ALTER TABLE `tagente` ADD COLUMN `vul_scan_interval` INT NOT NULL DEFAULT 300; CREATE TABLE IF NOT EXISTS `pandora_cve` ( `cve_id` VARCHAR(20), `cvss_score` DECIMAL(5, 2), - `cvss_vector` VARCHAR(50), + `cvss_vector` VARCHAR(255), PRIMARY KEY (`cve_id`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 794314ce2d..2de546ee55 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -1237,20 +1237,35 @@ function get_build_setup_charts($type, $options, $data) break; case 'BAR': - $setData->setLabel('data')->setBackgroundColor($colors); - $setData->setLabel('data')->setBorderColor($borders); - $setData->setLabel('data')->setBorderWidth(2); - - if ($chart->options()->getScales()->getX()->isStacked() === true) { + if (isset($options['multiple']) === true && empty($options['multiple']) === false) { + $i = 0; + foreach ($options['multiple'] as $key_label => $label) { + $dataSet = $chart->createDataSet(); + $dataSet->setLabel($label); + $dataSet->setBackgroundColor($colors[$i]); + $dataSet->setBorderColor($borders[$i]); + $dataSet->setBorderWidth(2); + $dataSet->data()->exchangeArray(array_values($data[$key_label])); + $chart->addDataSet($dataSet); + $i++; + } + } else if ($chart->options()->getScales()->getX()->isStacked() === true) { + $i = 0; foreach ($data as $key => $dataset) { - $dataSet1 = $chart->createDataSet(); - $dataSet1->setBackgroundColor($dataset['backgroundColor']); - $dataSet1->setLabel($dataset['label']); - $dataSet1->data()->exchangeArray($dataset['data']); - $dataSet1->setStack($dataset['stack']); - $chart->addDataSet($dataSet1); + $dataSet1 = $chart->createDataSet(); + $dataSet1->setBackgroundColor($colors[$i]); + $dataSet1->setBorderColor($borders[$i]); + $dataSet1->setLabel($dataset['label']); + $dataSet1->setBorderWidth(2); + $dataSet1->data()->exchangeArray($dataset['data']); + $dataSet1->setStack($dataset['stack']); + $chart->addDataSet($dataSet1); + $i++; } } else { + $setData->setLabel('data')->setBackgroundColor($colors); + $setData->setLabel('data')->setBorderColor($borders); + $setData->setLabel('data')->setBorderWidth(2); $setData->setLabel('data')->data()->exchangeArray(array_values($data)); } @@ -1300,7 +1315,11 @@ function get_build_setup_charts($type, $options, $data) break; } - if ($type !== 'RADAR' && $type !== 'LINE' && $stacked !== true) { + if ($type !== 'RADAR' + && $type !== 'LINE' + && $stacked === false + && (isset($options['multiple']) === false || empty($options['multiple']) === true) + ) { $chart->addDataSet($setData); } diff --git a/pandora_console/include/styles/vulnerabilities.css b/pandora_console/include/styles/vulnerabilities.css index 0aa0ff1f86..0f60fb9078 100644 --- a/pandora_console/include/styles/vulnerabilities.css +++ b/pandora_console/include/styles/vulnerabilities.css @@ -70,12 +70,17 @@ margin-bottom: 45px; } +#reach-metrics .row-graphs { + max-width: 100%; +} + #score-bar { max-width: 85%; margin: 0 auto; } #bar { height: 100%; + animation: load 2s; } .marks { color: #9f9f9f; @@ -111,7 +116,10 @@ color: #0000008c; margin-left: 13px; } - +.dt-buttons { + display: flex; + margin: 10px; +} #content-bar { border: 1px solid #d7d7d7; width: 100%; @@ -136,3 +144,12 @@ width: 80%; } } + +@keyframes load { + from { + width: 0%; + } + to { + width: 100%; + } +} diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index cd3f274e99..f99e963e92 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -4422,6 +4422,6 @@ PRIMARY KEY (`id`) CREATE TABLE IF NOT EXISTS `pandora_cve` ( `cve_id` VARCHAR(20), `cvss_score` DECIMAL(5, 2), - `cvss_vector` VARCHAR(50), + `cvss_vector` VARCHAR(255), PRIMARY KEY (`cve_id`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; \ No newline at end of file