neptune/core/templates/ui/results.html

102 lines
3.4 KiB
HTML
Raw Normal View History

2022-07-21 12:50:51 +00:00
{% load static %}
<div id="results">
2022-07-21 12:50:56 +00:00
{% if results is not None %}
<div style="display: none" id="jsonData" data-json="{{ data }}">
</div>
<div class="box">
<canvas id="volume"></canvas>
<script src="{% static 'chart.js' %}"></script>
2022-07-21 12:50:51 +00:00
</div>
<div class="box">
2022-07-21 12:51:12 +00:00
<span class="tag is-success">Online</span>
<span class="tag is-danger">Offline</span>
<span class="tag is-warning">Unknown</span>
IRC: <i class="fa-solid fa-hashtag" aria-hidden="true"></i>
Discord: <i class="fa-brands fa-discord" aria-hidden="true"></i>
2022-07-21 12:50:51 +00:00
<div class="table-container">
<table class="table is-striped is-hoverable is-fullwidth">
<thead>
<tr>
2022-07-21 12:51:12 +00:00
<th>src</th>
2022-07-21 12:50:51 +00:00
<th>TS</th>
<th>msg</th>
<th>host</th>
<th>nick</th>
2022-07-21 12:51:12 +00:00
<th>actions</th>
2022-07-21 12:50:51 +00:00
<th>channel</th>
<th>net</th>
</tr>
</thead>
<tbody>
{% for item in results %}
<tr>
2022-07-21 12:51:12 +00:00
<td>
{% if item.src == 'irc' %}
<i class="fa-solid fa-hashtag" aria-hidden="true"></i>
{% elif item.src == 'dis' %}
<i class="fa-brands fa-discord" aria-hidden="true"></i>
{% endif %}
</td>
<td>
<p>{{ item.date }}</p>
<p>{{ item.time }}</p>
</td>
2022-07-21 12:50:51 +00:00
<td>{{ item.msg }}</td>
<td>{{ item.host }}</td>
2022-07-21 12:51:12 +00:00
<td>
{% if item.online is True %}
<span class="tag is-success">{{ item.nick }}</span>
{% elif item.online is False %}
<span class="tag is-danger">{{ item.nick }}</span>
{% else %}
<span class="tag is-warning">{{ item.nick }}</span>
{% endif %}
</td>
<td>
{% if item.src == 'irc' %}
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'modal_info' %}"
hx-vals='{"net": "{{ item.net }}", "nick": "{{ item.nick }}", "channel": "{{ item.channel }}"}'
hx-target="#modals-here"
hx-trigger="click"
class="btn btn-primary"
_="on htmx:afterOnLoad wait 10ms then add .show to #modal then add .show to #modal-backdrop">
Information
</button>
<div id="modals-here"></div>
{% endif %}
</td>
2022-07-21 12:50:51 +00:00
<td>{{ item.channel }}</td>
<td>{{ item.net }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="box">
<div class="columns">
<div class="column">
<p>{{ card }} hits</p>
</div>
{% if redacted != 0 %}
<div class="column">
<p>{{ redacted }} redacted</p>
</div>
{% endif %}
{% if exemption is not None %}
<div class="column">
<p>god mode</p>
</div>
{% endif %}
<div class="column">
<p>{{ took }}ms</p>
</div>
</div>
</div>
{% endif %}
</div>