From 09884080c359b32576cf2c0a3128b481f5566932 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Tue, 12 Apr 2022 17:32:07 +0200 Subject: 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; } --- ogcp/forms/action_forms.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ogcp/forms') 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')) -- cgit v1.2.3-18-g5258