forked from rDrama/rDrama
add charts to the stats page
parent
7f156e09d9
commit
6993f29f0a
|
@ -146,14 +146,14 @@ def participation_stats(v):
|
|||
def chart():
|
||||
return redirect('/weekly_chart')
|
||||
|
||||
@app.get("/weekly_chart")
|
||||
@app.get("/weekly_chart.webp")
|
||||
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
|
||||
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
|
||||
@auth_required
|
||||
def weekly_chart(v):
|
||||
return send_file(statshelper.chart_path(kind="weekly", site=SITE))
|
||||
|
||||
@app.get("/daily_chart")
|
||||
@app.get("/daily_chart.webp")
|
||||
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
|
||||
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
|
||||
@auth_required
|
||||
|
|
|
@ -118,8 +118,6 @@
|
|||
<h4>Statistics</h4>
|
||||
<ul>
|
||||
<li><a href="/stats">Statistics</a></li>
|
||||
<li><a href="/weekly_chart">Weekly Stat Chart</a></li>
|
||||
<li><a href="/daily_chart">Daily Stat Chart</a></li>
|
||||
</ul>
|
||||
|
||||
<h4>Configuration</h4>
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
{% extends "default.html" %}
|
||||
{% block pagetitle %}Statistics{% endblock %}
|
||||
{% block content %}
|
||||
<h3>Weekly Chart</h3>
|
||||
<a href="/weekly_chart.webp" rel="nofollow noopener" target="_blank">
|
||||
<img alt="Weekly Chart" class="img" src="/weekly_chart.webp">
|
||||
</a>
|
||||
|
||||
<h3>Daily Chart</h3>
|
||||
<a href="/daily_chart.webp" rel="nofollow noopener" target="_blank">
|
||||
<img alt="Daily Chart" class="img" src="/daily_chart.webp">
|
||||
</a>
|
||||
|
||||
<div class="overflow-x-auto mt-1">
|
||||
<table class="table table-striped mb-5">
|
||||
<thead class="bg-primary text-white">
|
||||
|
|
Loading…
Reference in New Issue