Browse Source

Add channel count to #root

master
noirscape 2 years ago
parent
commit
ead889987a
Signed by: noirscape GPG Key ID: 38216818B8894B9F
2 changed files with 5 additions and 2 deletions
  1. +1
    -1
      templates/root.html
  2. +4
    -1
      viewer.py

+ 1
- 1
templates/root.html View File

@ -3,7 +3,7 @@
{% block title %} #root {% endblock %}
{% block content %}
<h2>Statistics</h2>
<p>This database has kept track of <b>{{ total_users }} users</b>, <b>{{ total_guilds }} guilds</b>, <b>{{ total_channels }} channels</b>, <b>{{ total_messages }} messages</b> send (of which <b>{{ total_deletions }}</b> have been deleted).</p>
<p>This database has kept track of <b>{{ total_users }} users</b>, <b>{{ total_guilds }} guilds</b>, <b>{{ total_channels }} channels</b>, <b>{{ total_dm_channels }} DMs</b>, <b>{{ total_messages }} messages</b> send (of which <b>{{ total_deletions }}</b> have been deleted).</p>
<h2>Subendpoints</h2>
<ul>
<li><a href="{{ url_for('list_all_dms') }}">DMs</a></li>


+ 4
- 1
viewer.py View File

@ -124,8 +124,11 @@ def view_root():
total_guilds = db_session.query(db.Guild).count()
total_messages = db_session.query(db.GuildMessage).count() + db_session.query(db.PrivateMessage).count()
total_deletions = db_session.query(db.GuildMessageDeletion).count() + db_session.query(db.PrivateMessageDeletion).count()
total_channels = db_session.query(db.GuildChannel).count()
total_dm_channels = db_session.query(db.DMChannel).count()
return render_template("root.html", total_users=total_users, total_guilds=total_guilds, total_messages=total_messages, total_deletions=total_deletions)
return render_template("root.html", total_users=total_users, total_guilds=total_guilds, total_messages=total_messages, total_deletions=total_deletions,
total_dm_channels=total_dm_channels, total_channels=total_channels)
@register_breadcrumb(app, '.guilds', 'Guilds')
@app.route('/guilds/')