There is now a page for all the webhooks

This commit is contained in:
2023-01-25 15:52:30 +01:00
parent e5d93e9779
commit 2ae829f9f5
6 changed files with 162 additions and 41 deletions

View File

@ -33,6 +33,9 @@
{% endfor %}
</select>
</div>
<div class="form-text">
You can add more feeds <a class="text-muted" href="/add_webhook">here</a>
</div>
</div>
<!-- Submit button -->
<div class="d-md-flex">

View File

@ -0,0 +1,36 @@
{% extends "base.html" %}
{% block title %}
| Add new webhook
{% endblock title %}
{% block content %}
<div class="p-2 border border-dark">
<form action="/add_webhook" method="post">
{# Webhook name #}
<div class="row pb-2">
<label for="webhook_name" class="col-sm-2 col-form-label">Webhook Name</label>
<div class="col-sm-10">
<input name="webhook_name"
type="text"
class="form-control bg-dark border-dark text-muted"
id="webhook_name"
placeholder="TheLovinator #RSS"/>
</div>
</div>
{# Webhook URL #}
<div class="row pb-2">
<label for="webhook_url" class="col-sm-2 col-form-label">Webhook URL</label>
<div class="col-sm-10">
<input name="webhook_url"
type="text"
class="form-control bg-dark border-dark text-muted"
id="webhook_url"
placeholder="https://discord.com/api/webhooks/1011224189471124054/CQMa4hJN4gz"/>
</div>
</div>
{# Submit button #}
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Add webhook</button>
</div>
</form>
</div>
{% endblock content %}

View File

@ -17,7 +17,7 @@
</li>
<li class="nav-item nav-link d-none d-md-block">|</li>
<li class="nav-item">
<a class="nav-link" href="/webhooks">Add webhook</a>
<a class="nav-link" href="/webhooks">Webhooks</a>
</li>
</ul>
{# Search #}

View File

@ -1,36 +1,46 @@
{% extends "base.html" %}
{% block title %}
| Add new webhook
| Webhooks
{% endblock title %}
{% block content %}
<div class="p-2 border border-dark">
<form action="/add_webhook" method="post">
{# Webhook name #}
<div class="row pb-2">
<label for="webhook_name" class="col-sm-2 col-form-label">Webhook Name</label>
<div class="col-sm-10">
<input name="webhook_name"
type="text"
class="form-control bg-dark border-dark text-muted"
id="webhook_name"
placeholder="TheLovinator #RSS"/>
</div>
{# List all available webhooks #}
<h3>Available webhooks</h3>
<ul class="list-inline">
<a class="btn btn-primary" href="/add_webhook">Add new</a>
<br/>
{% for hook in hooks_with_data %}
<div class="p-2 border border-dark text-muted">
<img src="https://cdn.discordapp.com/avatars/{{ hook.id }}/{{ hook.avatar }}.webp"
class="img-thumbnail">
<h3>{{ hook.custom_name }}</h3>
<li>
<strong>Name</strong>: {{ hook.name }}
</li>
<li>
<strong>Channel ID</strong>: {{ hook.channel_id }}
</li>
<li>
<strong>Guild ID</strong>: {{ hook.guild_id }}
</li>
<li>
<strong>Webhook ID</strong>: {{ hook.id }}
</li>
<li>
<strong>Webhook token</strong>: {{ hook.token }}
</li>
<li>
<strong>Webhook type</strong>: {{ hook.type }}
</li>
<li>
<strong>Webhook URL</strong>: <a href="{{ hook.url }}">{{ hook.url }}</a>
</li>
<br/>
<form action="/delete_webhook" method="post">
<input type="hidden" name="webhook_url" value="{{- hook.url -}}"/>
<button type="submit" class="btn btn-danger">Delete</button>
</form>
</div>
{# Webhook URL #}
<div class="row pb-2">
<label for="webhook_url" class="col-sm-2 col-form-label">Webhook URL</label>
<div class="col-sm-10">
<input name="webhook_url"
type="text"
class="form-control bg-dark border-dark text-muted"
id="webhook_url"
placeholder="https://discord.com/api/webhooks/1011224189471124054/CQMa4hJN4gz"/>
</div>
</div>
{# Submit button #}
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Add webhook</button>
</div>
</form>
</div>
<br/>
{% endfor %}
</ul>
{% endblock content %}