wip
This commit is contained in:
parent
11c7b068e8
commit
ef7f8ac113
5 changed files with 32 additions and 10 deletions
|
@ -1,9 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from os import environ
|
from os import environ
|
||||||
from flask import Flask, request
|
from flask import Flask, request, render_template
|
||||||
from subprocess import check_output
|
|
||||||
import json
|
|
||||||
|
|
||||||
from .pg import query, select
|
from .pg import query, select
|
||||||
|
|
||||||
|
@ -11,10 +9,13 @@ app = Flask(__name__)
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def home():
|
def home():
|
||||||
return str(select(
|
return render_template(
|
||||||
'''
|
"home.html",
|
||||||
SELECT * FROM messages
|
messages=select(
|
||||||
ORDER BY date
|
'''
|
||||||
LIMIT 10
|
SELECT * FROM messages
|
||||||
'''
|
ORDER BY date
|
||||||
))
|
LIMIT 10
|
||||||
|
'''
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
0
steam_chat_viewer/static/icon.svg
Normal file
0
steam_chat_viewer/static/icon.svg
Normal file
0
steam_chat_viewer/static/script.js
Normal file
0
steam_chat_viewer/static/script.js
Normal file
0
steam_chat_viewer/static/style.css
Normal file
0
steam_chat_viewer/static/style.css
Normal file
21
steam_chat_viewer/templates/home.html
Normal file
21
steam_chat_viewer/templates/home.html
Normal 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>
|
Loading…
Reference in a new issue