Enumerate pending follows, fix CSS
This commit is contained in:
parent
8cf17b942b
commit
c8388e0856
1 changed files with 7 additions and 5 deletions
|
@ -25,17 +25,18 @@ def register_route(method, path):
|
||||||
|
|
||||||
@register_route("GET", "/")
|
@register_route("GET", "/")
|
||||||
async def home(request):
|
async def home(request):
|
||||||
targets = "<ul>" + "\n".join(f"<li>{it}</li>" for it in request.app.database.hostnames) + "</ul>"
|
following = "<ul>" + ("\n".join(f"<li>{it}</li>" for it in request.app.database.hostnames)) + "</ul>"
|
||||||
|
following_count = len(request.app.database.hostnames)
|
||||||
|
requested = "<ul>" + ("\n".join(f"<li>{it}</li>" for it in request.app.database["follow-requests"])) + "</ul>"
|
||||||
|
requested_count = len(request.app.database["follow-requests"])
|
||||||
note = request.app.config.note
|
note = request.app.config.note
|
||||||
count = len(request.app.database.hostnames)
|
|
||||||
host = request.app.config.host
|
host = request.app.config.host
|
||||||
|
|
||||||
text = f"""\
|
text = f"""\
|
||||||
<html><head>
|
<html><head>
|
||||||
<title>ActivityPub Relay at {host}</title>
|
<title>ActivityPub Relay at {host}</title>
|
||||||
<style>
|
<style>
|
||||||
p {{ color: #FFFFFF; font-family: monospace, arial; font-size: 100%; }}
|
body {{ background-color: #000000; color: #FFFFFF; font-family: monospace, arial; font-size: 100%; }}
|
||||||
body {{ background-color: #000000; }}
|
|
||||||
a {{ color: #26F; }}
|
a {{ color: #26F; }}
|
||||||
a:visited {{ color: #46C; }}
|
a:visited {{ color: #46C; }}
|
||||||
a:hover {{ color: #8AF; }}
|
a:hover {{ color: #8AF; }}
|
||||||
|
@ -45,7 +46,8 @@ a:hover {{ color: #8AF; }}
|
||||||
<p>This is an Activity Relay for fediverse instances.</p>
|
<p>This is an Activity Relay for fediverse instances.</p>
|
||||||
<p>{note}</p>
|
<p>{note}</p>
|
||||||
<p>To host your own relay, you may download the code at this address: <a href="https://git.arrdem.com/arrdem/source/src/branch/trunk/projects/activitypub_relay">https://git.arrdem.com/arrdem/source/src/branch/trunk/projects/activitypub_relay</a></p>
|
<p>To host your own relay, you may download the code at this address: <a href="https://git.arrdem.com/arrdem/source/src/branch/trunk/projects/activitypub_relay">https://git.arrdem.com/arrdem/source/src/branch/trunk/projects/activitypub_relay</a></p>
|
||||||
<br><p>List of {count} registered instances:<br>{targets}</p>
|
<br><p>This relay is peered with {following_count} registered instances:<br>{following}</p>
|
||||||
|
<br><p>Another {requested_count} peers await approval:<br>{requested}</p>
|
||||||
</body></html>"""
|
</body></html>"""
|
||||||
|
|
||||||
return Response.new(text, ctype="html")
|
return Response.new(text, ctype="html")
|
||||||
|
|
Loading…
Reference in a new issue