Skip to content

Commit

Permalink
chg: [website] Improved dynamic rendering of the bar charts for sight…
Browse files Browse the repository at this point in the history
…ings.
  • Loading branch information
cedricbonhomme committed Oct 16, 2024
1 parent dec93bf commit 7f19b6c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions website/web/templates/vuln.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ <h5>Tags</h5>
<div class="spinner-border" role="status"><span class="sr-only">Loading...</span></div>
</div>
</div>
<div class="chart-container">
<div id="sightingsChartContainer" class="chart-container">
<canvas id="sightingsChart" height="400"></canvas>
</div>
<div id="chart-detailed-legend" class="row">
Expand Down Expand Up @@ -687,10 +687,12 @@ <h5>Tags</h5>
document.getElementById("chart-sightings").innerHTML = "<p>Sightings referring to this vulnerability.</p>";
if (result.metadata.count == 0) {
document.getElementById("chart-sightings").innerHTML = "<p>No sightings for this vulnerability.</p>";
document.getElementById("sightingsChart").remove();
document.getElementById("chart-detailed-legend").remove();
document.getElementById("sightingsChartContainer").style.display = 'none';
document.getElementById("chart-detailed-legend").style.display = 'none';
} else{
drawBarChart(result.data);
document.getElementById("sightingsChartContainer").style.display = 'block';
document.getElementById("chart-detailed-legend").style.display = 'block';
}
})
.catch((error) => {
Expand Down

0 comments on commit 7f19b6c

Please sign in to comment.