Implement deleting networks
This commit is contained in:
@@ -55,40 +55,40 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="buttons">
|
||||
{% if relay.enabled %}
|
||||
{% if relay.enabled %}
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'threshold_irc_network_relay_status' relay|index:'net' relay|index:'id' 0 %}"
|
||||
hx-target="#relays"
|
||||
hx-swap="outerHTML"
|
||||
class="button is-danger is-small">
|
||||
<span class="icon" data-tooltip="Disable">
|
||||
<i class="fa-solid fa-wifi-slash" aria-hidden="true"></i>
|
||||
</span>
|
||||
</button>
|
||||
{% else %}
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'threshold_irc_network_relay_status' relay|index:'net' relay|index:'id' 1 %}"
|
||||
hx-target="#relays"
|
||||
hx-swap="outerHTML"
|
||||
class="button is-success is-small">
|
||||
<span class="icon" data-tooltip="Enable">
|
||||
<i class="fa-solid fa-wifi" aria-hidden="true"></i>
|
||||
</span>
|
||||
</button>
|
||||
{% endif %}
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'threshold_irc_network_relay_status' relay|index:'net' relay|index:'id' 0 %}"
|
||||
hx-delete="{% url 'threshold_irc_network_relay_del' relay|index:'net' relay|index:'id' %}"
|
||||
hx-target="#relays"
|
||||
hx-swap="outerHTML"
|
||||
class="button is-danger is-small">
|
||||
<span class="icon" data-tooltip="Disable">
|
||||
<i class="fa-solid fa-wifi-slash" aria-hidden="true"></i>
|
||||
<span class="icon" data-tooltip="Delete">
|
||||
<i class="fa-solid fa-xmark" aria-hidden="true"></i>
|
||||
</span>
|
||||
</button>
|
||||
{% else %}
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'threshold_irc_network_relay_status' relay|index:'net' relay|index:'id' 1 %}"
|
||||
hx-target="#relays"
|
||||
hx-swap="outerHTML"
|
||||
class="button is-success is-small">
|
||||
<span class="icon" data-tooltip="Enable">
|
||||
<i class="fa-solid fa-wifi" aria-hidden="true"></i>
|
||||
</span>
|
||||
</button>
|
||||
{% endif %}
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-delete="{% url 'threshold_irc_network_relay_del' relay|index:'net' relay|index:'id' %}"
|
||||
hx-target="#relays"
|
||||
hx-swap="outerHTML"
|
||||
class="button is-danger is-small">
|
||||
<span class="icon" data-tooltip="Delete">
|
||||
<i class="fa-solid fa-xmark" aria-hidden="true"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
hx-put="{% url 'threshold_irc_actions_add-network' %}"
|
||||
hx-target="#networks"
|
||||
hx-swap="outerHTML">
|
||||
<div class="content">
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Network name</label>
|
||||
@@ -60,7 +59,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
|
||||
@@ -5,13 +5,23 @@
|
||||
<thead>
|
||||
<th>net</th>
|
||||
<th>relays</th>
|
||||
<th>channels</th>
|
||||
<th>
|
||||
<span class="icon">
|
||||
<i class="fa-solid fa-hashtag"></i>
|
||||
</span>
|
||||
</th>
|
||||
<th>records</th>
|
||||
<th>
|
||||
<span class="icon">
|
||||
<i class="fa-solid fa-wrench" aria-hidden="true"></i>
|
||||
</span>
|
||||
</th>
|
||||
</thead>
|
||||
{% for key, net in networks.items %}
|
||||
<tr>
|
||||
<th><a href="{% url 'threshold_irc_network' key %}">{{ key }}</a></th>
|
||||
<td>
|
||||
|
||||
<span class="icon">
|
||||
<i class="fa-brands fa-unity"></i>
|
||||
</span>
|
||||
@@ -29,6 +39,18 @@
|
||||
</span>
|
||||
{{ net.records }}
|
||||
</td>
|
||||
<td>
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-delete="{% url 'threshold_irc_network_del' key %}"
|
||||
hx-target="#networks"
|
||||
hx-swap="outerHTML"
|
||||
class="button is-danger is-small">
|
||||
<span class="icon" data-tooltip="Delete">
|
||||
<i class="fa-solid fa-xmark" aria-hidden="true"></i>
|
||||
</span>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% if message is not None %}
|
||||
<div class="notification is-{{ class }}" hx-ext="remove-me" remove-me="3s">
|
||||
{{ message }}
|
||||
</div>
|
||||
<div class="notification is-{{ class }}" hx-ext="remove-me" remove-me="3s">
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user