Spaces:
Running
Running
Download export.html from WinLanEm/devpulse-radar: direct link, hf CLI and curl.
- Browser
- Download file 10.3 kB
-
https://huggingface.co/spaces/WinLanEm/devpulse-radar/resolve/main/export.html
- Command line
-
hf download hf://spaces/WinLanEm/devpulse-radar/export.html
-
curl -L -o export.html https://huggingface.co/spaces/WinLanEm/devpulse-radar/resolve/main/export.html
10.3 kB
| <html lang="en" class="dark"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Export Report | DevPulse Radar</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script> | |
| <style> | |
| .card-glass { | |
| backdrop-filter: blur(10px); | |
| background: rgba(255, 255, 255, 0.1); | |
| border: 1px solid rgba(255, 255, 255, 0.1); | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-900 text-gray-100 min-h-screen"> | |
| <div class="flex h-screen"> | |
| <!-- Sidebar --> | |
| <nav class="w-64 bg-gray-800 border-r border-gray-700 hidden md:block"> | |
| <div class="p-4 border-b border-gray-700"> | |
| <div class="flex items-center space-x-2"> | |
| <i data-feather="activity" class="text-primary w-6 h-6"></i> | |
| <span class="text-xl font-bold">DevPulse Radar</span> | |
| </div> | |
| </div> | |
| <div class="p-4"> | |
| <ul class="space-y-2"> | |
| <li> | |
| <a href="dashboard.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition"> | |
| <i data-feather="home" class="w-5 h-5"></i> | |
| <span>Dashboard</span> | |
| </a> | |
| </li> | |
| <li> | |
| <a href="export.html" class="flex items-center space-x-3 px-3 py-2 bg-gray-700 rounded-lg text-primary"> | |
| <i data-feather="download" class="w-5 h-5"></i> | |
| <span>Export Report</span> | |
| </a> | |
| </li> | |
| <li> | |
| <a href="allactivities.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition"> | |
| <i data-feather="list" class="w-5 h-5"></i> | |
| <span>All Activities</span> | |
| </a> | |
| </li> | |
| </ul> | |
| </div> | |
| </nav> | |
| <!-- Main Content --> | |
| <div class="flex-1 overflow-auto"> | |
| <header class="sticky top-0 z-10 bg-gray-800 border-b border-gray-700 p-4"> | |
| <div class="flex justify-between items-center"> | |
| <h1 class="text-xl font-bold">Export Activity Report</h1> | |
| <div class="flex items-center space-x-2"> | |
| <div class="w-8 h-8 rounded-full bg-primary flex items-center justify-center"> | |
| <span class="text-sm font-medium">JD</span> | |
| </div> | |
| </div> | |
| </div> | |
| </header> | |
| <main class="p-6"> | |
| <div class="card-glass rounded-xl p-6 mb-6"> | |
| <h2 class="text-xl font-bold mb-4">Generate PDF Report</h2> | |
| <p class="text-gray-300 mb-6">Select filters and download your developer activities or achievements as a PDF report.</p> | |
| <form id="exportForm" class="space-y-4"> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-4"> | |
| <div> | |
| <label for="startDate" class="block text-sm font-medium mb-1">Start Date</label> | |
| <input type="date" id="startDate" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2"> | |
| </div> | |
| <div> | |
| <label for="endDate" class="block text-sm font-medium mb-1">End Date</label> | |
| <input type="date" id="endDate" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2"> | |
| </div> | |
| </div> | |
| <div> | |
| <label for="reportType" class="block text-sm font-medium mb-1">Report Type</label> | |
| <select id="reportType" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2"> | |
| <option value="developer_activity">Developer Activities</option> | |
| <option value="achievement">Achievements</option> | |
| </select> | |
| </div> | |
| <div class="pt-4"> | |
| <button type="submit" class="bg-primary hover:bg-primary/90 px-6 py-3 rounded-lg font-medium transition flex items-center"> | |
| <i data-feather="download" class="w-5 h-5 mr-2"></i> | |
| Generate PDF Report | |
| </button> | |
| </div> | |
| </form> | |
| </div> | |
| <div id="reportPreview" class="card-glass rounded-xl p-6 hidden"> | |
| <h2 class="text-xl font-bold mb-4">Report Preview</h2> | |
| <div id="previewContent" class="bg-gray-800 p-4 rounded-lg"> | |
| <!-- Preview content will be generated here --> | |
| </div> | |
| </div> | |
| </main> | |
| </div> | |
| </div> | |
| <script> | |
| feather.replace(); | |
| document.getElementById('exportForm').addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| const startDate = document.getElementById('startDate').value; | |
| const endDate = document.getElementById('endDate').value; | |
| const reportType = document.getElementById('reportType').value; | |
| // Generate preview | |
| const previewContent = document.getElementById('previewContent'); | |
| previewContent.innerHTML = ` | |
| <h3 class="text-lg font-medium mb-2">${reportType === 'developer_activity' ? 'Developer Activities' : 'Achievements'} Report</h3> | |
| <p class="text-gray-400 mb-4">Date range: ${startDate || 'No start date'} to ${endDate || 'No end date'}</p> | |
| <div class="space-y-3"> | |
| ${generateSampleData(reportType, startDate, endDate)} | |
| </div> | |
| `; | |
| // Show preview | |
| document.getElementById('reportPreview').classList.remove('hidden'); | |
| // Generate PDF | |
| generatePDF(startDate, endDate, reportType); | |
| }); | |
| function generateSampleData(type, startDate, endDate) { | |
| if (type === 'developer_activity') { | |
| return ` | |
| <div class="p-3 bg-gray-700 rounded"> | |
| <p class="font-medium">Fixed login bug</p> | |
| <p class="text-sm text-gray-400">Commit on ${formatDate(new Date())}</p> | |
| </div> | |
| <div class="p-3 bg-gray-700 rounded"> | |
| <p class="font-medium">Completed API documentation</p> | |
| <p class="text-sm text-gray-400">Task on ${formatDate(new Date())}</p> | |
| </div> | |
| <div class="p-3 bg-gray-700 rounded"> | |
| <p class="font-medium">Reviewed PR #42</p> | |
| <p class="text-sm text-gray-400">Pull Request on ${formatDate(new Date())}</p> | |
| </div> | |
| `; | |
| } else { | |
| return ` | |
| <div class="p-3 bg-gray-700 rounded"> | |
| <p class="font-medium">Completed 100 commits this month</p> | |
| <p class="text-sm text-gray-400">Achievement unlocked on ${formatDate(new Date())}</p> | |
| </div> | |
| <div class="p-3 bg-gray-700 rounded"> | |
| <p class="font-medium">5-star code review rating</p> | |
| <p class="text-sm text-gray-400">Achievement unlocked on ${formatDate(new Date())}</p> | |
| </div> | |
| `; | |
| } | |
| } | |
| function formatDate(date) { | |
| return date.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' }); | |
| } | |
| function generatePDF(startDate, endDate, reportType) { | |
| const { jsPDF } = window.jspdf; | |
| const doc = new jsPDF(); | |
| // Add title | |
| doc.setFontSize(20); | |
| doc.text('DevPulse Radar Report', 105, 20, { align: 'center' }); | |
| // Add report type | |
| doc.setFontSize(14); | |
| doc.text(`${reportType === 'developer_activity' ? 'Developer Activities' : 'Achievements'} Report`, 105, 30, { align: 'center' }); | |
| // Add date range | |
| doc.setFontSize(12); | |
| doc.text(`Date range: ${startDate || 'No start date'} to ${endDate || 'No end date'}`, 105, 40, { align: 'center' }); | |
| // Add content | |
| doc.setFontSize(10); | |
| let yPosition = 60; | |
| if (reportType === 'developer_activity') { | |
| doc.text('• Fixed login bug - Commit', 20, yPosition); | |
| yPosition += 10; | |
| doc.text('• Completed API documentation - Task', 20, yPosition); | |
| yPosition += 10; | |
| doc.text('• Reviewed PR #42 - Pull Request', 20, yPosition); | |
| } else { | |
| doc.text('• Completed 100 commits this month', 20, yPosition); | |
| yPosition += 10; | |
| doc.text('• 5-star code review rating', 20, yPosition); | |
| } | |
| // Add footer | |
| doc.setFontSize(8); | |
| doc.setTextColor(150); | |
| doc.text('Generated by DevPulse Radar', 105, 290, { align: 'center' }); | |
| // Save the PDF | |
| const fileName = `DevPulse_Report_${reportType}_${new Date().toISOString().slice(0,10)}.pdf`; | |
| doc.save(fileName); | |
| } | |
| </script> | |
| </body> | |
| </html> |