Implement aliases

This commit is contained in:
2022-07-29 22:22:22 +01:00
parent 755bc66844
commit 362ad579d5
10 changed files with 178 additions and 15 deletions

View File

@@ -0,0 +1,34 @@
<div id="actions">
<div class="buttons">
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
class="button is-success">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-plus"></i>
</span>
<span>Add relay</span>
</span>
</button>
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
class="button is-success">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-wrench"></i>
</span>
<span>Run auto</span>
</span>
</button>
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
class="button is-success">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-list"></i>
</span>
<span>Request list</span>
</span>
</button>
</div>
</div>

View File

@@ -67,7 +67,7 @@
<button
class="button is-primary"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'threshold_irc_network_info' net %}">
hx-get="{% url 'threshold_irc_network_info' net %}">
Cancel
</button>
</div>

View File

@@ -4,7 +4,7 @@
<div
style="display: none;"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'threshold_irc_network_info' net %}"
hx-get="{% url 'threshold_irc_network_info' net %}"
hx-trigger="load, every 5s"
hx-target="#info"
hx-swap="outerHTML">
@@ -22,12 +22,21 @@
<div
style="display: none;"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'threshold_irc_network_channels' net %}"
hx-get="{% url 'threshold_irc_network_channels' net %}"
hx-trigger="load, every 5s"
hx-target="#channels"
hx-swap="outerHTML">
</div>
<div
style="display: none;"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-get="{% url 'threshold_irc_network_actions' net %}"
hx-trigger="load"
hx-target="#actions"
hx-swap="outerHTML">
</div>
<div class="columns">
<div class="column">
<div class="box">
@@ -58,7 +67,7 @@
</div>
</div>
<div class="columns">
<div class="column is-half">
<div class="column">
<div class="box">
<form method="POST">
<div class="field">
@@ -89,5 +98,11 @@
</form>
</div>
</div>
<div class="column">
<div class="box">
<div id="actions">
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,41 @@
{% load joinsep %}
<div id="aliases">
{% if message is not None %}
<div class="notification is-{{ class }}" hx-ext="remove-me" remove-me="3s">
{{ message }}
</div>
{% endif %}
{% if aliases is not None %}
<div class="content" style="max-height: 30em; overflow: auto;">
<div class="table-container">
<table class="table is-fullwidth is-hoverable">
<thead>
<th>num</th>
<th>nick</th>
<th>realname</th>
<th>emails</th>
</thead>
<tbody>
{% for alias in aliases %}
<tr>
<td>
{{ alias.num }}
</td>
<td>
{{ alias.nick }}
</td>
<td>
{{ alias.realname }}
</td>
<td>
{{ alias.emails|joinsep:', ' }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
</div>

View File

@@ -4,7 +4,7 @@
<div
style="display: none;"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'threshold_irc_stats' %}"
hx-get="{% url 'threshold_irc_stats' %}"
hx-trigger="load"
hx-target="#stats"
hx-swap="outerHTML">
@@ -13,12 +13,21 @@
<div
style="display: none;"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'threshold_irc_networks' %}"
hx-get="{% url 'threshold_irc_networks' %}"
hx-trigger="load"
hx-target="#networks"
hx-swap="outerHTML">
</div>
<div
style="display: none;"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-get="{% url 'threshold_irc_aliases' %}"
hx-trigger="load"
hx-target="#aliases"
hx-swap="outerHTML">
</div>
<div class="columns">
<div class="column">
<div class="box">
@@ -37,7 +46,7 @@
<div class="columns">
<div class="column">
<div class="box">
<div id="channels">
<div id="aliases">
</div>
</div>
</div>