ui: drop misleading homepage stats (active users, active rooms)
Active Users counted all-time distinct UserSession usernames, not anyone currently online. Active Rooms counted any room that ever received a single message, with no decay. Both read as live metrics but aren't. Keep Public Rooms and (when signed in) Private Rooms — those are real counts users can verify by browsing.
This commit is contained in:
parent
f2ebfc16a0
commit
d405ebc6f9
2 changed files with 0 additions and 20 deletions
12
app.py
12
app.py
|
|
@ -650,27 +650,15 @@ def favicon():
|
|||
|
||||
@app.route("/")
|
||||
def index():
|
||||
# Get statistics for homepage
|
||||
total_public_rooms = Room.query.filter_by(is_private=False, is_archived=False).count()
|
||||
total_private_rooms = 0
|
||||
user = auth.get_current_user()
|
||||
if user:
|
||||
total_private_rooms = Room.query.filter_by(is_private=True, is_archived=False, owner_id=user.id).count()
|
||||
|
||||
# Active rooms - rooms with at least one message
|
||||
active_public_rooms = db.session.query(Room.id).join(Message).filter(
|
||||
Room.is_private == False,
|
||||
Room.is_archived == False
|
||||
).distinct().count()
|
||||
|
||||
# Total active users (from UserSession)
|
||||
active_users = UserSession.query.distinct(UserSession.username).count()
|
||||
|
||||
stats = {
|
||||
'total_public_rooms': total_public_rooms,
|
||||
'total_private_rooms': total_private_rooms,
|
||||
'active_public_rooms': active_public_rooms,
|
||||
'active_users': active_users,
|
||||
}
|
||||
|
||||
return render_template("index.html", stats=stats, user=user)
|
||||
|
|
|
|||
|
|
@ -187,14 +187,6 @@
|
|||
<div class="stat-label">Private Rooms</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="stat-card">
|
||||
<div class="stat-number">{{ stats.active_public_rooms }}</div>
|
||||
<div class="stat-label">Active Rooms</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-number">{{ stats.active_users }}</div>
|
||||
<div class="stat-label">Active Users</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Auth status -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue