File size: 22,047 Bytes
7ef7240 9d4e305 7ef7240 b8bd724 7ef7240 b8bd724 9d4e305 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 b8bd724 7ef7240 9d4e305 7ef7240 9d4e305 b8bd724 7ef7240 b8bd724 7ef7240 9d4e305 7ef7240 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | <!DOCTYPE html>
<html lang="hu" class="h-full">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Panel | Verbumix</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
'game-bg': 'var(--bg-primary)',
'game-card': 'var(--bg-card)',
'game-text': 'var(--text-primary)',
}
}
}
}
</script>
<link rel="stylesheet" href="/static/css/theme.css">
<script src="/static/js/theme.js"></script>
<style>
.stat-card {
transition: all 0.3s ease;
}
.stat-card:hover {
transform: translateY(-2px);
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}
.progress-bar {
transition: width 1s ease-in-out;
}
</style>
</head>
<body class="flex flex-col h-full font-sans antialiased transition-colors duration-300" style="background-color: var(--bg-primary); color: var(--text-primary);">
<!-- Header -->
<header class="border-b border-game bg-card dark:bg-game px-6 py-4 flex justify-between items-center shadow-sm">
<div class="flex items-center gap-3">
<div class="p-2 bg-card rounded-lg">
<span class="text-xl"></span>
</div>
<div>
<h1 class="text-lg font-bold text-game">Admin Panel</h1>
<p class="text-xs text-muted">Rendszerfelügyelet</p>
</div>
</div>
<div class="flex items-center gap-4">
<button class="theme-toggle p-2 hover:bg-gray-100 dark:hover:bg-card rounded-lg transition" aria-label="Téma váltása" title="Téma váltása">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 text-muted">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" />
</svg>
</button>
<a href="/" class="text-sm text-muted hover:text-green-600 dark:hover:text-accent transition flex items-center gap-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3" />
</svg>
Vissza
</a>
</div>
</header>
<main class="flex-1 p-6 overflow-auto">
<div class="max-w-7xl mx-auto space-y-6">
<!-- Fő statisztikák -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
<!-- Felhasználók -->
<div class="stat-card bg-card dark:bg-card rounded-xl p-5 shadow-sm border border-game dark:border-game">
<div class="flex items-center justify-between mb-3">
<span class="text-sm font-medium text-muted">Felhasználók</span>
<div class="p-2 bg-blue-100 dark:bg-blue-900/30 rounded-lg">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 text-blue-600 dark:text-blue-400">
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.652.372 9.337 9.337 0 004.121-.621 9.342 9.342 0 001.936-.736 9.332 9.332 0 001.935-.736 9.337 9.337 0 004.121-.621 9.38 9.38 0 002.652-.372" />
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 00-2.652.372 9.337 9.337 0 00-4.121-.621 9.342 9.342 0 00-1.936-.736 9.332 9.332 0 00-1.935-.736 9.337 9.337 0 00-4.121-.621 9.38 9.38 0 00-2.652-.372" />
<circle cx="9" cy="9" r="3.75" />
<circle cx="15" cy="9" r="3.75" />
</svg>
</div>
</div>
<p class="text-2xl font-bold text-game">{{ user_count }}</p>
<p class="text-xs text-muted mt-1">Összes regisztrált</p>
</div>
<!-- Szavak -->
<div class="stat-card bg-card dark:bg-card rounded-xl p-5 shadow-sm border border-game dark:border-game">
<div class="flex items-center justify-between mb-3">
<span class="text-sm font-medium text-muted">Szavak</span>
<div class="p-2 bg-card rounded-lg">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 text-accent">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0118 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25" />
</svg>
</div>
</div>
<p class="text-2xl font-bold text-game">{{ total_words }}</p>
<p class="text-xs text-muted mt-1">Adatbázisban</p>
</div>
<!-- Nyelvek -->
<div class="stat-card bg-card dark:bg-card rounded-xl p-5 shadow-sm border border-game dark:border-game">
<div class="flex items-center justify-between mb-3">
<span class="text-sm font-medium text-muted">Nyelvek</span>
<div class="p-2 bg-purple-100 dark:bg-purple-900/30 rounded-lg">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 text-purple-600 dark:text-purple-400">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-.778.099-1.533.284-2.253" />
</svg>
</div>
</div>
<p class="text-2xl font-bold text-game">90+</p>
<p class="text-xs text-muted mt-1">Támogatott</p>
</div>
<!-- Rendszer -->
<div class="stat-card bg-card dark:bg-card rounded-xl p-5 shadow-sm border border-game dark:border-game">
<div class="flex items-center justify-between mb-3">
<span class="text-sm font-medium text-muted">Rendszer</span>
<div class="p-2 bg-card rounded-lg">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 text-accent">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z" />
</svg>
</div>
</div>
<div class="flex items-center gap-2">
<span class="relative flex h-3 w-3">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"></span>
<span class="relative inline-flex rounded-full h-3 w-3 btn-accent"></span>
</span>
<p class="text-lg font-bold text-accent">Online</p>
</div>
<p class="text-xs text-muted mt-1">Minden rendszer működik</p>
</div>
</div>
<!-- Speciális statisztikák -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<!-- Kategória eloszlás -->
<div class="bg-card dark:bg-card rounded-xl p-6 shadow-sm border border-game dark:border-game">
<h3 class="text-lg font-bold text-game mb-4 flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 text-muted">
<path stroke-linecap="round" stroke-linejoin="round" d="M10.5 6a7.5 7.5 0 107.5 7.5h-7.5V6z" />
<path stroke-linecap="round" stroke-linejoin="round" d="M13 7.5a7.5 7.5 0 00-7.5-7.5c-4.142 0-7.5 3.358-7.5 7.5 0 4.142 3.358 7.5 7.5 7.5H13z" />
</svg>
Kategória eloszlás
</h3>
<div class="space-y-4">
<!-- Szlen -->
<div>
<div class="flex justify-between text-sm mb-1">
<span class="text-muted"> Szlen</span>
<span class="font-medium text-game">~33%</span>
</div>
<div class="w-full bg-gray-200 dark:bg-card rounded-full h-2">
<div class="progress-bar bg-gradient-to-r from-orange-500 to-red-500 h-2 rounded-full" style="width: 33%"></div>
</div>
</div>
<!-- Matek -->
<div>
<div class="flex justify-between text-sm mb-1">
<span class="text-muted"> Matek</span>
<span class="font-medium text-game">~33%</span>
</div>
<div class="w-full bg-gray-200 dark:bg-card rounded-full h-2">
<div class="progress-bar bg-gradient-to-r from-blue-500 to-indigo-500 h-2 rounded-full" style="width: 33%"></div>
</div>
</div>
<!-- Gamer -->
<div>
<div class="flex justify-between text-sm mb-1">
<span class="text-muted"> Gamer</span>
<span class="font-medium text-game">~34%</span>
</div>
<div class="w-full bg-gray-200 dark:bg-card rounded-full h-2">
<div class="progress-bar bg-gradient-to-r from-purple-500 to-pink-500 h-2 rounded-full" style="width: 34%"></div>
</div>
</div>
</div>
</div>
<!-- Nyelvi támogatás -->
<div class="bg-card dark:bg-card rounded-xl p-6 shadow-sm border border-game dark:border-game">
<h3 class="text-lg font-bold text-game mb-4 flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 text-muted">
<path stroke-linecap="round" stroke-linejoin="round" d="M10.5 21l5.25-11.25L21 21m-9-3h7.5M3 5.621a48.474 48.474 0 016-3.422c1.5 0 3 .12 4.5.361m-10.5 3.061a48.474 48.474 0 00-4.5.361m15 0a48.474 48.474 0 014.5-.361m-15 0a48.474 48.474 0 00-4.5.361m15 0c1.5 0 3 .12 4.5.361m-15 0a48.474 48.474 0 016-3.422" />
</svg>
Nyelvi támogatás
</h3>
<div class="grid grid-cols-3 gap-3">
<div class="text-center p-3 bg-gray-50 dark:bg-card/50 rounded-lg">
<p class="text-2xl font-bold text-game">90+</p>
<p class="text-xs text-muted">Nyelv</p>
</div>
<div class="text-center p-3 bg-gray-50 dark:bg-card/50 rounded-lg">
<p class="text-2xl font-bold text-game">100+</p>
<p class="text-xs text-muted">Ország</p>
</div>
<div class="text-center p-3 bg-gray-50 dark:bg-card/50 rounded-lg">
<p class="text-2xl font-bold text-game">6</p>
<p class="text-xs text-muted">Kontinens</p>
</div>
</div>
<div class="mt-4 flex flex-wrap gap-2">
<span class="px-2 py-1 bg-card text-green-700 dark:text-green-300 text-xs rounded-full">Angol</span>
<span class="px-2 py-1 bg-card text-green-700 dark:text-green-300 text-xs rounded-full">Német</span>
<span class="px-2 py-1 bg-card text-green-700 dark:text-green-300 text-xs rounded-full">Francia</span>
<span class="px-2 py-1 bg-card text-green-700 dark:text-green-300 text-xs rounded-full">Spanyol</span>
<span class="px-2 py-1 bg-card text-green-700 dark:text-green-300 text-xs rounded-full">Japán</span>
<span class="px-2 py-1 bg-card text-green-700 dark:text-green-300 text-xs rounded-full">Kínai</span>
<span class="px-2 py-1 bg-gray-100 dark:bg-card text-muted text-xs rounded-full">+84</span>
</div>
</div>
</div>
<!-- Új szó hozzáadása -->
<div class="bg-card dark:bg-card rounded-xl p-6 shadow-sm border border-game dark:border-game">
<h3 class="text-lg font-bold text-game mb-4 flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 text-muted">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
</svg>
Új szó hozzáadása
</h3>
<form hx-post="/a7d9f2e1b4c6/add-word" hx-target="#message-area" class="flex gap-3 flex-wrap items-end">
<div class="flex-1 min-w-[200px]">
<label class="block text-sm font-medium text-game mb-1">Szó</label>
<input type="text" name="word" placeholder="pl. CRING" class="w-full px-4 py-2.5 bg-gray-50 dark:bg-card border border-game dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-green-500 text-game placeholder-gray-400" required>
</div>
<div class="w-40">
<label class="block text-sm font-medium text-game mb-1">Kategória</label>
<select name="category" class="w-full px-4 py-2.5 bg-gray-50 dark:bg-card border border-game dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-green-500 text-game">
<option value="szleng">Szlen</option>
<option value="matek">Matek</option>
<option value="gamer">Gamer</option>
</select>
</div>
<button type="submit" class="px-6 py-2.5 btn-accent text-game font-medium rounded-lg transition-colors flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
</svg>
Hozzáad
</button>
</form>
<div id="message-area" class="mt-4"></div>
</div>
<!-- Legutóbbi szavak -->
<div class="bg-card dark:bg-card rounded-xl p-6 shadow-sm border border-game dark:border-game">
<h3 class="text-lg font-bold text-game mb-4 flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 text-muted">
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12" />
</svg>
Legutóbb hozzáadott szavak
</h3>
{% if recent_words %}
<div class="overflow-x-auto">
<table class="w-full">
<thead>
<tr class="border-b border-game dark:border-game">
<th class="text-left py-3 px-4 font-semibold text-sm text-muted">Szó</th>
<th class="text-left py-3 px-4 font-semibold text-sm text-muted">Kategória</th>
<th class="text-right py-3 px-4 font-semibold text-sm text-muted">Művelet</th>
</tr>
</thead>
<tbody class="text-sm">
{% for word in recent_words %}
<tr class="border-b border-gray-100 dark:border-game hover:bg-gray-50 dark:hover:bg-card/50 transition">
<td class="py-3 px-4 text-game font-mono font-medium">{{ word.szo }}</td>
<td class="py-3 px-4">
<span class="px-2.5 py-1 bg-gray-100 dark:bg-card text-xs rounded-full text-game">
{% if word.kategoriak %}
{% if word.kategoriak.nev == 'szleng' %}
{% elif word.kategoriak.nev == 'matek' %}
{% elif word.kategoriak.nev == 'gamer' %}
{% endif %}
{{ word.kategoriak.nev | capitalize }}
{% else %}
N/A
{% endif %}
</span>
</td>
<td class="py-3 px-4 text-right">
<button
hx-delete="/a7d9f2e1b4c6/delete-word/{{ word.id }}"
hx-target="#message-area"
hx-confirm="Biztosan törölni szeretnéd ezt a szót?"
class="px-3 py-1.5 bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 rounded-lg hover:bg-red-100 dark:hover:bg-red-900/40 transition text-sm flex items-center gap-1 ml-auto"
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3.5 h-3.5">
<path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
</svg>
Töröl
</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center py-12">
<div class="text-4xl mb-3"></div>
<p class="text-muted">Még nincsenek szavak az adatbázisban.</p>
<p class="text-sm text-muted mt-1">Adj hozzá az első szót a fenti űrlappal!</p>
</div>
{% endif %}
</div>
</div>
</main>
<!-- Footer -->
<footer class="border-t border-game py-4 px-6 text-center text-xs text-muted">
<div class="flex items-center justify-center gap-4">
<span>Admin Panel v1.0</span>
<span>•</span>
<span>Verbumix © 2024</span>
</div>
</footer>
</body>
</html> |