Spaces:
Paused
Paused
| {% extends "base.html" %} | |
| {% block title %}Админ-дашборд{% endblock %} | |
| {% block page_title %}Админ-дашборд{% endblock %} | |
| {% block content %} | |
| <style> | |
| .dash-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:12px; margin-bottom:20px; } | |
| .dash-card { background:rgba(6,11,40,0.6); backdrop-filter:blur(20px); border:1px solid rgba(255,255,255,0.05); border-radius:20px; padding:16px; } | |
| .dash-card-icon { width:36px;height:36px;border-radius:12px;display:flex;align-items:center;justify-content:center;margin-bottom:8px; } | |
| .dash-card-value { font-size:22px;font-weight:700;color:#fff; } | |
| .dash-card-label { font-size:11px;color:#A0A5B5;margin-top:2px; } | |
| </style> | |
| <div class="dash-grid"> | |
| <div class="dash-card"> | |
| <div class="dash-card-icon" style="background:rgba(0,117,255,0.12);color:#0075FF;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/></svg></div> | |
| <div class="dash-card-value">{{ users_total }}</div> | |
| <div class="dash-card-label">Всего пользователей · {{ users_active }} активны</div> | |
| <div style="font-size:10px;color:#A0A5B5;margin-top:4px;">{{ users_admins }} админов · {{ users_employees }} сотрудников</div> | |
| </div> | |
| <div class="dash-card"> | |
| <div class="dash-card-icon" style="background:rgba(1,181,116,0.12);color:#01B574;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg></div> | |
| <div class="dash-card-value">{{ kpi_count }}</div> | |
| <div class="dash-card-label">Активных KPI метрик</div> | |
| </div> | |
| <div class="dash-card"> | |
| <div class="dash-card-icon" style="background:rgba(0,229,255,0.12);color:#00E5FF;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/></svg></div> | |
| <div class="dash-card-value">{{ fact_count }}</div> | |
| <div class="dash-card-label">Всего значений KPI фактов</div> | |
| </div> | |
| <div class="dash-card"> | |
| <div class="dash-card-icon" style="background:rgba(245,158,11,0.12);color:#f59e0b;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 11l3 3L22 4"/><path d="M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"/></svg></div> | |
| <div class="dash-card-value">{{ tasks_pending }}</div> | |
| <div class="dash-card-label">Задач ожидает · {{ tasks_in_progress }} в работе</div> | |
| <div style="font-size:10px;color:#A0A5B5;margin-top:4px;">{{ tasks_completed }} готово · {{ tasks_total }} всего</div> | |
| </div> | |
| <div class="dash-card"> | |
| <div class="dash-card-icon" style="background:rgba(139,92,246,0.12);color:#8b5cf6;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 19.5A2.5 2.5 0 016.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z"/></svg></div> | |
| <div class="dash-card-value">{{ trainings_total }}</div> | |
| <div class="dash-card-label">Обучений загружено</div> | |
| </div> | |
| <div class="dash-card"> | |
| <div class="dash-card-icon" style="background:rgba(239,68,68,0.12);color:#ef4444;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg></div> | |
| <div class="dash-card-value">{{ audits_total }}</div> | |
| <div class="dash-card-label">Аудитов и брифчеков</div> | |
| </div> | |
| <div class="dash-card"> | |
| <div class="dash-card-icon" style="background:rgba(0,117,255,0.12);color:#0075FF;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 01-3.46 0"/></svg></div> | |
| <div class="dash-card-value">{{ notifications_total }}</div> | |
| <div class="dash-card-label">Уведомлений в системе</div> | |
| </div> | |
| </div> | |
| <div class="d-card" style="border-radius:20px;background:rgba(6,11,40,0.6);backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,0.05);overflow:hidden;margin-bottom:20px;"> | |
| <div style="padding:12px 16px;border-bottom:1px solid rgba(255,255,255,0.05);"> | |
| <span style="font-weight:600;font-size:14px;color:#fff;">Чек-лист обучений и аудитов</span> | |
| <span style="font-size:11px;color:#A0A5B5;margin-left:8px;">{{ activities|length }} активностей</span> | |
| </div> | |
| <div style="padding:8px 16px;"> | |
| {% for a in activities %} | |
| <div style="display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,0.04);"> | |
| <span style="font-size:13px;color:#fff;min-width:180px;">{{ a.label }}</span> | |
| <div style="flex:1;height:6px;background:rgba(255,255,255,0.06);border-radius:4px;overflow:hidden;"> | |
| {% set pct = (a.fact / a.plan * 100) if a.plan > 0 else 0 %} | |
| <div style="height:100%;width:{{ pct }}%;border-radius:4px;background:{{ '#01B574' if pct >= 100 else '#f59e0b' if pct >= 50 else '#ef4444' }};transition:width 0.3s;"></div> | |
| </div> | |
| <span style="font-size:12px;font-weight:600;color:#fff;min-width:60px;text-align:right;">{{ a.fact }}/{{ a.plan }}</span> | |
| <span style="font-size:11px;color:{{ '#01B574' if pct >= 100 else '#f59e0b' if pct >= 50 else '#ef4444' }};min-width:36px;text-align:right;">{{ '%.0f'|format(pct) }}%</span> | |
| </div> | |
| {% endfor %} | |
| </div> | |
| </div> | |
| {% if latest_weeks %} | |
| <div class="d-card" style="border-radius:20px;background:rgba(6,11,40,0.6);backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,0.05);overflow:hidden;"> | |
| <div style="padding:12px 16px;border-bottom:1px solid rgba(255,255,255,0.05);"> | |
| <span style="font-weight:600;font-size:14px;color:#fff;">Последние синхронизации</span> | |
| </div> | |
| <div style="padding:8px 16px;"> | |
| {% for w in latest_weeks %} | |
| <div style="display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid rgba(255,255,255,0.03);"> | |
| <span style="width:8px;height:8px;border-radius:50%;background:#01B574;"></span> | |
| <span style="color:#fff;">{{ w.strftime('%d.%m.%Y') }}</span> | |
| <a href="{{ url_for('main.kpi_test', month=w.strftime('%Y-%m'), week=w.isoformat()) }}" style="color:#0075FF;font-size:11px;margin-left:auto;">Просмотр</a> | |
| </div> | |
| {% endfor %} | |
| </div> | |
| </div> | |
| {% endif %} | |
| <div style="display:flex;gap:8px;flex-wrap:wrap;margin-top:16px;"> | |
| <a href="{{ url_for('admin.users') }}" class="btn btn-apple" style="border-radius:12px;">Пользователи</a> | |
| <a href="{{ url_for('admin.kpi_list') }}" class="btn btn-apple" style="border-radius:12px;">KPI метрики</a> | |
| <a href="{{ url_for('admin.tasks') }}" class="btn btn-apple" style="border-radius:12px;">Задачи</a> | |
| <a href="{{ url_for('admin.trainings') }}" class="btn btn-apple" style="border-radius:12px;">Обучения</a> | |
| <a href="{{ url_for('admin.audits_list') }}" class="btn btn-apple" style="border-radius:12px;">Аудиты</a> | |
| <a href="{{ url_for('main.kpi_sync_test') }}" class="btn btn-apple" style="border-radius:12px;">Sync Test</a> | |
| </div> | |
| {% endblock %} |