#11807 new report vulnerability by category
This commit is contained in:
parent
f871f4e4d0
commit
85de06fbec
|
@ -200,12 +200,10 @@ $text_agent_module = '';
|
|||
|
||||
$only_data = false;
|
||||
|
||||
$categories_security_hardening = [];
|
||||
if (security_hardening_installed() === true) {
|
||||
$categories_security_hardening = categories_of_cis();
|
||||
foreach ($categories_security_hardening as $key => $cat) {
|
||||
$categories_security_hardening[$key] = implode(' ', $cat);
|
||||
}
|
||||
|
||||
$categories_security_hardening = categories_of_cis();
|
||||
foreach ($categories_security_hardening as $key => $cat) {
|
||||
$categories_security_hardening[$key] = implode(' ', $cat);
|
||||
}
|
||||
|
||||
// Users.
|
||||
|
@ -1037,7 +1035,7 @@ switch ($action) {
|
|||
$group = $item['id_group'];
|
||||
$recursion = $item['recursion'];
|
||||
$cat_selected = $item['cat_security_hardening'];
|
||||
$ignore_skipped = ($item['ignore_skipped'] !== null) ? $item['ignore_skipped'] : true;
|
||||
$ignore_skipped = $item['ignore_skipped'];
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -3718,7 +3716,7 @@ $class = 'databox filters';
|
|||
html_print_checkbox_switch(
|
||||
'ignore_skipped',
|
||||
1,
|
||||
$ignore_skipped,
|
||||
($ignore_skipped !== null) ? $ignore_skipped : true,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
|
|
|
@ -1996,6 +1996,7 @@ switch ($action) {
|
|||
case 'vul_by_cat':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$values['cat_security_hardening'] = get_parameter('cat_security_hardening');
|
||||
$values['ignore_skipped'] = get_parameter('ignore_skipped');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
|
@ -2884,6 +2885,7 @@ switch ($action) {
|
|||
case 'vul_by_cat':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$values['cat_security_hardening'] = get_parameter('cat_security_hardening');
|
||||
$values['ignore_skipped'] = get_parameter('ignore_skipped');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
|
|
|
@ -32,6 +32,49 @@ class JavaScript extends Renderer
|
|||
if (empty($this->chart->defaults()->getWatermark()) === false) {
|
||||
$script[] = 'const chart_watermark_'.$this->chart->getId().' = {
|
||||
id: "chart_watermark_'.$this->chart->getId().'",
|
||||
beforeDraw: (chart) => {
|
||||
if (Object.prototype.hasOwnProperty.call(chart, "config") &&
|
||||
Object.prototype.hasOwnProperty.call(chart.config.options, "elements") &&
|
||||
Object.prototype.hasOwnProperty.call(chart.config.options.elements, "center"))
|
||||
{
|
||||
var ctx = chart.ctx;
|
||||
|
||||
ctx.save();
|
||||
|
||||
var centerConfig = chart.config.options.elements.center;
|
||||
var txt = centerConfig.text;
|
||||
var color = centerConfig.color || "#000";
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
var centerX = (chart.chartArea.left + chart.chartArea.right) / 2;
|
||||
var centerY = (chart.chartArea.top + chart.chartArea.bottom) / 2;
|
||||
|
||||
var outerRadius = Math.min(ctx.canvas.width, ctx.canvas.height) / 2;
|
||||
|
||||
var padding = 20;
|
||||
|
||||
var innerRadius = outerRadius - padding;
|
||||
|
||||
ctx.font = "30px ";
|
||||
var sidePaddingCalculated = (92/100) * (innerRadius * 2)
|
||||
|
||||
var stringWidth = ctx.measureText(txt).width;
|
||||
var elementWidth = (innerRadius * 2) - sidePaddingCalculated;
|
||||
|
||||
var widthRatio = elementWidth / stringWidth;
|
||||
var newFontSize = Math.floor(30 * widthRatio);
|
||||
var elementHeight = (innerRadius * 2);
|
||||
|
||||
var fontSizeToUse = Math.min(newFontSize, elementHeight);
|
||||
|
||||
ctx.font = fontSizeToUse + "px Lato, sans-serif";
|
||||
ctx.fillStyle = color;
|
||||
|
||||
ctx.fillText(txt, centerX, centerY);
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
},
|
||||
afterDraw: (chart) => {
|
||||
const image = new Image();
|
||||
image.src = "'.$this->chart->defaults()->getWatermark()->getSrc().'";
|
||||
|
|
Loading…
Reference in New Issue