From c256d903f21f0b9db45c41cfd0677501893902e1 Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Tue, 28 Oct 2025 22:20:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BB=D0=B8=D1=87=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B2=D0=B0=20=D0=B8=D0=B3=D1=80=D0=BE=D0=BA=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=B2=20=D0=B2=D0=B5=D0=B1-=D0=B8=D0=BD=D1=82=D0=B5=D1=80?= =?UTF-8?q?=D1=84=D0=B5=D0=B9=D1=81=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - API теперь возвращает total_gamers (общее количество уникальных игроков) - В интерфейсе по порту 5000 отображается: Всего пользователей и Кол-во игроков --- LichessWebView/app.py | 10 +++++++++- LichessWebView/templates/index.html | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/LichessWebView/app.py b/LichessWebView/app.py index aa1e84d..3e73d85 100644 --- a/LichessWebView/app.py +++ b/LichessWebView/app.py @@ -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: diff --git a/LichessWebView/templates/index.html b/LichessWebView/templates/index.html index 030845b..32400cb 100644 --- a/LichessWebView/templates/index.html +++ b/LichessWebView/templates/index.html @@ -235,7 +235,8 @@

👥 Пользователи

- Всего пользователей: 0 + Всего пользователей: 0
+ Кол-во игроков: 0