Статистика

This commit is contained in:
2026-02-06 17:11:56 +05:00
parent 3a2b47c791
commit fff495d88c
5 changed files with 1664 additions and 368 deletions

View File

@@ -4,240 +4,272 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>School CRM - Административная панель</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="/style.css">
<style>
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.stat-card {
background: white;
/* Дополнительные стили для детальной статистики */
.filters-container {
background: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
border-left: 4px solid #3498db;
border-radius: 8px;
margin-bottom: 20px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.stat-card.task-stat {
border-left-color: #3498db;
.filter-row {
display: flex;
gap: 20px;
margin-bottom: 15px;
flex-wrap: wrap;
}
.stat-card.user-stat {
border-left-color: #2ecc71;
.filter-group {
flex: 1;
min-width: 200px;
}
.stat-card.file-stat {
border-left-color: #9b59b6;
}
.stat-card.status-stat {
border-left-color: #f39c12;
}
.stat-card h3 {
margin: 0 0 15px 0;
color: #495057;
font-size: 1.1rem;
.filter-group label {
display: block;
margin-bottom: 5px;
font-weight: 600;
color: #333;
}
.stat-value {
font-size: 2.5rem;
font-weight: 700;
color: #2c3e50;
margin-bottom: 10px;
.filter-group select {
width: 100%;
padding: 8px 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
}
.stat-desc {
color: #6c757d;
font-size: 0.9rem;
margin-bottom: 10px;
}
.stat-subitems {
.filter-actions {
display: flex;
gap: 10px;
margin-top: 10px;
}
.stat-subitem {
display: flex;
justify-content: space-between;
padding: 5px 0;
border-bottom: 1px solid #f1f1f1;
font-size: 0.9rem;
.users-stats-table {
width: 100%;
border-collapse: collapse;
background: #fff;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
border-radius: 8px;
overflow: hidden;
}
.stat-subitem:last-child {
border-bottom: none;
}
.stat-subitem .label {
color: #6c757d;
}
.stat-subitem .value {
.users-stats-table th {
background: #f8f9fa;
padding: 12px 15px;
text-align: left;
font-weight: 600;
color: #2c3e50;
color: #333;
border-bottom: 2px solid #dee2e6;
}
.recent-tasks {
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
margin-top: 20px;
.users-stats-table td {
padding: 12px 15px;
border-bottom: 1px solid #dee2e6;
}
.recent-tasks h3 {
margin: 0 0 15px 0;
color: #495057;
font-size: 1.2rem;
.users-stats-table tr:hover {
background: #f8f9fa;
}
.task-item {
.statuses-container {
display: flex;
flex-direction: column;
gap: 4px;
}
.status-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px;
border-bottom: 1px solid #e9ecef;
transition: all 0.3s ease;
}
.task-item:hover {
background: #f8f9fa;
}
.task-item:last-child {
border-bottom: none;
}
.task-info {
flex: 1;
}
.task-title {
font-weight: 600;
color: #2c3e50;
margin-bottom: 5px;
}
.task-meta {
font-size: 0.85rem;
color: #6c757d;
}
.task-actions {
display: flex;
gap: 8px;
}
.view-task-btn {
padding: 6px 12px;
background: #3498db;
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 0.85rem;
text-decoration: none;
.status-badge {
display: inline-block;
}
.view-task-btn:hover {
background: #2980b9;
}
.percentage-bar {
height: 6px;
background: #e9ecef;
border-radius: 3px;
margin-top: 8px;
overflow: hidden;
}
.percentage-fill {
height: 100%;
background: #3498db;
border-radius: 3px;
transition: width 0.3s ease;
}
.users-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
.users-table th,
.users-table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #e9ecef;
}
.users-table th {
background: #f8f9fa;
padding: 3px 8px;
border-radius: 12px;
font-size: 12px;
font-weight: 600;
color: #495057;
}
.users-table tr:hover {
background: #f8f9fa;
.status-assigned { background: #e3f2fd; color: #1976d2; }
.status-in-progress { background: #fff3e0; color: #f57c00; }
.status-completed { background: #e8f5e9; color: #388e3c; }
.status-overdue { background: #ffebee; color: #d32f2f; }
.status-rework { background: #f3e5f5; color: #7b1fa2; }
.status-count {
font-weight: 600;
min-width: 20px;
text-align: right;
}
.user-actions {
display: flex;
gap: 8px;
.no-statuses {
color: #999;
font-style: italic;
font-size: 12px;
}
.ldap-badge {
background: #3498db;
color: white;
.user-role {
display: inline-block;
padding: 3px 8px;
border-radius: 12px;
font-size: 0.75rem;
margin-left: 5px;
font-size: 12px;
font-weight: 600;
background: #f5f5f5;
color: #666;
}
.admin-badge {
background: #e74c3c;
color: white;
padding: 3px 8px;
border-radius: 12px;
font-size: 0.75rem;
margin-left: 5px;
}
.form-row {
display: flex;
gap: 20px;
margin-bottom: 20px;
}
.form-row .form-group {
flex: 1;
}
.modal-lg {
max-width: 800px;
}
.search-container {
.user-role.admin { background: #ffebee; color: #d32f2f; }
.user-role.teacher { background: #e3f2fd; color: #1976d2; }
.stat-numbers {
display: flex;
gap: 10px;
margin-top: 5px;
}
.stat-number {
background: #f8f9fa;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
}
.export-btn {
background: #28a745;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
font-weight: 600;
}
.export-btn:hover {
background: #218838;
}
.reset-btn {
background: #6c757d;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
}
.reset-btn:hover {
background: #5a6268;
}
.no-data {
text-align: center;
padding: 40px;
color: #666;
font-style: italic;
}
.stats-loading {
text-align: center;
padding: 40px;
color: #666;
}
.stats-error {
text-align: center;
padding: 40px;
color: #dc3545;
}
.pagination {
display: flex;
justify-content: center;
gap: 10px;
margin-top: 20px;
}
.page-btn {
padding: 6px 12px;
border: 1px solid #ddd;
background: white;
border-radius: 4px;
cursor: pointer;
}
.page-btn.active {
background: #007bff;
color: white;
border-color: #007bff;
}
.page-btn:hover:not(.active) {
background: #f8f9fa;
}
.page-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.stats-summary {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
}
.total-count {
font-weight: 600;
color: #333;
}
.page-dots {
padding: 6px 12px;
color: #666;
}
.user-info {
line-height: 1.4;
}
.user-login {
font-size: 12px;
color: #666;
}
.user-email {
font-size: 12px;
color: #999;
}
.stats-header {
margin-bottom: 20px;
}
.search-container input {
flex: 1;
.stats-header h2 {
margin-bottom: 5px;
}
.file-size {
font-size: 1.2rem;
color: #2c3e50;
margin-top: 5px;
.stats-header p {
color: #666;
margin: 0;
}
.overall-stats {
margin-bottom: 30px;
}
.overall-stats h3 {
margin-bottom: 15px;
}
.detailed-stats h3 {
margin-bottom: 15px;
}
</style>
</head>
@@ -282,95 +314,12 @@
<div class="admin-tabs">
<button class="admin-tab active" onclick="showAdminSection('dashboard')">Дашборд</button>
<button class="admin-tab" onclick="showAdminSection('users')">Пользователи</button>
<button class="admin-tab" onclick="showAdminSection('dashboard')">test</button>
<button class="admin-tab" onclick="showAdminSection('stats')">Статистика</button>
</div>
<!-- Контейнер для дашборда - будет заполняться JavaScript -->
<div id="admin-dashboard" class="admin-section active">
<h2>Статистика системы</h2>
<div class="stats-grid">
<div class="stat-card task-stat">
<h3>Задачи</h3>
<div class="stat-value" id="total-tasks">0</div>
<div class="stat-desc">Всего задач в системе</div>
<div class="percentage-bar">
<div class="percentage-fill" id="active-tasks-bar" style="width: 0%"></div>
</div>
<div class="stat-subitems">
<div class="stat-subitem">
<span class="label">Активные:</span>
<span class="value" id="active-tasks">0</span>
</div>
<div class="stat-subitem">
<span class="label">Закрытые:</span>
<span class="value" id="closed-tasks">0</span>
</div>
<div class="stat-subitem">
<span class="label">Удаленные:</span>
<span class="value" id="deleted-tasks">0</span>
</div>
</div>
</div>
<div class="stat-card status-stat">
<h3>Статусы назначений</h3>
<div class="stat-value" id="total-assignments">0</div>
<div class="stat-desc">Всего назначений</div>
<div class="stat-subitems">
<div class="stat-subitem">
<span class="label">Назначено:</span>
<span class="value" id="assigned-count">0</span>
</div>
<div class="stat-subitem">
<span class="label">В работе:</span>
<span class="value" id="in-progress-count">0</span>
</div>
<div class="stat-subitem">
<span class="label">Выполнено:</span>
<span class="value" id="completed-count">0</span>
</div>
<div class="stat-subitem">
<span class="label">Просрочено:</span>
<span class="value" id="overdue-count">0</span>
</div>
<div class="stat-subitem">
<span class="label">На доработке:</span>
<span class="value" id="rework-count">0</span>
</div>
</div>
</div>
<div class="stat-card user-stat">
<h3>Пользователи</h3>
<div class="stat-value" id="total-users">0</div>
<div class="stat-desc">Зарегистрировано пользователей</div>
<div class="stat-subitems">
<div class="stat-subitem">
<span class="label">Администраторы:</span>
<span class="value" id="admin-users">0</span>
</div>
<div class="stat-subitem">
<span class="label">Учителя:</span>
<span class="value" id="teacher-users">0</span>
</div>
<div class="stat-subitem">
<span class="label">LDAP:</span>
<span class="value" id="ldap-users">0</span>
</div>
<div class="stat-subitem">
<span class="label">Локальные:</span>
<span class="value" id="local-users">0</span>
</div>
</div>
</div>
<div class="stat-card file-stat">
<h3>Файлы</h3>
<div class="stat-value" id="total-files">0</div>
<div class="stat-desc">Всего загружено файлов</div>
<div class="file-size" id="total-files-size">0 MB</div>
</div>
</div>
<!-- Дашборд будет загружен через JavaScript -->
</div>
<div id="admin-users-section" class="admin-section">
@@ -402,6 +351,11 @@
</tbody>
</table>
</div>
<!-- Контейнер для детальной статистики -->
<div id="admin-stats-section" class="admin-section">
<!-- Детальная статистика будет загружена через JavaScript -->
</div>
</div>
<div id="edit-user-modal" class="modal">
@@ -461,5 +415,7 @@
</div>
<script src="admin-script.js"></script>
<script src="admin-dashboard.js"></script>
<script src="admin-stats.js"></script>
</body>
</html>