database-sentinel-ai / dashboard.html
Kenzoo1's picture
finsish the incomplete work
dcca700 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard | AnomalyNinja</title>
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body class="bg-gray-900 text-white">
<custom-navbar></custom-navbar>
<main class="container mx-auto px-4 py-8">
<div class="max-w-7xl mx-auto">
<h1 class="text-3xl font-bold mb-8">Security Dashboard</h1>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<div class="bg-gray-800 rounded-xl p-6 shadow-lg border-l-4 border-red-500">
<div class="flex justify-between items-start">
<div>
<h2 class="text-xl font-semibold mb-1">Critical Threats</h2>
<p class="text-3xl font-bold">12</p>
</div>
<i data-feather="alert-triangle" class="w-8 h-8 text-red-500"></i>
</div>
<div class="mt-4 text-sm text-gray-400">+3 from yesterday</div>
</div>
<div class="bg-gray-800 rounded-xl p-6 shadow-lg border-l-4 border-yellow-500">
<div class="flex justify-between items-start">
<div>
<h2 class="text-xl font-semibold mb-1">Warnings</h2>
<p class="text-3xl font-bold">28</p>
</div>
<i data-feather="alert-circle" class="w-8 h-8 text-yellow-500"></i>
</div>
<div class="mt-4 text-sm text-gray-400">-5 from yesterday</div>
</div>
<div class="bg-gray-800 rounded-xl p-6 shadow-lg border-l-4 border-blue-500">
<div class="flex justify-between items-start">
<div>
<h2 class="text-xl font-semibold mb-1">Protected</h2>
<p class="text-3xl font-bold">143</p>
</div>
<i data-feather="shield" class="w-8 h-8 text-blue-500"></i>
</div>
<div class="mt-4 text-sm text-gray-400">All systems</div>
</div>
<div class="bg-gray-800 rounded-xl p-6 shadow-lg border-l-4 border-green-500">
<div class="flex justify-between items-start">
<div>
<h2 class="text-xl font-semibold mb-1">Prevented</h2>
<p class="text-3xl font-bold">96%</p>
</div>
<i data-feather="check-circle" class="w-8 h-8 text-green-500"></i>
</div>
<div class="mt-4 text-sm text-gray-400">Attack success rate</div>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8 mb-8">
<div class="lg:col-span-2 bg-gray-800 rounded-xl p-6 shadow-lg">
<h2 class="text-2xl font-semibold mb-4">Threat Activity Timeline</h2>
<canvas id="timelineChart" height="250"></canvas>
</div>
<div class="bg-gray-800 rounded-xl p-6 shadow-lg">
<h2 class="text-2xl font-semibold mb-4">Threat Distribution</h2>
<div class="h-64">
<canvas id="threatChart"></canvas>
</div>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<div class="bg-gray-800 rounded-xl p-6 shadow-lg">
<h2 class="text-2xl font-semibold mb-4">Recent Alerts</h2>
<div class="space-y-4">
<div class="flex items-start gap-4 p-4 bg-gray-700/50 rounded-lg">
<div class="p-2 bg-red-500/20 rounded-full">
<i data-feather="alert-triangle" class="w-5 h-5 text-red-500"></i>
</div>
<div class="flex-1">
<div class="flex justify-between">
<h3 class="font-medium">SQL Injection Attempt</h3>
<span class="text-xs text-red-300">5 min ago</span>
</div>
<p class="text-sm text-gray-400 mt-1">Detected on production-db-01</p>
</div>
</div>
<div class="flex items-start gap-4 p-4 bg-gray-700/50 rounded-lg">
<div class="p-2 bg-yellow-500/20 rounded-full">
<i data-feather="alert-circle" class="w-5 h-5 text-yellow-500"></i>
</div>
<div class="flex-1">
<div class="flex justify-between">
<h3 class="font-medium">Unusual Data Export</h3>
<span class="text-xs text-yellow-300">27 min ago</span>
</div>
<p class="text-sm text-gray-400 mt-1">User exported 12MB customer data</p>
</div>
</div>
<div class="flex items-start gap-4 p-4 bg-gray-700/50 rounded-lg">
<div class="p-2 bg-purple-500/20 rounded-full">
<i data-feather="alert-octagon" class="w-5 h-5 text-purple-500"></i>
</div>
<div class="flex-1">
<div class="flex justify-between">
<h3 class="font-medium">Performance Degradation</h3>
<span class="text-xs text-purple-300">1 hour ago</span>
</div>
<p class="text-sm text-gray-400 mt-1">Query response time increased by 300%</p>
</div>
</div>
</div>
</div>
<div class="bg-gray-800 rounded-xl p-6 shadow-lg">
<h2 class="text-2xl font-semibold mb-4">Top Attack Sources</h2>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-700">
<thead>
<tr>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">IP Address</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Location</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Count</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-700">
<tr>
<td class="px-4 py-3">185.143.223.67</td>
<td class="px-4 py-3">Russia</td>
<td class="px-4 py-3">42</td>
</tr>
<tr>
<td class="px-4 py-3">203.113.167.12</td>
<td class="px-4 py-3">Vietnam</td>
<td class="px-4 py-3">28</td>
</tr>
<tr>
<td class="px-4 py-3">91.234.116.19</td>
<td class="px-4 py-3">Bulgaria</td>
<td class="px-4 py-3">19</td>
</tr>
<tr>
<td class="px-4 py-3">45.227.253.109</td>
<td class="px-4 py-3">Brazil</td>
<td class="px-4 py-3">15</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
<custom-footer></custom-footer>
<script src="components/navbar.js"></script>
<script src="components/footer.js"></script>
<script src="script.js"></script>
<script>
feather.replace();
// Timeline Chart
const timelineCtx = document.getElementById('timelineChart').getContext('2d');
const timelineChart = new Chart(timelineCtx, {
type: 'line',
data: {
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
datasets: [
{
label: 'SQL Injection',
data: [12, 19, 8, 15, 12, 8, 5],
borderColor: '#a855f7',
backgroundColor: 'rgba(168, 85, 247, 0.1)',
borderWidth: 2,
fill: true
},
{
label: 'Access Anomalies',
data: [8, 12, 5, 9, 15, 6, 3],
borderColor: '#3b82f6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
borderWidth: 2,
fill: true
},
{
label: 'Data Exfiltration',
data: [5, 8, 12, 6, 9, 4, 2],
borderColor: '#ef4444',
backgroundColor: 'rgba(239, 68, 68, 0.1)',
borderWidth: 2,
fill: true
}
]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
},
},
scales: {
y: {
beginAtZero: true
}
}
}
});
// Threat Chart
const threatCtx = document.getElementById('threatChart').getContext('2d');
const threatChart = new Chart(threatCtx, {
type: 'doughnut',
data: {
labels: ['SQL Injection', 'Access Anomalies', 'Data Exfiltration', 'Performance'],
datasets: [{
data: [35, 28, 22, 15],
backgroundColor: [
'#a855f7',
'#3b82f6',
'#ef4444',
'#10b981'
],
borderWidth: 0
}]
},
options: {
plugins: {
legend: {
position: 'right'
}
},
cutout: '70%',
maintainAspectRatio: false
</script>
</body>
</html>