From 766b530ace50ec7adb483cbb7c74e3851f5cb743 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 1 Aug 2022 19:34:36 +0100 Subject: [PATCH] Implement automatic provisioning --- app/urls.py | 6 +++++ core/lib/manage/threshold.py | 7 ++++++ .../manage/threshold/irc/network/actions.html | 4 ++++ core/templatetags/nsep.py | 3 ++- core/views/manage/threshold/irc.py | 23 +++++++++++++++++++ 5 files changed, 42 insertions(+), 1 deletion(-) diff --git a/app/urls.py b/app/urls.py index 3b303c9..2aebd43 100644 --- a/app/urls.py +++ b/app/urls.py @@ -27,6 +27,7 @@ from core.views.manage.threshold.irc import ( ThresholdIRCAliases, ThresholdIRCAliasesEdit, ThresholdIRCNetworkActions, + ThresholdIRCNetworkActionsAuto, ThresholdIRCNetworkActionsRelay, ThresholdIRCNetworkChannels, ThresholdIRCNetworkInfo, @@ -171,6 +172,11 @@ urlpatterns = [ ThresholdIRCNetworkActionsRelay.as_view(), name="threshold_irc_network_actions_add_relay", ), + path( + "manage/threshold/irc/auto//", + ThresholdIRCNetworkActionsAuto.as_view(), + name="threshold_irc_network_actions_auto", + ), ## path("api/chans/", ThresholdChans.as_view(), name="chans"), path("api/users/", ThresholdUsers.as_view(), name="users"), diff --git a/core/lib/manage/threshold.py b/core/lib/manage/threshold.py index f4d2efa..064be53 100644 --- a/core/lib/manage/threshold.py +++ b/core/lib/manage/threshold.py @@ -111,3 +111,10 @@ def update_aliases(aliases): payload = aliases deleted = threshold_request(url, payload, method="POST") return deleted + + +def run_auto(net): + url = f"irc/auto/{net}" + payload = {} + deleted = threshold_request(url, payload, method="POST") + return deleted diff --git a/core/templates/manage/threshold/irc/network/actions.html b/core/templates/manage/threshold/irc/network/actions.html index b0d725b..19ef3eb 100644 --- a/core/templates/manage/threshold/irc/network/actions.html +++ b/core/templates/manage/threshold/irc/network/actions.html @@ -21,6 +21,10 @@