summaryrefslogtreecommitdiffstats
path: root/ogcp/templates
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-04-12 17:32:07 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-04-19 16:03:41 +0200
commit09884080c359b32576cf2c0a3128b481f5566932 (patch)
tree6e3ee5b8441e4977e09826c6747f3db25307af99 /ogcp/templates
parent87270dc8dfca246f54c5f0ccaa3f3d3e98020a2d (diff)
Add import clients action
Add import clients form with required inputs: room and dhcpd.conf. This permits users to rapidly add large amounts of clients to a room using dhcpd.conf's syntax. Users can copy full dhcpd.conf files to the text area and the parser only matches lines with the following format as clients: host dummy {hardware ethernet 12:34:56:78:90:ab; fixed-address 192.168.1.55; }
Diffstat (limited to 'ogcp/templates')
-rw-r--r--ogcp/templates/actions/import_clients.html19
-rw-r--r--ogcp/templates/scopes.html2
2 files changed, 21 insertions, 0 deletions
diff --git a/ogcp/templates/actions/import_clients.html b/ogcp/templates/actions/import_clients.html
new file mode 100644
index 0000000..fc852d3
--- /dev/null
+++ b/ogcp/templates/actions/import_clients.html
@@ -0,0 +1,19 @@
+{% extends 'scopes.html' %}
+{% import "bootstrap/wtf.html" as wtf %}
+
+{% set sidebar_state = 'disabled' %}
+{% set btn_back = true %}
+
+{% block nav_client %}active{% endblock %}
+{% block nav_clients_import %}active{% endblock %}
+{% block content %}
+
+<h1 class="m-5">{{_('Import clients')}}</h1>
+
+{{ wtf.quick_form(form,
+ action=url_for('action_clients_import_post'),
+ method='post',
+ button_map={'submit': 'primary'},
+ extra_classes="mx-5") }}
+
+{% endblock %}
diff --git a/ogcp/templates/scopes.html b/ogcp/templates/scopes.html
index 95d527a..751272d 100644
--- a/ogcp/templates/scopes.html
+++ b/ogcp/templates/scopes.html
@@ -23,6 +23,8 @@
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<input class="btn btn-light dropdown-item {% block nav_client_add %}{% endblock %}" type="submit" value="{{ _('Add client') }}"
form="scopesForm" formaction="{{ url_for('action_client_add') }}" formmethod="get">
+ <input class="btn btn-light dropdown-item {% block nav_clients_import %}{% endblock %}" type="submit" value="{{ _('Import clients') }}"
+ form="scopesForm" formaction="{{ url_for('action_clients_import_get') }}" formmethod="get">
<input class="btn btn-light dropdown-item {% block nav_client_delete %}{% endblock %}" type="submit" value="{{ _('Delete client') }}"
form="scopesForm" formaction="{{ url_for('action_client_delete') }}" formmethod="get">
</div>