devpulse-radar / allactivities.html
WinLanEm's picture
можешь на свой вкус сделать либо страницу, либо поле на одной из страниц, где будет какой-то текст и кнопка (сама кнопка отвечает за скачивание активностей в pdf есть фильтры по дате start_date end_date и type developer_activity или achievement
874a8e2 verified
Raw History Blame Contribute Delete
19.4 kB
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>All Activities | 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://cdn.jsdelivr.net/npm/chart.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="approval.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition">
<i data-feather="check-circle" class="w-5 h-5"></i>
<span>Task Approval</span>
</a>
</li>
<li>
<a href="manual.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition">
<i data-feather="plus-circle" class="w-5 h-5"></i>
<span>Manual Add</span>
</a>
</li>
<li>
<a href="allactivities.html" class="flex items-center space-x-3 px-3 py-2 bg-gray-700 rounded-lg text-primary">
<i data-feather="list" class="w-5 h-5"></i>
<span>All Activities</span>
</a>
</li>
<li>
<a href="export.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition">
<i data-feather="download" class="w-5 h-5"></i>
<span>Export</span>
</a>
</li>
<li>
<a href="settings.html" class="flex items-center space-x-3 px-3 py-2 hover:bg-gray-700 rounded-lg transition">
<i data-feather="settings" class="w-5 h-5"></i>
<span>Settings</span>
</a>
</li>
</ul>
</div>
</nav>
<!-- Main Content -->
<div class="flex-1 overflow-auto">
<!-- Top Navigation -->
<header class="sticky top-0 z-10 bg-gray-800 border-b border-gray-700 p-4">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-4">
<button class="md:hidden">
<i data-feather="menu" class="w-5 h-5"></i>
</button>
<div class="relative w-full max-w-md">
<i data-feather="search" class="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500 w-5 h-5"></i>
<input type="text" placeholder="Search activities..." class="w-full bg-gray-700 border-none pl-10 pr-4 py-2 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent">
</div>
</div>
<div class="flex items-center space-x-4">
<button class="relative">
<i data-feather="bell" class="w-5 h-5"></i>
<span class="absolute top-0 right-0 w-2 h-2 bg-primary rounded-full"></span>
</button>
<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>
<span class="hidden md:inline">John Developer</span>
<i data-feather="chevron-down" class="w-4 h-4 hidden md:inline"></i>
</div>
</div>
</div>
</header>
<!-- All Activities Content -->
<main class="p-6">
<div class="mb-8">
<h2 class="text-2xl font-bold mb-2">All Activities</h2>
<p class="text-gray-400">Comprehensive view of all your developer activities</p>
</div>
<div class="mb-8">
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4">
<div class="relative">
<label for="filter-type" class="block text-xs text-gray-400 mb-1">Type</label>
<select id="filter-type" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 appearance-none">
<option value="all">All Types</option>
<option value="commit">Commits</option>
<option value="pr">Pull Requests</option>
<option value="task">Tasks</option>
</select>
<i data-feather="chevron-down" class="absolute right-3 top-7 w-4 h-4 pointer-events-none"></i>
</div>
<button id="apply-filter" class="bg-primary hover:bg-primary/90 px-4 py-2 rounded-lg font-medium transition sm:mt-6">
Apply Filters
</button>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="relative">
<label for="date-from" class="block text-xs text-gray-400 mb-1">Date From</label>
<input type="date" id="date-from" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2">
</div>
<div class="relative">
<label for="date-to" class="block text-xs text-gray-400 mb-1">Date To</label>
<input type="date" id="date-to" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2">
</div>
</div>
</div>
<div class="grid grid-cols-1 gap-2 sm:gap-4 mt-4" id="activities-container">
<!-- Activities will be loaded here via JavaScript -->
</div>
<!-- Pagination -->
<div class="flex justify-center mt-8">
<div class="flex items-center space-x-2" id="pagination">
<button id="prevPage" class="px-4 py-2 rounded-md hover:bg-gray-800 transition disabled:opacity-50" disabled>
<i data-feather="chevron-left" class="w-4 h-4"></i>
</button>
<div class="flex space-x-1" id="pageNumbers"></div>
<button id="nextPage" class="px-4 py-2 rounded-md hover:bg-gray-800 transition">
<i data-feather="chevron-right" class="w-4 h-4"></i>
</button>
</div>
</div>
</main>
</div>
</div>
<!-- Activity Detail Modal -->
<div id="activityModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-gray-800 rounded-xl border border-gray-700 p-6 max-w-2xl w-full mx-4">
<div class="flex justify-between items-start mb-6">
<h3 class="text-xl font-bold" id="modalTitle">Activity Details</h3>
<button onclick="closeModal()">
<i data-feather="x" class="w-6 h-6"></i>
</button>
</div>
<div class="space-y-4" id="modalContent">
<!-- Content will be dynamically loaded here -->
</div>
</div>
</div>
<script>
feather.replace();
function showActivityDetail(activityId) {
const modal = document.getElementById('activityModal');
const modalTitle = document.getElementById('modalTitle');
const modalContent = document.getElementById('modalContent');
const activities = {
1: {
title: "Fixed login bug",
type: "commit",
description: "Fixed issue with login form validation not handling empty fields correctly",
date: "2 hours ago",
from: "GitHub",
repo: "main-repo",
commit: "#a1b2c3d"
},
2: {
title: "Feature/new-dashboard",
type: "pr",
description: "Implemented new dashboard UI components with responsive design",
date: "1 day ago",
from: "GitLab",
pr: "#42",
branch: "feature/new-dashboard"
},
3: {
title: "Complete auth flow",
type: "task",
description: "Finished implementing authentication flow including JWT validation",
date: "3 days ago",
from: "Jira",
task: "PROJ-123",
time: "4 hours"
}
};
const activity = activities[activityId];
modalTitle.textContent = activity.title;
let content = `
<div class="flex items-center space-x-2">
<span class="px-2 py-1 bg-gray-700 rounded text-sm">${activity.from}</span>
<span class="text-sm text-gray-400">${activity.date}</span>
</div>
<div class="bg-gray-700 rounded-lg p-4">
<p>${activity.description}</p>
</div>
`;
if (activity.type === 'commit') {
content += `
<div class="grid grid-cols-2 gap-4">
<div>
<p class="text-sm text-gray-400">Repository</p>
<p>${activity.repo}</p>
</div>
<div>
<p class="text-sm text-gray-400">Commit</p>
<p>${activity.commit}</p>
</div>
</div>
`;
} else if (activity.type === 'pr') {
content += `
<div class="grid grid-cols-2 gap-4">
<div>
<p class="text-sm text-gray-400">Pull Request</p>
<p>${activity.pr}</p>
</div>
<div>
<p class="text-sm text-gray-400">Branch</p>
<p>${activity.branch}</p>
</div>
</div>
`;
} else if (activity.type === 'task') {
content += `
<div class="grid grid-cols-2 gap-4">
<div>
<p class="text-sm text-gray-400">Task ID</p>
<p>${activity.task}</p>
</div>
<div>
<p class="text-sm text-gray-400">Time Spent</p>
<p>${activity.time}</p>
</div>
</div>
`;
}
modalContent.innerHTML = content;
modal.classList.remove('hidden');
}
function closeModal() {
document.getElementById('activityModal').classList.add('hidden');
}
// Sample data - in a real app this would come from an API
const sampleActivities = [
{ id: 1, title: "Fixed login bug", type: "commit", date: new Date(Date.now() - 2 * 60 * 60 * 1000) },
{ id: 2, title: "Feature/new-dashboard", type: "pr", date: new Date(Date.now() - 24 * 60 * 60 * 1000) },
{ id: 3, title: "Complete auth flow", type: "task", date: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000) },
{ id: 4, title: "Updated documentation", type: "task", date: new Date(Date.now() - 1 * 24 * 60 * 60 * 1000) },
{ id: 5, title: "Refactored API endpoints", type: "commit", date: new Date(Date.now() - 5 * 60 * 60 * 1000) },
{ id: 6, title: "Fixed CSS issues", type: "commit", date: new Date(Date.now() - 8 * 60 * 60 * 1000) },
{ id: 7, title: "PR #45: Database migration", type: "pr", date: new Date(Date.now() - 2 * 24 * 60 * 60 * 1000) },
{ id: 8, title: "BUG-77: Fix login redirect", type: "task", date: new Date(Date.now() - 4 * 24 * 60 * 60 * 1000) },
{ id: 9, title: "Added unit tests", type: "commit", date: new Date(Date.now() - 6 * 60 * 60 * 1000) },
{ id: 10, title: "PR #38: Update dependencies", type: "pr", date: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000) }
];
let currentPage = 1;
const activitiesPerPage = 10;
let filteredActivities = [...sampleActivities];
function renderActivities() {
const container = document.getElementById('activities-container');
container.innerHTML = '';
const startIndex = (currentPage - 1) * activitiesPerPage;
const endIndex = startIndex + activitiesPerPage;
const paginatedActivities = filteredActivities.slice(startIndex, endIndex);
paginatedActivities.forEach(activity => {
const activityElement = document.createElement('div');
activityElement.className = 'card-glass p-4 rounded-lg hover:bg-gray-800/50 transition cursor-pointer';
activityElement.onclick = () => showActivityDetail(activity.id);
let icon, iconClass;
if (activity.type === 'commit') {
icon = 'git-commit';
iconClass = 'text-primary';
} else if (activity.type === 'pr') {
icon = 'git-pull-request';
iconClass = 'text-purple-500';
} else {
icon = 'check-circle';
iconClass = 'text-green-500';
}
activityElement.innerHTML = `
<div class="flex items-start space-x-3">
<div class="${iconClass}/10 p-2 rounded-lg flex-shrink-0">
<i data-feather="${icon}" class="${iconClass} w-5 h-5"></i>
</div>
<div class="flex-1">
<div class="flex justify-between">
<h3 class="font-medium">${activity.title}</h3>
<span class="text-sm text-gray-400">${formatDate(activity.date)}</span>
</div>
<p class="text-sm text-gray-400 mt-1">From ${getSource(activity.type)}</p>
</div>
</div>
`;
container.appendChild(activityElement);
});
renderPagination();
feather.replace();
}
function formatDate(date) {
const diff = Date.now() - date.getTime();
const hours = Math.floor(diff / (1000 * 60 * 60));
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
if (hours < 24) return `${hours} hours ago`;
return `${days} days ago`;
}
function getSource(type) {
return type === 'commit' ? 'GitHub' :
type === 'pr' ? 'GitLab' : 'Jira';
}
function renderPagination() {
const pageCount = Math.ceil(filteredActivities.length / activitiesPerPage);
const pageNumbers = document.getElementById('pageNumbers');
pageNumbers.innerHTML = '';
for (let i = 1; i <= pageCount; i++) {
const pageBtn = document.createElement('button');
pageBtn.className = `px-4 py-2 rounded-md ${i === currentPage ? 'bg-primary' : 'hover:bg-gray-800'}`;
pageBtn.textContent = i;
pageBtn.onclick = () => {
currentPage = i;
renderActivities();
};
pageNumbers.appendChild(pageBtn);
}
document.getElementById('prevPage').disabled = currentPage === 1;
document.getElementById('nextPage').disabled = currentPage === pageCount;
}
document.getElementById('prevPage').addEventListener('click', () => {
if (currentPage > 1) {
currentPage--;
renderActivities();
}
});
document.getElementById('nextPage').addEventListener('click', () => {
if (currentPage * activitiesPerPage < filteredActivities.length) {
currentPage++;
renderActivities();
}
});
// Filter functionality
document.getElementById('apply-filter').addEventListener('click', () => {
const typeFilter = document.getElementById('filter-type').value;
const dateFrom = document.getElementById('date-from').value;
const dateTo = document.getElementById('date-to').value;
filteredActivities = sampleActivities.filter(activity => {
if (typeFilter !== 'all' && activity.type !== typeFilter) return false;
const activityDate = activity.date.toISOString().split('T')[0];
if (dateFrom && activityDate < dateFrom) return false;
if (dateTo && activityDate > dateTo) return false;
return true;
});
currentPage = 1;
renderActivities();
});
// Initial render
renderActivities();
</script>
</body>
</html>