pull/271/head
Ryan Barrett 2022-11-09 07:53:00 -08:00
rodzic d8a71c9a9d
commit d743609c6f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
3 zmienionych plików z 31 dodań i 1 usunięć

2
app.py
Wyświetl plik

@ -37,4 +37,4 @@ cache = Cache(app)
util.set_user_agent('Bridgy Fed (https://fed.brid.gy/)')
import activitypub, add_webmention, logs, redirect, render, salmon, superfeedr, webfinger, webmention
import activitypub, add_webmention, pages, redirect, render, salmon, superfeedr, webfinger, webmention

Wyświetl plik

@ -4,6 +4,7 @@ from itertools import islice
import urllib.parse
from flask import render_template, request
from google.cloud.ndb.stats import KindStat
from oauth_dropins.webutil import flask_util, logs, util
from oauth_dropins.webutil.flask_util import error
@ -79,6 +80,16 @@ def responses(domain=None):
return render_template('responses.html', **vars)
@app.get('/stats')
def stats():
return render_template(
'stats.html',
users=KindStat.query(KindStat.kind_name == 'MagicKey').get().count,
responses=KindStat.query(KindStat.kind_name == 'Response').get().count,
followers=KindStat.query(KindStat.kind_name == 'Follower').get().count,
)
@app.get('/log')
@flask_util.cached(cache, logs.CACHE_TIME)
def log():

Wyświetl plik

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Bridgy Fed: Stats</title>
</head>
<body>
<main class="tp-main lead container">
<h1>Bridgy Fed</h1>
<h3>Stats</h3>
<ul>
<li><a href="https://snarfed.org/2017-10-22_bridgy-fed">Launched Octover 17, 2022</a>
<li>{{ users }} users</li>
<li>{{ followers }} fediverse followers</li>
<li>{{ responses }} activities handled</li>
</ul>
</main>
</body>
</html>