40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
document.addEventListener("DOMContentLoaded", function() {
|
|
const sidebarToggler = document.getElementById('sidebarCollapse');
|
|
const sidebar = document.getElementById('sidebar');
|
|
|
|
if (sidebarToggler && sidebar) {
|
|
sidebarToggler.addEventListener('click', function () {
|
|
sidebar.classList.toggle('active');
|
|
});
|
|
}
|
|
|
|
// Placeholder for dashboard chart
|
|
const ctx = document.getElementById('vulnerabilityChart');
|
|
if (ctx) {
|
|
new Chart(ctx, {
|
|
type: 'doughnut',
|
|
data: {
|
|
labels: ['Critical', 'High', 'Medium', 'Low'],
|
|
datasets: [{
|
|
label: 'Vulnerabilities',
|
|
data: [12, 19, 3, 5],
|
|
backgroundColor: [
|
|
'#e74c3c',
|
|
'#e67e22',
|
|
'#f1c40f',
|
|
'#2ecc71'
|
|
],
|
|
borderWidth: 1
|
|
}]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
maintainAspectRatio: false,
|
|
legend: {
|
|
position: 'bottom',
|
|
},
|
|
}
|
|
});
|
|
}
|
|
});
|