Implement getting alerts in overview
This commit is contained in:
92
core/templates/manage/threshold/irc/overview/alerts.html
Normal file
92
core/templates/manage/threshold/irc/overview/alerts.html
Normal file
@@ -0,0 +1,92 @@
|
||||
<div id="alerts">
|
||||
{% include 'manage/threshold/partials/notify.html' %}
|
||||
{% if alerts is not None %}
|
||||
<div class="icons">
|
||||
<button
|
||||
class="button is-small">
|
||||
<span class="icon" data-tooltip="Conn">
|
||||
<i class="fa-solid fa-cloud-exclamation"></i>
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
class="button is-small">
|
||||
<span class="icon" data-tooltip="Highlight">
|
||||
<i class="fa-solid fa-square-quote"></i>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="button is-small">
|
||||
<span class="icon" data-tooltip="ZNC">
|
||||
<i class="fa-brands fa-unity"></i>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="button is-small">
|
||||
<span class="icon" data-tooltip="Query">
|
||||
<i class="fa-solid fa-inbox"></i>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="button is-small">
|
||||
<span class="icon" data-tooltip="Self">
|
||||
<i class="fa-solid fa-message-bot"></i>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<div class="content" style="max-height: 30em; overflow: auto;">
|
||||
|
||||
<div class="table-container">
|
||||
<table class="table is-fullwidth is-hoverable">
|
||||
<thead>
|
||||
<th>ts</th>
|
||||
<th>name</th>
|
||||
<th>type</th>
|
||||
<th>msg</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for alert in alerts %}
|
||||
<tr>
|
||||
<td>
|
||||
<p>{{ alert.date }}</p>
|
||||
<p>{{ alert.time }}</p>
|
||||
</td>
|
||||
<td>
|
||||
{{ alert.net }}/{{ alert.num }}
|
||||
<td>
|
||||
{% if alert.type == 'conn' %}
|
||||
<span class="icon" data-tooltip="Conn">
|
||||
<i class="fa-solid fa-cloud-exclamation"></i>
|
||||
</span>
|
||||
{% elif alert.type == 'highlight' %}
|
||||
<span class="icon" data-tooltip="Highlight">
|
||||
<i class="fa-solid fa-square-quote"></i>
|
||||
</span>
|
||||
{% elif alert.type == 'znc' %}
|
||||
<span class="icon" data-tooltip="ZNC">
|
||||
<i class="fa-brands fa-unity"></i>
|
||||
</span>
|
||||
{% elif alert.type == 'query' %}
|
||||
<span class="icon" data-tooltip="Query">
|
||||
<i class="fa-solid fa-inbox"></i>
|
||||
</span>
|
||||
{% elif alert.type == 'self' %}
|
||||
<span class="icon" data-tooltip="Self">
|
||||
<i class="fa-solid fa-message-bot"></i>
|
||||
</span>
|
||||
{% else %}
|
||||
{{ alert.type }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="max-width: 10em" class="wrap">{{ alert.msg }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -37,6 +37,15 @@
|
||||
hx-swap="outerHTML">
|
||||
</div>
|
||||
|
||||
<div
|
||||
style="display: none;"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'threshold_irc_overview_alerts' %}"
|
||||
hx-trigger="load"
|
||||
hx-target="#alerts"
|
||||
hx-swap="outerHTML">
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<div class="box">
|
||||
@@ -62,7 +71,6 @@
|
||||
<div class="column">
|
||||
<div class="box">
|
||||
<div id="alerts">
|
||||
Alerts here
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user