summaryrefslogtreecommitdiffstats
path: root/ogcp/forms
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/forms
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/forms')
-rw-r--r--ogcp/forms/action_forms.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py
index 5cabd54..a60115c 100644
--- a/ogcp/forms/action_forms.py
+++ b/ogcp/forms/action_forms.py
@@ -7,7 +7,7 @@
from wtforms import (
Form, SubmitField, HiddenField, SelectField, BooleanField, IntegerField,
- StringField, RadioField, FormField, FieldList, DecimalField
+ StringField, RadioField, FormField, FieldList, DecimalField, TextAreaField
)
from wtforms.validators import InputRequired
from flask_wtf import FlaskForm
@@ -119,6 +119,11 @@ class ClientDetailsForm(FlaskForm):
boot = SelectField(label=_l('Boot Mode'))
create = SubmitField(label=_l('Create'))
+class ImportClientsForm(FlaskForm):
+ room = SelectField(label=_l('Room'))
+ dhcpd_conf = TextAreaField(label=_l('dhcpd configuration'))
+ import_btn = SubmitField(label=_l('Import'))
+
class BootModeForm(FlaskForm):
ips = HiddenField()
boot = SelectField(label=_l('Boot mode'))