Remove Typer and use Fastapi instead

This commit is contained in:
2022-12-01 21:11:44 +01:00
parent 38b91b9084
commit 3bec59cdb6
9 changed files with 960 additions and 288 deletions

33
templates/feed.html Normal file
View File

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Feed</title>
</head>
<body>
URL: {{feed.url}} <br>
Title: {{feed.title}} <br>
Updated: {{feed.updated}} <br>
Link: {{feed.link}} <br>
Author: {{feed.author}} <br>
Subtitle: {{feed.subtitle}} <br>
Version: {{feed.version}} <br>
User title: {{feed.user_title}} <br>
Added on: {{feed.added}} <br>
Last update: {{feed.last_update}} <br>
Last exception: {{feed.last_exception}} <br>
Updates enabled: {{feed.updates_enabled}} <br>
<form action="/check" method="post">
<button type="submit" name="feed_url" value="{{feed.url}}">
Send new entries to Discord.
</button>
</form>
<form action="/remove" method="post">
<button type="submit" name="feed_url" value="{{feed.url}}">
Remove feed.
</button>
</form>
</body>
</html>

47
templates/index.html Normal file
View File

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<!-- Create a new feed -->
<form action="/add" method="post">
<label>
<input type="text" name="feed_url" placeholder="Feed URL">
</label>
<input type="submit" value="Add feed">
</form>
<!-- List all feeds -->
<ul>
{% for feed in feeds %}
<form action="/feed" method="post">
<button type="submit" name="feed_url" value="{{feed.url}}">
{{ feed.url }}
</button>
</form>
{% endfor %}
</ul>
<ul>
<li>
<p>Feed stats:</p>
<p>Total: {{feed_count.total}} feeds</p>
<p>Broken: {{feed_count.broken}} feeds</p>
<p>Broken: {{feed_count.broken}} feeds</p>
<p>Enabled: {{feed_count.updates_enabled}} feeds</p>
</li>
</ul>
<ul>
<li>
<p>Feed entries:</p>
<p>Total: {{entry_count.total}} entries</p>
<p>Read: {{entry_count.broken}} entries</p>
<p>Enabled: {{entry_count.updates_enabled}} entries</p>
<p>Important: {{entry_count.important}} entries</p>
<p>Has enclosures: {{entry_count.has_enclosures}} entries</p>
</li>
</ul>
</body>
</html>