Begin implementing smarter WM system for multi-type objects
parent
fd4cecee05
commit
ac3a57a2e8
@ -1,48 +1,152 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
{% load joinsep %}
|
||||
{% block outer_content %}
|
||||
{% if params.modal == 'context' %}
|
||||
<div
|
||||
style="display: none;"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-post="{% url 'modal_context' %}"
|
||||
hx-vals='{"net": "{{ params.net|escapejs }}",
|
||||
"num": "{{ params.num|escapejs }}",
|
||||
"source": "{{ params.source|escapejs }}",
|
||||
"channel": "{{ params.channel|escapejs }}",
|
||||
"time": "{{ params.time|escapejs }}",
|
||||
"date": "{{ params.date|escapejs }}",
|
||||
"index": "{{ params.index }}",
|
||||
"type": "{{ params.type|escapejs }}",
|
||||
"mtype": "{{ params.mtype|escapejs }}",
|
||||
"nick": "{{ params.nick|escapejs }}"}'
|
||||
hx-target="#modals-here"
|
||||
hx-trigger="load">
|
||||
</div>
|
||||
{% endif %}
|
||||
<script src="{% static 'js/chart.js' %}"></script>
|
||||
<script src="{% static 'tabs.js' %}"></script>
|
||||
<script>
|
||||
function setupTags() {
|
||||
var inputTags = document.getElementById('tags');
|
||||
new BulmaTagsInput(inputTags);
|
||||
|
||||
{% block content %}
|
||||
<div class="block">
|
||||
{% for block in blocks %}
|
||||
{% if block.title is not None %}
|
||||
<h1 class="title">{{ block.title }}</h1>
|
||||
{% endif %}
|
||||
<div class="box">
|
||||
<div class="columns">
|
||||
{% if block.column1 is not None %}
|
||||
<div class="column">
|
||||
{{ block.column1 }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if block.column2 is not None %}
|
||||
<div class="column">
|
||||
{{ block.column2 }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if block.column3 is not None %}
|
||||
<div class="column">
|
||||
{{ block.column3 }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="columns">
|
||||
{% if block.image1 is not None %}
|
||||
<div class="column">
|
||||
<img src="{% static block.image1 %}">
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if block.image2 is not None %}
|
||||
<div class="column">
|
||||
<img src="{% static block.image2 %}">
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if block.image3 is not None %}
|
||||
<div class="column">
|
||||
<img src="{% static block.image3 %}">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
inputTags.BulmaTagsInput().on('before.add', function(item) {
|
||||
if (item.includes(": ")) {
|
||||
var spl = item.split(": ");
|
||||
} else {
|
||||
var spl = item.split(":");
|
||||
}
|
||||
var field = spl[0];
|
||||
try {
|
||||
var value = JSON.parse(spl[1]);
|
||||
} catch {
|
||||
var value = spl[1];
|
||||
}
|
||||
return `${field}: ${value}`;
|
||||
});
|
||||
inputTags.BulmaTagsInput().on('after.remove', function(item) {
|
||||
var spl = item.split(": ");
|
||||
var field = spl[0];
|
||||
var value = spl[1].trim();
|
||||
});
|
||||
}
|
||||
function populateSearch(field, value) {
|
||||
var inputTags = document.getElementById('tags');
|
||||
inputTags.BulmaTagsInput().add(field+": "+value);
|
||||
//htmx.trigger("#search", "click");
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="grid-stack" id="grid-stack-main">
|
||||
<div class="grid-stack-item" gs-w="7" gs-h="10" gs-y="0" gs-x="1">
|
||||
<div class="grid-stack-item-content">
|
||||
<nav class="panel">
|
||||
<p class="panel-heading" style="padding: .2em; line-height: .5em;">
|
||||
<i class="fa-solid fa-arrows-up-down-left-right has-text-grey-light"></i>
|
||||
Search
|
||||
</p>
|
||||
<article class="panel-block is-active">
|
||||
{% include 'window-content/search.html' %}
|
||||
</article>
|
||||
</nav>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var grid = GridStack.init({
|
||||
cellHeight: 20,
|
||||
cellWidth: 50,
|
||||
cellHeightUnit: 'px',
|
||||
auto: true,
|
||||
float: true,
|
||||
draggable: {handle: '.panel-heading', scroll: false, appendTo: 'body'},
|
||||
removable: false,
|
||||
animate: true,
|
||||
});
|
||||
// GridStack.init();
|
||||
setupTags();
|
||||
|
||||
// a widget is ready to be loaded
|
||||
document.addEventListener('load-widget', function(event) {
|
||||
let container = htmx.find('#widget');
|
||||
// get the scripts, they won't be run on the new element so we need to eval them
|
||||
var scripts = htmx.findAll(container, "script");
|
||||
let widgetelement = container.firstElementChild.cloneNode(true);
|
||||
var new_id = widgetelement.id;
|
||||
|
||||
// check if there's an existing element like the one we want to swap
|
||||
let grid_element = htmx.find('#grid-stack-main');
|
||||
let existing_widget = htmx.find(grid_element, "#"+new_id);
|
||||
|
||||
// get the size and position attributes
|
||||
if (existing_widget) {
|
||||
let attrs = existing_widget.getAttributeNames();
|
||||
for (let i = 0, len = attrs.length; i < len; i++) {
|
||||
if (attrs[i].startsWith('gs-')) { // only target gridstack attributes
|
||||
widgetelement.setAttribute(attrs[i], existing_widget.getAttribute(attrs[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clear the queue element
|
||||
container.outerHTML = "";
|
||||
|
||||
// temporary workaround, other widgets can be duplicated, but not results
|
||||
if (widgetelement.id == 'widget-results') {
|
||||
grid.removeWidget("widget-results");
|
||||
}
|
||||
|
||||
grid.addWidget(widgetelement);
|
||||
// re-create the HTMX JS listeners, otherwise HTMX won't work inside the grid
|
||||
htmx.process(widgetelement);
|
||||
|
||||
// update size when the widget is loaded
|
||||
document.addEventListener('load-widget-results', function(evt) {
|
||||
var added_widget = htmx.find(grid_element, '#widget-results');
|
||||
var itemContent = htmx.find(added_widget, ".control");
|
||||
var scrollheight = itemContent.scrollHeight+80;
|
||||
var verticalmargin = 0;
|
||||
var cellheight = grid.opts.cellHeight;
|
||||
var height = Math.ceil((scrollheight + verticalmargin) / (cellheight + verticalmargin));
|
||||
var opts = {
|
||||
h: height,
|
||||
}
|
||||
grid.update(
|
||||
added_widget,
|
||||
opts
|
||||
);
|
||||
});
|
||||
|
||||
// run the JS scripts inside the added element again
|
||||
// for instance, this will fix the dropdown
|
||||
for (var i = 0; i < scripts.length; i++) {
|
||||
eval(scripts[i].innerHTML);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
{% block widgets %}
|
||||
{% if table %}
|
||||
{% include 'partials/results_load.html' %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
@ -0,0 +1 @@
|
||||
<button class="modal-close is-large" aria-label="close"></button>
|
@ -0,0 +1,3 @@
|
||||
<i
|
||||
class="fa-solid fa-xmark has-text-grey-light float-right"
|
||||
onclick='grid.removeWidget("widget-{{ unique }}");'></i>
|
@ -0,0 +1,3 @@
|
||||
<i
|
||||
class="fa-solid fa-xmark has-text-grey-light float-right"
|
||||
data-script="on click remove the closest <nav/>"></i>
|
@ -1,163 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load joinsep %}
|
||||
{% block outer_content %}
|
||||
{% if params.modal == 'context' %}
|
||||
<div
|
||||
style="display: none;"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-post="{% url 'modal_context' %}"
|
||||
hx-vals='{"net": "{{ params.net|escapejs }}",
|
||||
"num": "{{ params.num|escapejs }}",
|
||||
"source": "{{ params.source|escapejs }}",
|
||||
"channel": "{{ params.channel|escapejs }}",
|
||||
"time": "{{ params.time|escapejs }}",
|
||||
"date": "{{ params.date|escapejs }}",
|
||||
"index": "{{ params.index }}",
|
||||
"type": "{{ params.type|escapejs }}",
|
||||
"mtype": "{{ params.mtype|escapejs }}",
|
||||
"nick": "{{ params.nick|escapejs }}"}'
|
||||
hx-target="#modals-here"
|
||||
hx-trigger="load">
|
||||
</div>
|
||||
{% endif %}
|
||||
<script src="{% static 'js/chart.js' %}"></script>
|
||||
<script src="{% static 'tabs.js' %}"></script>
|
||||
<script>
|
||||
function setupTags() {
|
||||
var inputTags = document.getElementById('tags');
|
||||
new BulmaTagsInput(inputTags);
|
||||
|
||||
inputTags.BulmaTagsInput().on('before.add', function(item) {
|
||||
if (item.includes(": ")) {
|
||||
var spl = item.split(": ");
|
||||
} else {
|
||||
var spl = item.split(":");
|
||||
}
|
||||
var field = spl[0];
|
||||
try {
|
||||
var value = JSON.parse(spl[1]);
|
||||
} catch {
|
||||
var value = spl[1];
|
||||
}
|
||||
return `${field}: ${value}`;
|
||||
});
|
||||
inputTags.BulmaTagsInput().on('after.remove', function(item) {
|
||||
var spl = item.split(": ");
|
||||
var field = spl[0];
|
||||
var value = spl[1].trim();
|
||||
});
|
||||
}
|
||||
function populateSearch(field, value) {
|
||||
var inputTags = document.getElementById('tags');
|
||||
inputTags.BulmaTagsInput().add(field+": "+value);
|
||||
//htmx.trigger("#search", "click");
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="grid-stack" id="grid-stack-main">
|
||||
<div class="grid-stack-item" gs-w="7" gs-h="10" gs-y="0" gs-x="1">
|
||||
<div class="grid-stack-item-content">
|
||||
<nav class="panel">
|
||||
<p class="panel-heading" style="padding: .2em; line-height: .5em;">
|
||||
<i class="fa-solid fa-arrows-up-down-left-right has-text-grey-light"></i>
|
||||
Search
|
||||
</p>
|
||||
<article class="panel-block is-active">
|
||||
{% include 'ui/drilldown/search_partial.html' %}
|
||||
</article>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var grid = GridStack.init({
|
||||
cellHeight: 20,
|
||||
cellWidth: 50,
|
||||
cellHeightUnit: 'px',
|
||||
auto: true,
|
||||
float: true,
|
||||
draggable: {handle: '.panel-heading', scroll: false, appendTo: 'body'},
|
||||
removable: false,
|
||||
animate: true,
|
||||
});
|
||||
// GridStack.init();
|
||||
setupTags();
|
||||
|
||||
// a widget is ready to be loaded
|
||||
document.addEventListener('load-widget', function(event) {
|
||||
let container = htmx.find('#drilldown-widget');
|
||||
// get the scripts, they won't be run on the new element so we need to eval them
|
||||
var scripts = htmx.findAll(container, "script");
|
||||
let widgetelement = container.firstElementChild.cloneNode(true);
|
||||
|
||||
// check if there's an existing element like the one we want to swap
|
||||
let grid_element = htmx.find('#grid-stack-main');
|
||||
let existing_widget = htmx.find(grid_element, '#drilldown-widget-results');
|
||||
|
||||
// get the size and position attributes
|
||||
if (existing_widget) {
|
||||
let attrs = existing_widget.getAttributeNames();
|
||||
for (let i = 0, len = attrs.length; i < len; i++) {
|
||||
if (attrs[i].startsWith('gs-')) { // only target gridstack attributes
|
||||
widgetelement.setAttribute(attrs[i], existing_widget.getAttribute(attrs[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clear the queue element
|
||||
container.outerHTML = "";
|
||||
|
||||
// temporary workaround, other widgets can be duplicated, but not results
|
||||
if (widgetelement.id == 'drilldown-widget-results') {
|
||||
grid.removeWidget("drilldown-widget-{{ unique }}");
|
||||
}
|
||||
|
||||
grid.addWidget(widgetelement);
|
||||
// re-create the HTMX JS listeners, otherwise HTMX won't work inside the grid
|
||||
htmx.process(widgetelement);
|
||||
|
||||
// update size when the widget is loaded
|
||||
document.addEventListener('load-widget-results', function(evt) {
|
||||
var added_widget = htmx.find(grid_element, '#drilldown-widget-results');
|
||||
console.log(added_widget);
|
||||
var itemContent = htmx.find(added_widget, ".control");
|
||||
console.log(itemContent);
|
||||
var scrollheight = itemContent.scrollHeight+80;
|
||||
var verticalmargin = 0;
|
||||
var cellheight = grid.opts.cellHeight;
|
||||
var height = Math.ceil((scrollheight + verticalmargin) / (cellheight + verticalmargin));
|
||||
var opts = {
|
||||
h: height,
|
||||
}
|
||||
grid.update(
|
||||
added_widget,
|
||||
opts
|
||||
);
|
||||
});
|
||||
|
||||
// run the JS scripts inside the added element again
|
||||
// for instance, this will fix the dropdown
|
||||
for (var i = 0; i < scripts.length; i++) {
|
||||
eval(scripts[i].innerHTML);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="modals-here">
|
||||
</div>
|
||||
<div id="items-here">
|
||||
</div>
|
||||
<div id="widgets-here" style="display: none;">
|
||||
</div>
|
||||
<div id="results" style="display: none;">
|
||||
{% if table %}
|
||||
{% include 'widgets/table_results.html' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
@ -1,122 +0,0 @@
|
||||
{% load index %}
|
||||
{% load static %}
|
||||
|
||||
<script src="{% static 'modal.js' %}"></script>
|
||||
<script>
|
||||
document.addEventListener("restore-modal-scroll", function(event) {
|
||||
var modalContent = document.getElementsByClassName("modal-content")[0];
|
||||
var maxScroll = modalContent.scrollHeight - modalContent.offsetHeight;
|
||||
var scrollpos = localStorage.getItem('scrollpos_modal_content');
|
||||
if (scrollpos == 'BOTTOM') {
|
||||
modalContent.scrollTop = maxScroll;
|
||||
} else if (scrollpos) {
|
||||
modalContent.scrollTop = scrollpos;
|
||||
};
|
||||
});
|
||||
|
||||
document.addEventListener("htmx:beforeSwap", function(event) {
|
||||
var modalContent = document.getElementsByClassName("modal-content")[0];
|
||||
var scrollpos = modalContent.scrollTop;
|
||||
if(modalContent.scrollTop === (modalContent.scrollHeight - modalContent.offsetHeight)) {
|
||||
localStorage.setItem('scrollpos_modal_content', 'BOTTOM');
|
||||
} else {
|
||||
localStorage.setItem('scrollpos_modal_content', scrollpos);
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
#tab-content-{{ unique }} div {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tab-content-{{ unique }} div.is-active {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="modal" class="modal is-active is-clipped">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-content">
|
||||
<div class="box">
|
||||
{% include 'partials/notify.html' %}
|
||||
<div class="tabs is-toggle is-fullwidth is-info" id="tabs-{{ unique }}">
|
||||
<ul>
|
||||
<li class="is-active" data-tab="1">
|
||||
<a>
|
||||
<span class="icon is-small"><i class="fa-solid fa-message-arrow-down"></i></span>
|
||||
<span>Scrollback</span>
|
||||
</a>
|
||||
</li>
|
||||
<li data-tab="2">
|
||||
<a>
|
||||
<span class="icon is-small"><i class="fa-solid fa-messages"></i></span>
|
||||
<span>Context</span>
|
||||
</a>
|
||||
</li>
|
||||
<li data-tab="3">
|
||||
<a>
|
||||
<span class="icon is-small"><i class="fa-solid fa-message"></i></span>
|
||||
<span>Message</span>
|
||||
</a>
|
||||
</li>
|
||||
<li data-tab="4">
|
||||
<a>
|
||||
<span class="icon is-small"><i class="fa-solid fa-asterisk"></i></span>
|
||||
<span>Info</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="tab-content-{{ unique }}">
|
||||
<div class="is-active" data-content="1">
|
||||
<h4 class="subtitle is-4">Scrollback of {{ channel }} on {{ net }}{{ num }}</h4>
|
||||
{% include 'modals/context_table.html' %}
|
||||
{% if user.is_superuser and src == 'irc' %}
|
||||
<form method="PUT">
|
||||
<article class="field has-addons">
|
||||
<article class="control is-expanded has-icons-left">
|
||||
<input id="context-input" name="msg" class="input" type="text" placeholder="Type your message here">
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fas fa-magnifying-glass"></i>
|
||||
</span>
|
||||
</article>
|
||||
<article class="control">
|
||||
<article class="field">
|
||||
<button
|
||||
id="search"
|
||||
class="button is-info is-fullwidth"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-put="{% url 'threshold_irc_msg' net num %}"
|
||||
hx-vals='{"channel": "{{ channel }}", "nick": "{{ nick }}"}'
|
||||
hx-trigger="click"
|
||||
hx-target="#context-input"
|
||||
hx-swap="outerHTML">
|
||||
Send
|
||||
</button>
|
||||
</article>
|
||||
</article>
|
||||
</article>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div data-content="2">
|
||||
<h4 class="subtitle is-4">Scrollback of {{ channel }} on {{ net }}{{ num }} around {{ ts }}</h4>
|
||||
Context
|
||||
</div>
|
||||
<div data-content="3">
|
||||
<h4 class="subtitle is-4">Message details</h4>
|
||||
Message deetails
|
||||
</div>
|
||||
<div data-content="4">
|
||||
<h4 class="subtitle is-4">Information about {{ channel }} on {{ net }}{{ num }}</h4>
|
||||
info
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>initTabs("{{ unique }}");</script>
|
||||
<button class="modal-close is-large" aria-label="close"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,177 +0,0 @@
|
||||
<article class="table-container" id="modal-context-table">
|
||||
<table class="table is-fullwidth">
|
||||
<thead>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in object_list %}
|
||||
{% if item.type == 'control' %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<span class="icon has-text-grey" data-tooltip="Hidden">
|
||||
<i class="fa-solid fa-file-slash"></i>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<p class="has-text-grey">Hidden {{ item.hidden }} similar result{% if item.hidden > 1%}s{% endif %}</p>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td>{{ item.time }}</td>
|
||||
<td>
|
||||
{% if item.type != 'znc' and item.type != 'self' and query is not True %}
|
||||
<article class="nowrap-parent">
|
||||
<article class="nowrap-child">
|
||||
{% if item.type == 'msg' %}
|
||||
<span class="icon" data-tooltip="Message">
|
||||
<i class="fa-solid fa-message"></i>
|
||||
</span>
|
||||
{% elif item.type == 'join' %}
|
||||
<span class="icon" data-tooltip="Join">
|
||||
<i class="fa-solid fa-person-to-portal"></i>
|
||||
</span>
|
||||
{% elif item.type == 'part' %}
|
||||
<span class="icon" data-tooltip="Part">
|
||||
<i class="fa-solid fa-person-from-portal"></i>
|
||||
</span>
|
||||
{% elif item.type == 'quit' %}
|
||||
<span class="icon" data-tooltip="Quit">
|
||||
<i class="fa-solid fa-circle-xmark"></i>
|
||||
</span>
|
||||
{% elif item.type == 'kick' %}
|
||||
<span class="icon" data-tooltip="Kick">
|
||||
<i class="fa-solid fa-user-slash"></i>
|
||||
</span>
|
||||
{% elif item.type == 'nick' %}
|
||||
<span class="icon" data-tooltip="Nick">
|
||||
<i class="fa-solid fa-signature"></i>
|
||||
</span>
|
||||
{% elif item.type == 'mode' %}
|
||||
<span class="icon" data-tooltip="Mode">
|
||||
<i class="fa-solid fa-gear"></i>
|
||||
</span>
|
||||
{% elif item.type == 'action' %}
|
||||
<span class="icon" data-tooltip="Action">
|
||||
<i class="fa-solid fa-exclamation"></i>
|
||||
</span>
|
||||
{% elif item.type == 'notice' %}
|
||||
<span class="icon" data-tooltip="Notice">
|
||||
<i class="fa-solid fa-message-code"></i>
|
||||
</span>
|
||||
{% elif item.type == 'conn' %}
|
||||
<span class="icon" data-tooltip="Connection">
|
||||
<i class="fa-solid fa-cloud-exclamation"></i>
|
||||
</span>
|
||||
{% elif item.type == 'znc' %}
|
||||
<span class="icon" data-tooltip="ZNC">
|
||||
<i class="fa-brands fa-unity"></i>
|
||||
</span>
|
||||
{% elif item.type == 'query' %}
|
||||
<span class="icon" data-tooltip="Query">
|
||||
<i class="fa-solid fa-message"></i>
|
||||
</span>
|
||||
{% elif item.type == 'highlight' %}
|
||||
<span class="icon" data-tooltip="Highlight">
|
||||
<i class="fa-solid fa-exclamation"></i>
|
||||
</span>
|
||||
{% elif item.type == 'who' %}
|
||||
<span class="icon" data-tooltip="Who">
|
||||
<i class="fa-solid fa-passport"></i>
|
||||
</span>
|
||||
{% elif item.type == 'topic' %}
|
||||
<span class="icon" data-tooltip="Topic">
|
||||
<i class="fa-solid fa-sign"></i>
|
||||
</span>
|
||||
{% else %}
|
||||
{{ item.type }}
|
||||
{% endif %}
|
||||
{% if item.online is True %}
|
||||
<span class="icon has-text-success has-tooltip-success" data-tooltip="Online">
|
||||
<i class="fa-solid fa-circle"></i>
|
||||
</span>
|
||||
{% elif item.online is False %}
|
||||
<span class="icon has-text-danger has-tooltip-danger" data-tooltip="Offline">
|
||||
<i class="fa-solid fa-circle"></i>
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="icon has-text-warning has-tooltip-warning" data-tooltip="Unknown">
|
||||
<i class="fa-solid fa-circle"></i>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if item.src == 'irc' %}
|
||||
<a
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-post="{% url 'modal_drilldown' %}"
|
||||
hx-vals='{"net": "{{ item.net|escapejs }}", "nick": "{{ item.nick|escapejs }}", "channel": "{{ item.channel|escapejs }}"}'
|
||||
hx-target="#modals-here"
|
||||
hx-trigger="click"
|
||||
class="has-text-black">
|
||||
<span class="icon" data-tooltip="Open drilldown modal">
|
||||
<i class="fa-solid fa-album"></i>
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</article>
|
||||
<a class="nowrap-child has-text-link is-underlined" onclick="populateSearch('nick', '{{ item.nick|escapejs }}')">
|
||||
{{ item.nick }}
|
||||
</a>
|
||||
{% if item.num_chans != '—' %}
|
||||
<article class="nowrap-child">
|
||||
<span class="tag">
|
||||
{{ item.num_chans }}
|
||||
</span>
|
||||
</article>
|
||||
{% endif %}
|
||||
</article>
|
||||
{% endif %}
|
||||
{% if item.type == 'self' %}
|
||||
<span class="icon has-text-primary" data-tooltip="You">
|
||||
<i class="fa-solid fa-message-check"></i>
|
||||
</span>
|
||||
{% elif item.type == 'znc' %}
|
||||
<span class="icon has-text-info" data-tooltip="ZNC">
|
||||
<i class="fa-brands fa-unity"></i>
|
||||
</span>
|
||||
{% elif query %}
|
||||
<span class="icon has-text-info" data-tooltip="Auth">
|
||||
<i class="fa-solid fa-passport"></i>
|
||||
</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="wrap">{{ item.msg }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% if object_list %}
|
||||
<div
|
||||
class="modal-refresh"
|
||||
style="display: none;"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-post="{% url 'modal_context_table' %}"
|
||||
hx-vals='{"net": "{{ net }}",
|
||||
"num": "{{ num }}",
|
||||
"src": "{{ src }}",
|
||||
"channel": "{{ channel }}",
|
||||
"time": "{{ time }}",
|
||||
"date": "{{ date }}",
|
||||
"index": "{{ index }}",
|
||||
"type": "{{ type }}",
|
||||
"mtype": "{{ mtype }}",
|
||||
"nick": "{{ nick }}",
|
||||
"dedup": "{{ params.dedup }}"}'
|
||||
hx-target="#modal-context-table"
|
||||
hx-trigger="every 5s">
|
||||
</div>
|
||||
{% endif %}
|
||||
</article>
|
||||
|
||||
<script>
|
||||
var modal_event = new Event('restore-modal-scroll');
|
||||
document.dispatchEvent(modal_event);
|
||||
</script>
|
@ -0,0 +1,26 @@
|
||||
{% load static %}
|
||||
|
||||
{% include 'partials/notify.html' %}
|
||||
<script src="{% static 'js/column-shifter.js' %}"></script>
|
||||
{% if cache is not None %}
|
||||
<span class="icon has-tooltip-bottom" data-tooltip="Cached">
|
||||
<i class="fa-solid fa-database"></i>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
fetched {{ table.data|length }} hits in {{ took }}ms
|
||||
|
||||
{% if exemption is not None %}
|
||||
<span class="icon has-tooltip-bottom" data-tooltip="God mode">
|
||||
<i class="fa-solid fa-book-bible"></i>
|
||||
</span>
|
||||
{% else %}
|
||||
{% if redacted is not None %}
|
||||
<span class="icon has-tooltip-bottom" data-tooltip="{{ redacted }} redacted">
|
||||
<i class="fa-solid fa-mask"></i>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% include 'partials/results_table.html' %}
|
||||
{% include 'partials/sentiment_chart.html' %}
|
@ -0,0 +1,6 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% include window_content %}
|
||||
{% endblock %}
|
@ -1,8 +1,10 @@
|
||||
<magnet-block attract-distance="10" align-to="outer|center" class="floating-window">
|
||||
{% extends 'wm/panel.html' %}
|
||||
{% block heading %}
|
||||
{{ title }}
|
||||
{% endblock %}
|
||||
|
||||
{% block panel_content %}
|
||||
{% include window_content %}
|
||||
{% endblock %}
|
||||
</magnet-block>
|
@ -0,0 +1,18 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM python:3
|
||||
|
||||
RUN useradd -d /code pathogen
|
||||
RUN mkdir /code
|
||||
RUN chown pathogen:pathogen /code
|
||||
|
||||
RUN mkdir /venv
|
||||
RUN chown pathogen:pathogen /venv
|
||||
|
||||
USER pathogen
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
WORKDIR /code
|
||||
COPY requirements.dev.txt /code/
|
||||
RUN python -m venv /venv
|
||||
RUN . /venv/bin/activate && pip install -r requirements.dev.txt
|
||||
CMD . /venv/bin/activate && exec python manage.py runserver 0.0.0.0:8000
|
Loading…
Reference in New Issue