modified: app.py

modified:   templates/index.html
This commit is contained in:
SimolZimol
2024-09-03 13:26:16 +02:00
parent 71b3c3e8e5
commit 0273e2cef2
2 changed files with 1 additions and 5 deletions

3
app.py
View File

@@ -74,8 +74,7 @@ def get_db_connection():
@app.route("/") @app.route("/")
def index(): def index():
if "username" in session: if "username" in session:
bot_stats = get_bot_statistics() return render_template("index.html", bot_running=bot_status())
return render_template("index.html", bot_running=bot_status(), **bot_stats)
return redirect(url_for("login")) return redirect(url_for("login"))
@app.route("/login", methods=["GET", "POST"]) @app.route("/login", methods=["GET", "POST"])

View File

@@ -28,9 +28,6 @@
<a href="{{ url_for('users') }}" class="btn btn-info btn-block">User Management</a> <a href="{{ url_for('users') }}" class="btn btn-info btn-block">User Management</a>
<a href="{{ url_for('logout') }}" class="btn btn-outline-secondary btn-block">Logout</a> <a href="{{ url_for('logout') }}" class="btn btn-outline-secondary btn-block">Logout</a>
</div> </div>
<h5 class="card-title">Bot Statistics</h5>
<p class="card-text">Total Messages Processed: {{ total_messages }}</p>
<p class="card-text">Most Used Command: {{ most_used_command }}</p>
</div> </div>
</div> </div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>