Spaces:
Running
Running
можешь на свой вкус сделать либо страницу, либо поле на одной из страниц, где будет какой-то текст и кнопка (сама кнопка отвечает за скачивание активностей в pdf есть фильтры по дате start_date end_date и type developer_activity или achievement
Browse files- allactivities.html +8 -2
- dashboard.html +12 -6
- export.html +216 -0
allactivities.html
CHANGED
|
@@ -54,12 +54,18 @@
|
|
| 54 |
</a>
|
| 55 |
</li>
|
| 56 |
<li>
|
| 57 |
-
<a href="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
<i data-feather="settings" class="w-5 h-5"></i>
|
| 59 |
<span>Settings</span>
|
| 60 |
</a>
|
| 61 |
</li>
|
| 62 |
-
|
| 63 |
</div>
|
| 64 |
</nav>
|
| 65 |
|
|
|
|
| 54 |
</a>
|
| 55 |
</li>
|
| 56 |
<li>
|
| 57 |
+
<a href="export.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition">
|
| 58 |
+
<i data-feather="download" class="w-5 h-5"></i>
|
| 59 |
+
<span>Export</span>
|
| 60 |
+
</a>
|
| 61 |
+
</li>
|
| 62 |
+
<li>
|
| 63 |
+
<a href="settings.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition">
|
| 64 |
<i data-feather="settings" class="w-5 h-5"></i>
|
| 65 |
<span>Settings</span>
|
| 66 |
</a>
|
| 67 |
</li>
|
| 68 |
+
</ul>
|
| 69 |
</div>
|
| 70 |
</nav>
|
| 71 |
|
dashboard.html
CHANGED
|
@@ -45,12 +45,18 @@
|
|
| 45 |
<span>All Activities</span>
|
| 46 |
</a>
|
| 47 |
</li>
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
</ul>
|
| 55 |
</div>
|
| 56 |
</nav>
|
|
|
|
| 45 |
<span>All Activities</span>
|
| 46 |
</a>
|
| 47 |
</li>
|
| 48 |
+
<li>
|
| 49 |
+
<a href="export.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition">
|
| 50 |
+
<i data-feather="download" class="w-5 h-5"></i>
|
| 51 |
+
<span>Export</span>
|
| 52 |
+
</a>
|
| 53 |
+
</li>
|
| 54 |
+
<li>
|
| 55 |
+
<a href="settings.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition">
|
| 56 |
+
<i data-feather="settings" class="w-5 h-5"></i>
|
| 57 |
+
<span>Settings</span>
|
| 58 |
+
</a>
|
| 59 |
+
</li>
|
| 60 |
</ul>
|
| 61 |
</div>
|
| 62 |
</nav>
|
export.html
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" class="dark">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Export Report | DevPulse Radar</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
|
| 11 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
|
| 12 |
+
<style>
|
| 13 |
+
.card-glass {
|
| 14 |
+
backdrop-filter: blur(10px);
|
| 15 |
+
background: rgba(255, 255, 255, 0.1);
|
| 16 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="bg-gray-900 text-gray-100 min-h-screen">
|
| 21 |
+
<div class="flex h-screen">
|
| 22 |
+
<!-- Sidebar -->
|
| 23 |
+
<nav class="w-64 bg-gray-800 border-r border-gray-700 hidden md:block">
|
| 24 |
+
<div class="p-4 border-b border-gray-700">
|
| 25 |
+
<div class="flex items-center space-x-2">
|
| 26 |
+
<i data-feather="activity" class="text-primary w-6 h-6"></i>
|
| 27 |
+
<span class="text-xl font-bold">DevPulse Radar</span>
|
| 28 |
+
</div>
|
| 29 |
+
</div>
|
| 30 |
+
<div class="p-4">
|
| 31 |
+
<ul class="space-y-2">
|
| 32 |
+
<li>
|
| 33 |
+
<a href="dashboard.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition">
|
| 34 |
+
<i data-feather="home" class="w-5 h-5"></i>
|
| 35 |
+
<span>Dashboard</span>
|
| 36 |
+
</a>
|
| 37 |
+
</li>
|
| 38 |
+
<li>
|
| 39 |
+
<a href="export.html" class="flex items-center space-x-3 px-3 py-2 bg-gray-700 rounded-lg text-primary">
|
| 40 |
+
<i data-feather="download" class="w-5 h-5"></i>
|
| 41 |
+
<span>Export Report</span>
|
| 42 |
+
</a>
|
| 43 |
+
</li>
|
| 44 |
+
<li>
|
| 45 |
+
<a href="allactivities.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition">
|
| 46 |
+
<i data-feather="list" class="w-5 h-5"></i>
|
| 47 |
+
<span>All Activities</span>
|
| 48 |
+
</a>
|
| 49 |
+
</li>
|
| 50 |
+
</ul>
|
| 51 |
+
</div>
|
| 52 |
+
</nav>
|
| 53 |
+
|
| 54 |
+
<!-- Main Content -->
|
| 55 |
+
<div class="flex-1 overflow-auto">
|
| 56 |
+
<header class="sticky top-0 z-10 bg-gray-800 border-b border-gray-700 p-4">
|
| 57 |
+
<div class="flex justify-between items-center">
|
| 58 |
+
<h1 class="text-xl font-bold">Export Activity Report</h1>
|
| 59 |
+
<div class="flex items-center space-x-2">
|
| 60 |
+
<div class="w-8 h-8 rounded-full bg-primary flex items-center justify-center">
|
| 61 |
+
<span class="text-sm font-medium">JD</span>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
</div>
|
| 65 |
+
</header>
|
| 66 |
+
|
| 67 |
+
<main class="p-6">
|
| 68 |
+
<div class="card-glass rounded-xl p-6 mb-6">
|
| 69 |
+
<h2 class="text-xl font-bold mb-4">Generate PDF Report</h2>
|
| 70 |
+
<p class="text-gray-300 mb-6">Select filters and download your developer activities or achievements as a PDF report.</p>
|
| 71 |
+
|
| 72 |
+
<form id="exportForm" class="space-y-4">
|
| 73 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 74 |
+
<div>
|
| 75 |
+
<label for="startDate" class="block text-sm font-medium mb-1">Start Date</label>
|
| 76 |
+
<input type="date" id="startDate" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2">
|
| 77 |
+
</div>
|
| 78 |
+
<div>
|
| 79 |
+
<label for="endDate" class="block text-sm font-medium mb-1">End Date</label>
|
| 80 |
+
<input type="date" id="endDate" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2">
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
|
| 84 |
+
<div>
|
| 85 |
+
<label for="reportType" class="block text-sm font-medium mb-1">Report Type</label>
|
| 86 |
+
<select id="reportType" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2">
|
| 87 |
+
<option value="developer_activity">Developer Activities</option>
|
| 88 |
+
<option value="achievement">Achievements</option>
|
| 89 |
+
</select>
|
| 90 |
+
</div>
|
| 91 |
+
|
| 92 |
+
<div class="pt-4">
|
| 93 |
+
<button type="submit" class="bg-primary hover:bg-primary/90 px-6 py-3 rounded-lg font-medium transition flex items-center">
|
| 94 |
+
<i data-feather="download" class="w-5 h-5 mr-2"></i>
|
| 95 |
+
Generate PDF Report
|
| 96 |
+
</button>
|
| 97 |
+
</div>
|
| 98 |
+
</form>
|
| 99 |
+
</div>
|
| 100 |
+
|
| 101 |
+
<div id="reportPreview" class="card-glass rounded-xl p-6 hidden">
|
| 102 |
+
<h2 class="text-xl font-bold mb-4">Report Preview</h2>
|
| 103 |
+
<div id="previewContent" class="bg-gray-800 p-4 rounded-lg">
|
| 104 |
+
<!-- Preview content will be generated here -->
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
</main>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
|
| 111 |
+
<script>
|
| 112 |
+
feather.replace();
|
| 113 |
+
|
| 114 |
+
document.getElementById('exportForm').addEventListener('submit', function(e) {
|
| 115 |
+
e.preventDefault();
|
| 116 |
+
|
| 117 |
+
const startDate = document.getElementById('startDate').value;
|
| 118 |
+
const endDate = document.getElementById('endDate').value;
|
| 119 |
+
const reportType = document.getElementById('reportType').value;
|
| 120 |
+
|
| 121 |
+
// Generate preview
|
| 122 |
+
const previewContent = document.getElementById('previewContent');
|
| 123 |
+
previewContent.innerHTML = `
|
| 124 |
+
<h3 class="text-lg font-medium mb-2">${reportType === 'developer_activity' ? 'Developer Activities' : 'Achievements'} Report</h3>
|
| 125 |
+
<p class="text-gray-400 mb-4">Date range: ${startDate || 'No start date'} to ${endDate || 'No end date'}</p>
|
| 126 |
+
|
| 127 |
+
<div class="space-y-3">
|
| 128 |
+
${generateSampleData(reportType, startDate, endDate)}
|
| 129 |
+
</div>
|
| 130 |
+
`;
|
| 131 |
+
|
| 132 |
+
// Show preview
|
| 133 |
+
document.getElementById('reportPreview').classList.remove('hidden');
|
| 134 |
+
|
| 135 |
+
// Generate PDF
|
| 136 |
+
generatePDF(startDate, endDate, reportType);
|
| 137 |
+
});
|
| 138 |
+
|
| 139 |
+
function generateSampleData(type, startDate, endDate) {
|
| 140 |
+
if (type === 'developer_activity') {
|
| 141 |
+
return `
|
| 142 |
+
<div class="p-3 bg-gray-700 rounded">
|
| 143 |
+
<p class="font-medium">Fixed login bug</p>
|
| 144 |
+
<p class="text-sm text-gray-400">Commit on ${formatDate(new Date())}</p>
|
| 145 |
+
</div>
|
| 146 |
+
<div class="p-3 bg-gray-700 rounded">
|
| 147 |
+
<p class="font-medium">Completed API documentation</p>
|
| 148 |
+
<p class="text-sm text-gray-400">Task on ${formatDate(new Date())}</p>
|
| 149 |
+
</div>
|
| 150 |
+
<div class="p-3 bg-gray-700 rounded">
|
| 151 |
+
<p class="font-medium">Reviewed PR #42</p>
|
| 152 |
+
<p class="text-sm text-gray-400">Pull Request on ${formatDate(new Date())}</p>
|
| 153 |
+
</div>
|
| 154 |
+
`;
|
| 155 |
+
} else {
|
| 156 |
+
return `
|
| 157 |
+
<div class="p-3 bg-gray-700 rounded">
|
| 158 |
+
<p class="font-medium">Completed 100 commits this month</p>
|
| 159 |
+
<p class="text-sm text-gray-400">Achievement unlocked on ${formatDate(new Date())}</p>
|
| 160 |
+
</div>
|
| 161 |
+
<div class="p-3 bg-gray-700 rounded">
|
| 162 |
+
<p class="font-medium">5-star code review rating</p>
|
| 163 |
+
<p class="text-sm text-gray-400">Achievement unlocked on ${formatDate(new Date())}</p>
|
| 164 |
+
</div>
|
| 165 |
+
`;
|
| 166 |
+
}
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
function formatDate(date) {
|
| 170 |
+
return date.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' });
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
function generatePDF(startDate, endDate, reportType) {
|
| 174 |
+
const { jsPDF } = window.jspdf;
|
| 175 |
+
const doc = new jsPDF();
|
| 176 |
+
|
| 177 |
+
// Add title
|
| 178 |
+
doc.setFontSize(20);
|
| 179 |
+
doc.text('DevPulse Radar Report', 105, 20, { align: 'center' });
|
| 180 |
+
|
| 181 |
+
// Add report type
|
| 182 |
+
doc.setFontSize(14);
|
| 183 |
+
doc.text(`${reportType === 'developer_activity' ? 'Developer Activities' : 'Achievements'} Report`, 105, 30, { align: 'center' });
|
| 184 |
+
|
| 185 |
+
// Add date range
|
| 186 |
+
doc.setFontSize(12);
|
| 187 |
+
doc.text(`Date range: ${startDate || 'No start date'} to ${endDate || 'No end date'}`, 105, 40, { align: 'center' });
|
| 188 |
+
|
| 189 |
+
// Add content
|
| 190 |
+
doc.setFontSize(10);
|
| 191 |
+
let yPosition = 60;
|
| 192 |
+
|
| 193 |
+
if (reportType === 'developer_activity') {
|
| 194 |
+
doc.text('• Fixed login bug - Commit', 20, yPosition);
|
| 195 |
+
yPosition += 10;
|
| 196 |
+
doc.text('• Completed API documentation - Task', 20, yPosition);
|
| 197 |
+
yPosition += 10;
|
| 198 |
+
doc.text('• Reviewed PR #42 - Pull Request', 20, yPosition);
|
| 199 |
+
} else {
|
| 200 |
+
doc.text('• Completed 100 commits this month', 20, yPosition);
|
| 201 |
+
yPosition += 10;
|
| 202 |
+
doc.text('• 5-star code review rating', 20, yPosition);
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
// Add footer
|
| 206 |
+
doc.setFontSize(8);
|
| 207 |
+
doc.setTextColor(150);
|
| 208 |
+
doc.text('Generated by DevPulse Radar', 105, 290, { align: 'center' });
|
| 209 |
+
|
| 210 |
+
// Save the PDF
|
| 211 |
+
const fileName = `DevPulse_Report_${reportType}_${new Date().toISOString().slice(0,10)}.pdf`;
|
| 212 |
+
doc.save(fileName);
|
| 213 |
+
}
|
| 214 |
+
</script>
|
| 215 |
+
</body>
|
| 216 |
+
</html>
|