Добавлено отображение количества игроков в веб-интерфейсе
- API теперь возвращает total_gamers (общее количество уникальных игроков) - В интерфейсе по порту 5000 отображается: Всего пользователей и Кол-во игроков
This commit is contained in:
parent
22a0371fc9
commit
c256d903f2
2 changed files with 13 additions and 3 deletions
|
|
@ -53,10 +53,18 @@ def get_users():
|
|||
'monitored_gamers': row[7]
|
||||
})
|
||||
|
||||
# Получаем общее количество игроков (уникальных)
|
||||
cursor.execute('''
|
||||
SELECT COUNT(DISTINCT g.id)
|
||||
FROM gamers g
|
||||
''')
|
||||
total_gamers = cursor.fetchone()[0]
|
||||
|
||||
return jsonify({
|
||||
'success': True,
|
||||
'users': users,
|
||||
'total': len(users)
|
||||
'total_users': len(users),
|
||||
'total_gamers': total_gamers
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -235,7 +235,8 @@
|
|||
<h1>👥 Пользователи</h1>
|
||||
|
||||
<div class="stats">
|
||||
Всего пользователей: <strong id="total-users">0</strong>
|
||||
Всего пользователей: <strong id="total-users">0</strong><br>
|
||||
Кол-во игроков: <strong id="total-gamers">0</strong>
|
||||
</div>
|
||||
|
||||
<div class="search-box">
|
||||
|
|
@ -278,7 +279,8 @@
|
|||
|
||||
if (data.success) {
|
||||
users = data.users;
|
||||
document.getElementById('total-users').textContent = data.total;
|
||||
document.getElementById('total-users').textContent = data.total_users;
|
||||
document.getElementById('total-gamers').textContent = data.total_gamers;
|
||||
filteredUsers = users;
|
||||
renderUsers();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue