47c7f17c90
— RPU v2: бюджет удачи, потолок (ceiling), комбек после проигрышей, hot/cold анализ, интеграция с promo-фазами — Bank API: mock-банк для карты (депозит/вывод с балансом 1000₽) — Promo-сервис: автогенерация промокодов каждый час, типы (card_to_site, luck_boost, ceiling_boost, free_case, reset_streak) — Promo-фазы: LUCKY/NEUTRAL/UNLUCKY, переключение каждые 1-6ч — Admin: история транзакций (user_history), управление промокодами, управление promo-фазами, API фильтров/коллекций, RPU info — Database: WAL mode, новые поля RPU v2, TransactionLog, карточный баланс, статистики (streaks, ceiling, budget) — Frontend: /deposit, /promo/activate, /withdraw, /card-balance, /online-count, /rpu-info, lifespan вместо startup event — UI: user_history.html, улучшения профиля, кейсов, навигации — Cases: обновление cases.json (1892 строки новых данных) — Achievements: кэш коллекций, оптимизация is_custom проверок — Sounds: дополнительные звуковые эффекты — Upgrade: интеграция с RPU (множители, streaks) — .gitignore: исключены .db, .bak, __pycache__
505 lines
17 KiB
HTML
505 lines
17 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}Админ-панель{% endblock %} — CS2 Simulator</title>
|
|
<link rel="stylesheet" href="/static/css/style.css">
|
|
<style>
|
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
html { font-size: 15px; }
|
|
body {
|
|
background: #0b0c10;
|
|
color: #e8e8e8;
|
|
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
min-height: 100vh;
|
|
display: flex;
|
|
}
|
|
|
|
/* ─── Sidebar ─── */
|
|
.admin-sidebar {
|
|
width: 240px;
|
|
min-height: 100vh;
|
|
background: linear-gradient(180deg, #111216 0%, #0d0e12 100%);
|
|
border-right: 1px solid rgba(255,255,255,0.04);
|
|
display: flex;
|
|
flex-direction: column;
|
|
position: sticky; top: 0; height: 100vh;
|
|
flex-shrink: 0;
|
|
z-index: 50;
|
|
transition: transform 0.25s ease;
|
|
}
|
|
.admin-sidebar .sb-brand {
|
|
padding: 1.25rem 1.25rem 0.75rem;
|
|
font-size: 1rem;
|
|
font-weight: 700;
|
|
letter-spacing: 0.02em;
|
|
display: flex; align-items: center; gap: 0.5rem;
|
|
border-bottom: 1px solid rgba(255,255,255,0.04);
|
|
}
|
|
.admin-sidebar .sb-brand span { color: #f59e0b; }
|
|
.admin-sidebar .sb-nav {
|
|
flex: 1; padding: 0.75rem 0;
|
|
display: flex; flex-direction: column; gap: 0.15rem;
|
|
}
|
|
.admin-sidebar .sb-nav a {
|
|
display: flex; align-items: center; gap: 0.65rem;
|
|
padding: 0.65rem 1.25rem;
|
|
font-size: 0.85rem;
|
|
color: rgba(255,255,255,0.55);
|
|
text-decoration: none;
|
|
transition: all 0.15s;
|
|
border-left: 2px solid transparent;
|
|
font-weight: 450;
|
|
}
|
|
.admin-sidebar .sb-nav a:hover {
|
|
color: rgba(255,255,255,0.85);
|
|
background: rgba(255,255,255,0.03);
|
|
}
|
|
.admin-sidebar .sb-nav a.active {
|
|
color: #f59e0b;
|
|
background: rgba(245,158,11,0.06);
|
|
border-left-color: #f59e0b;
|
|
}
|
|
.admin-sidebar .sb-nav a .sb-icon { font-size: 1rem; width: 20px; text-align: center; }
|
|
.admin-sidebar .sb-footer {
|
|
padding: 0.75rem 1.25rem;
|
|
border-top: 1px solid rgba(255,255,255,0.04);
|
|
font-size: 0.75rem;
|
|
color: rgba(255,255,255,0.3);
|
|
}
|
|
.admin-sidebar .sb-footer a {
|
|
color: rgba(255,255,255,0.5);
|
|
text-decoration: none;
|
|
display: flex; align-items: center; gap: 0.4rem;
|
|
}
|
|
.admin-sidebar .sb-footer a:hover { color: #f59e0b; }
|
|
|
|
/* ─── Sidebar overlay for mobile ─── */
|
|
.sidebar-overlay {
|
|
display: none;
|
|
position: fixed; inset: 0;
|
|
background: rgba(0,0,0,0.5);
|
|
z-index: 49;
|
|
}
|
|
.sidebar-overlay.open { display: block; }
|
|
|
|
/* ─── Hamburger ─── */
|
|
.hamburger {
|
|
display: none;
|
|
background: none;
|
|
border: none;
|
|
color: rgba(255,255,255,0.6);
|
|
font-size: 1.3rem;
|
|
cursor: pointer;
|
|
padding: 0.25rem;
|
|
line-height: 1;
|
|
}
|
|
.hamburger:hover { color: #fff; }
|
|
|
|
/* ─── Main area ─── */
|
|
.admin-main {
|
|
flex: 1;
|
|
min-width: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
.admin-topbar {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
padding: 0.85rem 1.5rem;
|
|
background: rgba(17,18,22,0.8);
|
|
backdrop-filter: blur(8px);
|
|
-webkit-backdrop-filter: blur(8px);
|
|
border-bottom: 1px solid rgba(255,255,255,0.04);
|
|
position: sticky; top: 0; z-index: 10;
|
|
gap: 0.75rem;
|
|
}
|
|
.admin-topbar .at-title {
|
|
font-size: 1rem; font-weight: 600;
|
|
display: flex; align-items: center; gap: 0.5rem;
|
|
}
|
|
.admin-topbar .at-title .at-sub {
|
|
font-size: 0.75rem; color: rgba(255,255,255,0.35);
|
|
font-weight: 400;
|
|
}
|
|
.admin-topbar .at-actions {
|
|
display: flex; align-items: center; gap: 0.75rem;
|
|
margin-left: auto;
|
|
}
|
|
.admin-topbar .at-actions .at-back {
|
|
color: rgba(255,255,255,0.5); text-decoration: none;
|
|
font-size: 0.8rem; display: flex; align-items: center; gap: 0.3rem;
|
|
transition: color 0.15s;
|
|
}
|
|
.admin-topbar .at-actions .at-back:hover { color: #f59e0b; }
|
|
.admin-topbar .at-actions .at-user {
|
|
color: rgba(255,255,255,0.5); font-size: 0.8rem;
|
|
display: flex; align-items: center; gap: 0.3rem;
|
|
}
|
|
|
|
.admin-content {
|
|
flex: 1;
|
|
padding: 1.5rem;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
/* ─── Cards ─── */
|
|
.a-card {
|
|
background: rgba(17,18,22,0.6);
|
|
border: 1px solid rgba(255,255,255,0.05);
|
|
border-radius: 12px;
|
|
padding: 1.25rem;
|
|
margin-bottom: 1.25rem;
|
|
}
|
|
.a-card-header {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
margin-bottom: 1rem;
|
|
font-size: 0.85rem; font-weight: 600;
|
|
color: rgba(255,255,255,0.7);
|
|
}
|
|
|
|
/* ─── Stats grid ─── */
|
|
.a-stats {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
|
|
gap: 1rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
.a-stat {
|
|
background: rgba(17,18,22,0.6);
|
|
border: 1px solid rgba(255,255,255,0.05);
|
|
border-radius: 12px;
|
|
padding: 1.25rem;
|
|
display: flex; flex-direction: column; gap: 0.25rem;
|
|
position: relative; overflow: hidden;
|
|
}
|
|
.a-stat .as-label {
|
|
font-size: 0.7rem; text-transform: uppercase;
|
|
letter-spacing: 0.06em;
|
|
color: rgba(255,255,255,0.35);
|
|
}
|
|
.a-stat .as-value {
|
|
font-size: 1.8rem; font-weight: 700;
|
|
line-height: 1.1;
|
|
word-break: break-word;
|
|
}
|
|
.a-stat .as-bar {
|
|
position: absolute; bottom: 0; left: 0; height: 2px;
|
|
border-radius: 0 2px 0 0;
|
|
transition: width 0.6s ease;
|
|
}
|
|
.a-stat .as-sub {
|
|
font-size: 0.75rem; color: rgba(255,255,255,0.35);
|
|
}
|
|
|
|
/* ─── Tables ─── */
|
|
.a-table-wrap {
|
|
overflow-x: auto;
|
|
border: 1px solid rgba(255,255,255,0.05);
|
|
border-radius: 10px;
|
|
}
|
|
.a-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
font-size: 0.82rem;
|
|
}
|
|
.a-table th {
|
|
text-align: left;
|
|
padding: 0.7rem 0.9rem;
|
|
font-weight: 600;
|
|
font-size: 0.7rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
color: rgba(255,255,255,0.35);
|
|
background: rgba(0,0,0,0.2);
|
|
border-bottom: 1px solid rgba(255,255,255,0.04);
|
|
}
|
|
.a-table td {
|
|
padding: 0.65rem 0.9rem;
|
|
border-bottom: 1px solid rgba(255,255,255,0.03);
|
|
vertical-align: middle;
|
|
}
|
|
.a-table tr:last-child td { border-bottom: none; }
|
|
.a-table tr:hover td { background: rgba(255,255,255,0.02); }
|
|
.a-table .td-actions {
|
|
display: flex; gap: 0.35rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
/* ─── Responsive tables: card view on mobile ─── */
|
|
.a-table-card-view {
|
|
display: none;
|
|
}
|
|
|
|
/* ─── Buttons ─── */
|
|
.a-btn {
|
|
display: inline-flex; align-items: center; gap: 0.35rem;
|
|
padding: 0.45rem 0.9rem;
|
|
border: 1px solid rgba(255,255,255,0.08);
|
|
border-radius: 7px;
|
|
font-size: 0.78rem;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: all 0.15s;
|
|
background: rgba(255,255,255,0.04);
|
|
color: rgba(255,255,255,0.7);
|
|
text-decoration: none;
|
|
line-height: 1.3;
|
|
white-space: nowrap;
|
|
}
|
|
.a-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); color: #fff; }
|
|
.a-btn-primary {
|
|
background: rgba(245,158,11,0.12);
|
|
border-color: rgba(245,158,11,0.2);
|
|
color: #f59e0b;
|
|
}
|
|
.a-btn-primary:hover { background: rgba(245,158,11,0.2); border-color: #f59e0b; }
|
|
.a-btn-danger {
|
|
background: rgba(239,68,68,0.1);
|
|
border-color: rgba(239,68,68,0.15);
|
|
color: #ef4444;
|
|
}
|
|
.a-btn-danger:hover { background: rgba(239,68,68,0.2); border-color: #ef4444; }
|
|
.a-btn-success {
|
|
background: rgba(34,197,94,0.1);
|
|
border-color: rgba(34,197,94,0.15);
|
|
color: #22c55e;
|
|
}
|
|
.a-btn-success:hover { background: rgba(34,197,94,0.2); border-color: #22c55e; }
|
|
.a-btn-sm { padding: 0.3rem 0.55rem; font-size: 0.7rem; }
|
|
.a-btn:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
|
|
/* ─── Form inputs ─── */
|
|
.a-input {
|
|
background: rgba(0,0,0,0.3);
|
|
border: 1px solid rgba(255,255,255,0.08);
|
|
border-radius: 7px;
|
|
padding: 0.5rem 0.75rem;
|
|
color: #e8e8e8;
|
|
font-size: 0.82rem;
|
|
outline: none;
|
|
transition: border-color 0.15s;
|
|
width: 100%;
|
|
}
|
|
.a-input:focus { border-color: rgba(245,158,11,0.4); }
|
|
.a-input-sm { padding: 0.35rem 0.5rem; font-size: 0.78rem; }
|
|
.a-label {
|
|
display: block;
|
|
font-size: 0.75rem;
|
|
font-weight: 600;
|
|
color: rgba(255,255,255,0.5);
|
|
margin-bottom: 0.35rem;
|
|
}
|
|
select.a-input { cursor: pointer; }
|
|
|
|
/* ─── Badge ─── */
|
|
.a-badge {
|
|
display: inline-flex;
|
|
padding: 0.15rem 0.45rem;
|
|
border-radius: 4px;
|
|
font-size: 0.7rem;
|
|
font-weight: 600;
|
|
}
|
|
.a-badge-admin { background: rgba(245,158,11,0.12); color: #f59e0b; }
|
|
.a-badge-user { background: rgba(59,130,246,0.12); color: #60a5fa; }
|
|
.a-badge-banned { background: rgba(239,68,68,0.12); color: #ef4444; }
|
|
|
|
/* ─── Modal ─── */
|
|
.a-overlay {
|
|
position: fixed; inset: 0;
|
|
background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
|
|
-webkit-backdrop-filter: blur(4px);
|
|
z-index: 100; display: none; align-items: center; justify-content: center;
|
|
padding: 1rem;
|
|
}
|
|
.a-overlay.open { display: flex; }
|
|
.a-modal {
|
|
background: #16171d;
|
|
border: 1px solid rgba(255,255,255,0.06);
|
|
border-radius: 16px;
|
|
padding: 1.5rem;
|
|
max-width: 460px; width: 100%;
|
|
box-shadow: 0 20px 60px rgba(0,0,0,0.5);
|
|
max-height: 90vh; overflow-y: auto;
|
|
}
|
|
.a-modal-wide { max-width: 700px; }
|
|
.a-modal-title {
|
|
font-size: 1rem; font-weight: 600; margin-bottom: 1rem;
|
|
}
|
|
.a-modal-actions {
|
|
display: flex; gap: 0.5rem; margin-top: 1rem;
|
|
justify-content: flex-end;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
/* ─── Grid helpers ─── */
|
|
.a-row { display: flex; gap: 1rem; flex-wrap: wrap; }
|
|
.a-row > * { flex: 1; min-width: 0; }
|
|
.a-gap-sm { gap: 0.5rem; }
|
|
.a-mt { margin-top: 1rem; }
|
|
.a-mb { margin-bottom: 1rem; }
|
|
.a-flex { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
|
|
|
|
/* ─── Search in top bar ─── */
|
|
.search-form {
|
|
display: flex; gap: 0.5rem; align-items: center;
|
|
}
|
|
.search-form .a-input { width: 200px; }
|
|
.search-form .a-btn { flex-shrink: 0; }
|
|
|
|
/* ─── Empty state ─── */
|
|
.a-empty {
|
|
text-align: center; padding: 3rem 1rem;
|
|
color: rgba(255,255,255,0.3);
|
|
}
|
|
.a-empty .a-empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
|
|
|
|
/* ─── Responsive ─── */
|
|
@media(max-width: 1024px){
|
|
.admin-sidebar { width: 200px; }
|
|
}
|
|
|
|
@media(max-width: 768px){
|
|
.admin-sidebar {
|
|
position: fixed; left: 0; top: 0;
|
|
transform: translateX(-100%);
|
|
width: 260px;
|
|
box-shadow: 4px 0 30px rgba(0,0,0,0.4);
|
|
}
|
|
.admin-sidebar.open { transform: translateX(0); }
|
|
.admin-content { padding: 1rem; }
|
|
.admin-topbar { padding: 0.7rem 1rem; }
|
|
.admin-topbar .at-title .at-sub { display: none; }
|
|
|
|
.hamburger { display: inline-flex; }
|
|
|
|
.a-stats {
|
|
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|
gap: 0.75rem;
|
|
}
|
|
.a-stat { padding: 1rem; }
|
|
.a-stat .as-value { font-size: 1.4rem; }
|
|
|
|
.search-form .a-input { width: 140px; }
|
|
|
|
.a-modal { margin: 0.5rem; padding: 1rem; border-radius: 12px; }
|
|
|
|
/* Card-style table on mobile */
|
|
.a-table { display: none; }
|
|
.a-table-card-view { display: flex; flex-direction: column; gap: 0.75rem; }
|
|
.a-table-card {
|
|
background: rgba(17,18,22,0.6);
|
|
border: 1px solid rgba(255,255,255,0.05);
|
|
border-radius: 10px;
|
|
padding: 0.85rem;
|
|
font-size: 0.82rem;
|
|
}
|
|
.a-table-card .tc-row {
|
|
display: flex; justify-content: space-between;
|
|
padding: 0.25rem 0;
|
|
gap: 0.5rem;
|
|
}
|
|
.a-table-card .tc-row .tc-label {
|
|
color: rgba(255,255,255,0.35);
|
|
font-size: 0.72rem;
|
|
flex-shrink: 0;
|
|
}
|
|
.a-table-card .tc-row .tc-value {
|
|
text-align: right;
|
|
word-break: break-word;
|
|
}
|
|
.a-table-card .tc-actions {
|
|
margin-top: 0.5rem; padding-top: 0.5rem;
|
|
border-top: 1px solid rgba(255,255,255,0.04);
|
|
display: flex; gap: 0.35rem; flex-wrap: wrap;
|
|
}
|
|
}
|
|
|
|
@media(max-width: 480px){
|
|
html { font-size: 14px; }
|
|
.admin-content { padding: 0.75rem; }
|
|
.admin-topbar { padding: 0.6rem 0.75rem; }
|
|
.a-stats { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
|
|
.a-stat { padding: 0.75rem; }
|
|
.a-stat .as-value { font-size: 1.2rem; }
|
|
.a-card { padding: 0.85rem; }
|
|
.search-form { width: 100%; }
|
|
.search-form .a-input { width: 100%; }
|
|
}
|
|
{% block extra_styles %}{% endblock %}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="sidebar-overlay" id="sidebarOverlay"></div>
|
|
|
|
<div class="admin-sidebar" id="adminSidebar">
|
|
<div class="sb-brand">
|
|
<span style="font-size:1.2rem">⚡</span>
|
|
<span>CS2 <span>Admin</span></span>
|
|
</div>
|
|
<nav class="sb-nav">
|
|
<a href="/admin" class="{% block nav_dashboard %}{% endblock %}">
|
|
<span class="sb-icon">📊</span> <span>Дашборд</span>
|
|
</a>
|
|
<a href="/admin/users" class="{% block nav_users %}{% endblock %}">
|
|
<span class="sb-icon">👥</span> <span>Пользователи</span>
|
|
</a>
|
|
<a href="/admin/cases" class="{% block nav_cases %}{% endblock %}">
|
|
<span class="sb-icon">📦</span> <span>Кейсы</span>
|
|
</a>
|
|
</nav>
|
|
<div class="sb-footer">
|
|
<a href="/">← <span>На сайт</span></a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="admin-main">
|
|
<div class="admin-topbar">
|
|
<div class="at-title">
|
|
<button class="hamburger" id="hamburgerBtn" aria-label="Toggle menu">☰</button>
|
|
{% block page_title %}Панель управления{% endblock %}
|
|
</div>
|
|
<div class="at-actions">
|
|
{% block top_actions %}{% endblock %}
|
|
</div>
|
|
</div>
|
|
<div class="admin-content">
|
|
{% block content %}{% endblock %}
|
|
</div>
|
|
</div>
|
|
|
|
{% block modals %}{% endblock %}
|
|
<script src="/static/js/notifications.js"></script>
|
|
<script>
|
|
(function() {
|
|
const sidebar = document.getElementById('adminSidebar');
|
|
const overlay = document.getElementById('sidebarOverlay');
|
|
const hamburger = document.getElementById('hamburgerBtn');
|
|
|
|
function toggleSidebar() {
|
|
sidebar.classList.toggle('open');
|
|
overlay.classList.toggle('open');
|
|
}
|
|
|
|
if (hamburger) {
|
|
hamburger.addEventListener('click', toggleSidebar);
|
|
}
|
|
if (overlay) {
|
|
overlay.addEventListener('click', toggleSidebar);
|
|
}
|
|
|
|
// Auto-close sidebar on nav click (mobile)
|
|
sidebar.querySelectorAll('.sb-nav a').forEach(function(link) {
|
|
link.addEventListener('click', function() {
|
|
if (window.innerWidth <= 768) {
|
|
toggleSidebar();
|
|
}
|
|
});
|
|
});
|
|
})();
|
|
</script>
|
|
{% block scripts %}{% endblock %}
|
|
</body>
|
|
</html>
|