Begin implementing adding channel limits

This commit is contained in:
Mark Veidemanis 2022-08-12 23:32:23 +01:00
parent ddb737fdc6
commit 52f3e8f1b2
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
3 changed files with 48 additions and 21 deletions

View File

@ -10,7 +10,6 @@ def construct_query(index, net, channel, src, num, size, nicks=None):
if channel:
extra_must.append({"match": {"channel": channel}})
if nicks:
print("NICKS", nicks)
for nick in nicks:
extra_should2.append({"match": {"nick": nick}})
types = ["msg", "notice", "action", "kick", "topic", "mode"]

View File

@ -44,26 +44,53 @@
</span>
</button>
</div>
<form method="POST">
<div class="field has-addons">
<div class="control is-expanded has-icons-left">
<input class="input" name="num" type="text" placeholder="Relay number">
<span class="icon is-small is-left">
<i class="fa-brands fa-unity"></i>
</span>
</div>
<div class="control">
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
class="button is-info is-fullwidth"
hx-put="{% url 'threshold_irc_network_actions_add_relay' net %}"
hx-trigger="click"
hx-target="#actions"
hx-swap="outerHTML">
Add
</button>
</div>
<div class="columns">
<div class="column">
<form method="POST">
<div class="field has-addons">
<div class="control is-expanded has-icons-left">
<input class="input" name="num" type="text" placeholder="Relay number">
<span class="icon is-small is-left">
<i class="fa-brands fa-unity"></i>
</span>
</div>
<div class="control">
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
class="button is-info is-fullwidth"
hx-put="{% url 'threshold_irc_network_actions_add_relay' net %}"
hx-trigger="click"
hx-target="#actions"
hx-swap="outerHTML">
Add
</button>
</div>
</div>
</form>
</div>
</form>
<div class="column">
<form method="POST">
<div class="field has-addons">
<div class="control is-expanded has-icons-left">
<input class="input" name="num" type="text" placeholder="Channel limit">
<span class="icon is-small is-left">
<i class="fa-brands fa-unity"></i>
</span>
</div>
<div class="control">
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
class="button is-warning is-fullwidth"
hx-put="{% url 'threshold_irc_network_actions_add_relay' net %}"
hx-trigger="click"
hx-target="#actions"
hx-swap="outerHTML">
Set
</button>
</div>
</div>
</form>
</div>
</div>
</div>

View File

@ -59,6 +59,7 @@ class ThresholdIRCNetworkInfo(SuperUserRequiredMixin, View):
def get(self, request, net):
network = threshold.get_irc_network(net)
context = {"network": network}
print("CON", context)
return render(request, self.template_name, context)