Spaces:
Running
Running
Create a professional customer support analysis dashboard. Corporate blue and gray design. Include: sidebar with navigation, curved graph for ticket evolution, table of tickets (ID, status, priority), CSV/PDF export buttons, cards for key metrics (response time, resolution), and a functional search bar. - Initial Deployment
8f8bb99
verified
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Customer Support Analysis Dashboard</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| :root { | |
| --primary-blue: #1e3a8a; | |
| --secondary-blue: #3b82f6; | |
| --light-blue: #dbeafe; | |
| --dark-gray: #374151; | |
| --medium-gray: #9ca3af; | |
| --light-gray: #f3f4f6; | |
| } | |
| .gradient-bg { | |
| background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%); | |
| } | |
| .glass-effect { | |
| background: rgba(255, 255, 255, 0.1); | |
| backdrop-filter: blur(10px); | |
| border: 1px solid rgba(255, 255, 255, 0.2); | |
| } | |
| .hover-scale { | |
| transition: transform 0.3s ease; | |
| } | |
| .hover-scale:hover { | |
| transform: scale(1.02); | |
| } | |
| .animate-fade-in { | |
| animation: fadeIn 0.5s ease-in; | |
| } | |
| @keyframes fadeIn { | |
| from { opacity: 0; transform: translateY(20px); } | |
| to { opacity: 1; transform: translateY(0); } | |
| } | |
| .status-badge { | |
| padding: 4px 12px; | |
| border-radius: 20px; | |
| font-size: 12px; | |
| font-weight: 600; | |
| } | |
| .status-open { background-color: #fee2e2; color: #dc2626; } | |
| .status-in-progress { background-color: #fef3c7; color: #d97706; } | |
| .status-resolved { background-color: #d1fae5; color: #059669; } | |
| .priority-high { border-left: 4px solid #ef4444; } | |
| .priority-medium { border-left: 4px solid #f59e0b; } | |
| .priority-low { border-left: 4px solid #10b981; } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 font-sans"> | |
| <div class="flex h-screen"> | |
| <!-- Sidebar --> | |
| <aside class="w-64 bg-white shadow-lg"> | |
| <div class="p-6"> | |
| <div class="flex items-center space-x-3"> | |
| <div class="w-10 h-10 gradient-bg rounded-lg flex items-center justify-center"> | |
| <i class="fas fa-headset text-white"></i> | |
| </div> | |
| <h1 class="text-xl font-bold text-gray-800">SupportHub</h1> | |
| </div> | |
| </div> | |
| <nav class="mt-6"> | |
| <a href="#" class="flex items-center px-6 py-3 text-sm font-medium text-white gradient-bg"> | |
| <i class="fas fa-chart-line mr-3"></i> | |
| Dashboard | |
| </a> | |
| <a href="#" class="flex items-center px-6 py-3 text-sm font-medium text-gray-600 hover:bg-gray-50"> | |
| <i class="fas fa-ticket-alt mr-3"></i> | |
| Tickets | |
| </a> | |
| <a href="#" class="flex items-center px-6 py-3 text-sm font-medium text-gray-600 hover:bg-gray-50"> | |
| <i class="fas fa-users mr-3"></i> | |
| Agents | |
| </a> | |
| <a href="#" class="flex items-center px-6 py-3 text-sm font-medium text-gray-600 hover:bg-gray-50"> | |
| <i class="fas fa-cog mr-3"></i> | |
| Settings | |
| </a> | |
| </nav> | |
| </aside> | |
| <!-- Main Content --> | |
| <main class="flex-1 overflow-y-auto"> | |
| <!-- Header --> | |
| <header class="bg-white shadow-sm"> | |
| <div class="px-8 py-4 flex items-center justify-between"> | |
| <div> | |
| <h2 class="text-2xl font-bold text-gray-800">Customer Support Analytics</h2> | |
| <p class="text-sm text-gray-600 mt-1">Monitor and analyze support performance</p> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <div class="relative"> | |
| <input type="text" id="searchInput" placeholder="Search tickets..." | |
| class="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:border-blue-500"> | |
| <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i> | |
| </div> | |
| <button onclick="exportCSV()" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition"> | |
| <i class="fas fa-download mr-2"></i>CSV | |
| </button> | |
| <button onclick="exportPDF()" class="px-4 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700 transition"> | |
| <i class="fas fa-file-pdf mr-2"></i>PDF | |
| </button> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Dashboard Content --> | |
| <div class="p-8"> | |
| <!-- Metrics Cards --> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8"> | |
| <div class="bg-white p-6 rounded-xl shadow-lg hover-scale animate-fade-in"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-sm font-medium text-gray-600">Total Tickets</p> | |
| <p class="text-3xl font-bold text-gray-800">1,247</p> | |
| <p class="text-sm text-green-600 mt-1"> | |
| <i class="fas fa-arrow-up"></i> 12% from last month | |
| </p> | |
| </div> | |
| <div class="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center"> | |
| <i class="fas fa-ticket-alt text-blue-600 text-xl"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white p-6 rounded-xl shadow-lg hover-scale animate-fade-in"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-sm font-medium text-gray-600">Avg Response Time</p> | |
| <p class="text-3xl font-bold text-gray-800">2.4 hrs</p> | |
| <p class="text-sm text-red-600 mt-1"> | |
| <i class="fas fa-arrow-up"></i> 0.3 hrs from last week | |
| </p> | |
| </div> | |
| <div class="w-12 h-12 bg-green-100 rounded-lg flex items-center justify-center"> | |
| <i class="fas fa-clock text-green-600 text-xl"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white p-6 rounded-xl shadow-lg hover-scale animate-fade-in"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-sm font-medium text-gray-600">Resolution Rate</p> | |
| <p class="text-3xl font-bold text-gray-800">89.7%</p> | |
| <p class="text-sm text-green-600 mt-1"> | |
| <i class="fas fa-arrow-up"></i> 3.2% improvement | |
| </p> | |
| </div> | |
| <div class="w-12 h-12 bg-purple-100 rounded-lg flex items-center justify-center"> | |
| <i class="fas fa-check-circle text-purple-600 text-xl"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white p-6 rounded-xl shadow-lg hover-scale animate-fade-in"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-sm font-medium text-gray-600">CSAT Score</p> | |
| <p class="text-3xl font-bold text-gray-800">4.7/5</p> | |
| <p class="text-sm text-green-600 mt-1"> | |
| <i class="fas fa-arrow-up"></i> 0.2 from last month | |
| </p> | |
| </div> | |
| <div class="w-12 h-12 bg-yellow-100 rounded-lg flex items-center justify-center"> | |
| <i class="fas fa-star text-yellow-600 text-xl"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Chart --> | |
| <div class="bg-white p-6 rounded-xl shadow-lg mb-8"> | |
| <h3 class="text-lg font-semibold text-gray-800 mb-4">Ticket Evolution</h3> | |
| <canvas id="ticketChart" height="100"></canvas> | |
| </div> | |
| <!-- Tickets Table --> | |
| <div class="bg-white rounded-xl shadow-lg"> | |
| <div class="p-6 border-b"> | |
| <h3 class="text-lg font-semibold text-gray-800">Recent Tickets</h3> | |
| </div> | |
| <div class="overflow-x-auto"> | |
| <table class="w-full" id="ticketsTable"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Subject</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Priority</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Assigned To</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Created</th> | |
| </tr> | |
| </thead> | |
| <tbody id="ticketsTableBody" class="bg-white divide-y divide-gray-200"> | |
| <!-- Data will be populated by JavaScript --> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| </div> | |
| <script> | |
| // Sample data | |
| const ticketsData = [ | |
| { id: 'TCK-001', subject: 'Login issue with 2FA', status: 'open', priority: 'high', assigned: 'John Doe', created: '2024-01-15' }, | |
| { id: 'TCK-002', subject: 'Billing discrepancy', status: 'in-progress', priority: 'medium', assigned: 'Jane Smith', created: '2024-01-14' }, | |
| { id: 'TCK-003', subject: 'Feature request: Dark mode', status: 'resolved', priority: 'low', assigned: 'Mike Johnson', created: '2024-01-13' }, | |
| { id: 'TCK-004', subject: 'API rate limit exceeded', status: 'open', priority: 'high', assigned: 'Sarah Wilson', created: '2024-01-15' }, | |
| { id: 'TCK-005', subject: 'Mobile app crashes', status: 'in-progress', priority: 'medium', assigned: 'Tom Brown', created: '2024-01-12' } | |
| ]; | |
| // Initialize dashboard | |
| function initDashboard() { | |
| renderTicketsTable(ticketsData); | |
| initChart(); | |
| } | |
| // Render tickets table | |
| function renderTicketsTable(data) { | |
| const tbody = document.getElementById('ticketsTableBody'); | |
| tbody.innerHTML = ''; | |
| data.forEach(ticket => { | |
| const tr = document.createElement('tr'); | |
| tr.className = 'hover:bg-gray-50'; | |
| tr.innerHTML = ` | |
| <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${ticket.id}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">${ticket.subject}</td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="status-badge status-${ticket.status}">${ticket.status}</span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <div class="priority-${ticket.priority} pl-4">${ticket.priority}</div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">${ticket.assigned}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${ticket.created}</td> | |
| `; | |
| tbody.appendChild(tr); | |
| }); | |
| } | |
| // Initialize chart | |
| function initChart() { | |
| const ctx = document.getElementById('ticketChart').getContext('2d'); | |
| new Chart(ctx, { | |
| type: 'line', | |
| data: { | |
| labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'], | |
| datasets: [{ | |
| label: 'Open Tickets', | |
| data: [65, 59, 80, 81, 56, 55], | |
| borderColor: '#3b82f6', | |
| backgroundColor: 'rgba(59, 130, 246, 0.1)', | |
| tension: 0.4, | |
| fill: true | |
| }, { | |
| label: 'Resolved Tickets', | |
| data: [28, 48, 40, 19, 86, 27], | |
| borderColor: '#10b981', | |
| backgroundColor: 'rgba(16, 185, 129, 0.1)', | |
| tension: 0.4, | |
| fill: true | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| plugins: { | |
| legend: { | |
| position: 'top', | |
| } | |
| }, | |
| scales: { | |
| y: { | |
| beginAtZero: true | |
| } | |
| } | |
| } | |
| }); | |
| } | |
| // Search functionality | |
| document.getElementById('searchInput').addEventListener('input', function(e) { | |
| const searchTerm = e.target.value.toLowerCase(); | |
| const filteredData = ticketsData.filter(ticket => | |
| ticket.id.toLowerCase().includes(searchTerm) || | |
| ticket.subject.toLowerCase().includes(searchTerm) || | |
| ticket.status.toLowerCase().includes(searchTerm) || | |
| ticket.priority.toLowerCase().includes(searchTerm) | |
| ); | |
| renderTicketsTable(filteredData); | |
| }); | |
| // Export functions | |
| function exportCSV() { | |
| const csvContent = "data:text/csv;charset=utf-8," | |
| + "ID,Subject,Status,Priority,Assigned To,Created\n" | |
| + ticketsData.map(t => `${t.id},${t.subject},${t.status},${t.priority},${t.assigned},${t.created}`).join("\n"); | |
| const link = document.createElement("a"); | |
| link.setAttribute("href", encodeURI(csvContent)); | |
| link.setAttribute("download", "tickets.csv"); | |
| document.body.appendChild(link); | |
| link.click(); | |
| document.body.removeChild(link); | |
| } | |
| function exportPDF() { | |
| const { jsPDF } = window.jspdf; | |
| const doc = new jsPDF(); | |
| doc.setFontSize(16); | |
| doc.text("Support Tickets Report", 20, 20); | |
| let y = 40; | |
| ticketsData.forEach(ticket => { | |
| doc.setFontSize(12); | |
| doc.text(`${ticket.id} - ${ticket.subject}`, 20, y); | |
| doc.text(`Status: ${ticket.status}`, 20, y + 10); | |
| doc.text(`Priority: ${ticket.priority}`, 20, y + 20); | |
| y += 30; | |
| }); | |
| doc.save("tickets-report.pdf"); | |
| } | |
| // Initialize dashboard on load | |
| initDashboard(); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Ai-ethic/website-theme" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |