From 739ac075dcd000ffb59003e223787ad62174d643 Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Tue, 14 Nov 2023 14:13:21 +0100 Subject: views: add field 'gateway' in add-room form Add the possibility to configure a gateway in a room. --- ogcp/forms/action_forms.py | 2 ++ ogcp/views.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'ogcp') diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index 75ec674..fe5280e 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -178,6 +178,8 @@ class RoomForm(FlaskForm): validators=[InputRequired()]) netmask = StringField(label=_l('Netmask'), validators=[InputRequired()]) + gateway = StringField(label=_l('Gateway'), + validators=[InputRequired()]) submit = SubmitField(label=_l('Submit')) class DeleteRoomForm(FlaskForm): diff --git a/ogcp/views.py b/ogcp/views.py index 56910d3..2d5e6d0 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -1344,7 +1344,8 @@ def action_room_add(): server = get_server_from_ip_port(form.server.data) payload = {"center": int(form.center.data), "name": form.name.data, - "netmask": form.netmask.data} + "netmask": form.netmask.data, + "gateway": form.gateway.data} r = server.post('/room/add', payload) if r.status_code != requests.codes.ok: flash(_('Server replied with error code when adding the room'), category='error') -- cgit v1.2.3-18-g5258