From d5eaf699a7dd5215403b626762b68cd09bc846b5 Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Fri, 4 Sep 2020 11:09:44 +0200 Subject: Add WoL action This action can be applied on one or multiple scopes. This implementation use Flask-WTF as a way to build and valdiate forms. As a side effect, this adds CSRF protection to all forms. --- ogcp/forms/action_forms.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 ogcp/forms/action_forms.py (limited to 'ogcp/forms') diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py new file mode 100644 index 0000000..d6416bd --- /dev/null +++ b/ogcp/forms/action_forms.py @@ -0,0 +1,10 @@ +from wtforms import Form, SubmitField, HiddenField, SelectField +from flask_wtf import FlaskForm +from flask_babel import _ + +class WOLForm(FlaskForm): + ips = HiddenField() + wol_type = SelectField(label=_('Type'), + choices=[('broadcast', 'Broadcast'), + ('unicast', 'Unicast')]) + submit = SubmitField(label=_('Submit')) -- cgit v1.2.3-18-g5258