Add config file, dropdown for webhooks, and sends stuff to Discord

This commit is contained in:
2022-12-02 16:47:47 +01:00
parent 3bec59cdb6
commit 400b72dbf4
11 changed files with 328 additions and 187 deletions

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>

View File

@ -0,0 +1,70 @@
<!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>
<label for="webhook_dropdown">Choose:</label>
<select id="webhook_dropdown" name="webhook_dropdown">
{% for hook in webhooks %}
<!-- {{ hook.name }} {{ hook.value }} -->
<option value="{{ hook.name }}">{{ hook.name }}</option>
{% endfor %}
</select>
<input type="submit" value="Add feed">
</form>
<!-- List all feeds -->
{% for tag in tags %}
{{ tag }}
{% endfor %}
<ul>
<!-- Check if any feeds -->
{% if feeds %}
{% for feed in feeds %}
<form action="/feed" method="post">
<button type="submit" name="feed_url" value="{{ feed.url }}">
{{ feed.url }}
</button>
</form>
{% endfor %}
{% else %}
<p>No feeds yet</p>
{% endif %}
</ul>
<!-- Feed stats -->
<hr>
<ul>
<li>
<p>Feed stats:</p>
<p>Total: {{ feed_count.total }} feeds</p>
<p>Broken: {{ feed_count.broken }} feeds</p>
<p>Enabled: {{ feed_count.updates_enabled }} feeds</p>
</li>
</ul>
<!-- Feed entries stats -->
<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>