Spaces:
Running
Running
Download reports.html from batteryfix/taskmaster-pro: direct link, hf CLI and curl.
- Browser
- Download file 5.93 kB
-
https://huggingface.co/spaces/batteryfix/taskmaster-pro/resolve/main/reports.html
- Command line
-
hf download hf://spaces/batteryfix/taskmaster-pro/reports.html
-
curl -L -o reports.html https://huggingface.co/spaces/batteryfix/taskmaster-pro/resolve/main/reports.html
5.93 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Reports | TaskMaster Pro</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen flex flex-col"> | |
| <custom-navbar></custom-navbar> | |
| <main class="flex-1 container mx-auto px-4 py-8"> | |
| <div class="max-w-6xl mx-auto"> | |
| <h1 class="text-3xl font-bold text-gray-800 mb-8">Task Reports</h1> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-8 mb-8"> | |
| <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100"> | |
| <h2 class="text-xl font-semibold mb-4">Task Completion Rate</h2> | |
| <canvas id="completionChart"></canvas> | |
| </div> | |
| <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100"> | |
| <h2 class="text-xl font-semibold mb-4">Priority Distribution</h2> | |
| <canvas id="priorityChart"></canvas> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6"> | |
| <h2 class="text-xl font-semibold mb-4">Task Comments</h2> | |
| <div id="commentsContainer" class="space-y-4"> | |
| <!-- Comments will be loaded here --> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <custom-footer></custom-footer> | |
| <script src="components/navbar.js"></script> | |
| <script src="components/footer.js"></script> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', () => { | |
| const tasks = JSON.parse(localStorage.getItem('tasks')) || []; | |
| // Completion chart | |
| const completed = tasks.filter(t => t.status === 'completed').length; | |
| const inProgress = tasks.filter(t => t.status === 'in-progress').length; | |
| const pending = tasks.filter(t => t.status === 'pending').length; | |
| new Chart(document.getElementById('completionChart'), { | |
| type: 'doughnut', | |
| data: { | |
| labels: ['Completed', 'In Progress', 'Pending'], | |
| datasets: [{ | |
| data: [completed, inProgress, pending], | |
| backgroundColor: ['#10b981', '#3b82f6', '#f59e0b'], | |
| }] | |
| } | |
| }); | |
| // Priority chart | |
| const high = tasks.filter(t => t.priority === 'high').length; | |
| const medium = tasks.filter(t => t.priority === 'medium').length; | |
| const low = tasks.filter(t => t.priority === 'low').length; | |
| new Chart(document.getElementById('priorityChart'), { | |
| type: 'bar', | |
| data: { | |
| labels: ['High', 'Medium', 'Low'], | |
| datasets: [{ | |
| label: 'Tasks by Priority', | |
| data: [high, medium, low], | |
| backgroundColor: ['#ef4444', '#f59e0b', '#10b981'], | |
| }] | |
| } | |
| }); | |
| // Load comments with add form | |
| const commentsContainer = document.getElementById('commentsContainer'); | |
| commentsContainer.innerHTML = tasks.map(task => ` | |
| <div class="border-b border-gray-100 pb-4 last:border-0"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <h3 class="font-medium">${task.title}</h3> | |
| <p class="text-sm text-gray-500">${new Date(task.createdAt).toLocaleString()}</p> | |
| </div> | |
| <span class="status-badge ${'status-' + task.status.replace(' ', '-')}"> | |
| ${task.status.replace('-', ' ')} | |
| </span> | |
| </div> | |
| <div class="mt-2 space-y-2"> | |
| ${(task.comments || []).map((c, i) => ` | |
| <div class="bg-gray-50 p-3 rounded-lg"> | |
| <p class="text-sm">${i+1}. ${c}</p> | |
| </div> | |
| `).join('')} | |
| </div> | |
| <form class="mt-3 flex gap-2 add-comment" data-taskid="${task.id}"> | |
| <input type="text" class="flex-1 px-3 py-2 border border-gray-300 rounded-md" | |
| placeholder="Add comment..." required> | |
| <button type="submit" class="px-3 py-2 bg-primary text-white rounded-md"> | |
| <i data-feather="plus" class="w-4 h-4"></i> | |
| </button> | |
| </form> | |
| </div> | |
| `).join(''); | |
| // Add comment handlers | |
| document.querySelectorAll('.add-comment').forEach(form => { | |
| form.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| const input = this.querySelector('input'); | |
| const taskId = this.getAttribute('data-taskid'); | |
| const comment = input.value.trim(); | |
| if (comment) { | |
| const task = tasks.find(t => t.id === taskId); | |
| if (task) { | |
| if (!task.comments) task.comments = []; | |
| task.comments.push(comment); | |
| localStorage.setItem('tasks', JSON.stringify(tasks)); | |
| input.value = ''; | |
| location.reload(); | |
| } | |
| } | |
| }); | |
| }); | |
| feather.replace(); | |
| }); | |
| </script> | |
| </body> | |
| </html> |