This commit is contained in:
mwiegand 2022-06-01 18:19:18 +02:00
parent 11c7b068e8
commit ef7f8ac113
5 changed files with 32 additions and 10 deletions

View file

@ -1,9 +1,7 @@
#!/usr/bin/env python3
from os import environ
from flask import Flask, request
from subprocess import check_output
import json
from flask import Flask, request, render_template
from .pg import query, select
@ -11,10 +9,13 @@ app = Flask(__name__)
@app.route('/')
def home():
return str(select(
return render_template(
"home.html",
messages=select(
'''
SELECT * FROM messages
ORDER BY date
LIMIT 10
'''
))
),
)

View file

View file

View file

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>STEAM Chat Logs</title>
<link rel="icon" type="image/svg+xml" href="{{ url_for('static', filename='icon.svg') }}">
<link rel=stylesheet href="{{ url_for('static', filename='style.css') }}">
<script src="{{ url_for('static', filename='script.js') }}"></script>
</head>
<body>
<header>
<h1 class=logo><a href="{{ url_for('home') }}">STEAM Chat Logs <img src="{{ url_for('static', filename='icon.svg') }}"></a></h1>
</header>
<main>
<ul class=sms_list>
{% for message in messages: -%}
<li>{{ message }}</li>
{% endfor -%}
</ul>
</main>
</body>
</html>