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: if channel:
extra_must.append({"match": {"channel": channel}}) extra_must.append({"match": {"channel": channel}})
if nicks: if nicks:
print("NICKS", nicks)
for nick in nicks: for nick in nicks:
extra_should2.append({"match": {"nick": nick}}) extra_should2.append({"match": {"nick": nick}})
types = ["msg", "notice", "action", "kick", "topic", "mode"] types = ["msg", "notice", "action", "kick", "topic", "mode"]

View File

@ -44,6 +44,8 @@
</span> </span>
</button> </button>
</div> </div>
<div class="columns">
<div class="column">
<form method="POST"> <form method="POST">
<div class="field has-addons"> <div class="field has-addons">
<div class="control is-expanded has-icons-left"> <div class="control is-expanded has-icons-left">
@ -65,5 +67,30 @@
</div> </div>
</div> </div>
</form> </form>
</div>
<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> </div>

View File

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