Spaces:
Running
Running
File size: 4,484 Bytes
d415323 5e61e8f d415323 7259767 d415323 7259767 d415323 7259767 d415323 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reports | RapidAction</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://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="components/navbar.js"></script>
<script src="components/notification-bell.js"></script>
</head>
<body class="bg-gray-100 min-h-screen">
<custom-navbar></custom-navbar>
<main class="container mx-auto px-4 py-8">
<div class="flex justify-between items-center mb-8">
<h1 class="text-3xl font-bold text-gray-800">Reports</h1>
<div class="flex space-x-4">
<custom-notification-bell></custom-notification-bell>
<button id="exportReportsBtn" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center space-x-2 transition-colors">
<i data-feather="download"></i>
<span>Export Report</span>
</button>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="bg-white p-6 rounded-lg shadow">
<h2 class="text-xl font-semibold mb-4">Tickets by Status</h2>
<canvas id="statusChart" height="300"></canvas>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<h2 class="text-xl font-semibold mb-4">Tickets by Priority</h2>
<canvas id="priorityChart" height="300"></canvas>
</div>
<div class="bg-white p-6 rounded-lg shadow md:col-span-2">
<h2 class="text-xl font-semibold mb-4">Tickets Over Time</h2>
<canvas id="timelineChart" height="300"></canvas>
</div>
</div>
</main>
<script src="script.js"></script>
<script>
feather.replace();
// Initialize charts and export functionality
document.getElementById('exportReportsBtn')?.addEventListener('click', exportReports);
document.addEventListener('DOMContentLoaded', () => {
// Status Chart
const statusCtx = document.getElementById('statusChart').getContext('2d');
new Chart(statusCtx, {
type: 'doughnut',
data: {
labels: ['Open', 'In Progress', 'Resolved'],
datasets: [{
data: [12, 8, 20],
backgroundColor: [
'#f59e0b',
'#3b82f6',
'#10b981'
]
}]
}
});
// Priority Chart
const priorityCtx = document.getElementById('priorityChart').getContext('2d');
new Chart(priorityCtx, {
type: 'pie',
data: {
labels: ['High', 'Medium', 'Low'],
datasets: [{
data: [5, 15, 20],
backgroundColor: [
'#ef4444',
'#f97316',
'#22c55e'
]
}]
}
});
// Timeline Chart
const timelineCtx = document.getElementById('timelineChart').getContext('2d');
new Chart(timelineCtx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Tickets Created',
data: [5, 8, 12, 6, 9, 15, 10, 7, 11, 14, 18, 22],
borderColor: '#3b82f6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
fill: true,
tension: 0.3
}]
},
options: {
responsive: true,
scales: {
y: {
beginAtZero: true
}
}
}
});
});
</script>
</body>
</html> |