From a70ba5525bc26a6dc85169b5e49795d215f2d9c9 Mon Sep 17 00:00:00 2001 From: Francesco Di Nucci Date: Fri, 21 Jun 2024 09:06:22 +0200 Subject: [PATCH] feat: add floating IP address field under Project Dashboard Add "Floating Ip Address (optional)" field to allow users to optionally specify a floating IP address while Allocating Floating IP from Floating Panel under Project Dashboard Change-Id: I004e8ffebc464a9e1ef6858885a13fb2b1e8050e --- .../dashboards/project/floating_ips/forms.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openstack_dashboard/dashboards/project/floating_ips/forms.py b/openstack_dashboard/dashboards/project/floating_ips/forms.py index 78f270d710..c6ab3c31b3 100644 --- a/openstack_dashboard/dashboards/project/floating_ips/forms.py +++ b/openstack_dashboard/dashboards/project/floating_ips/forms.py @@ -29,6 +29,14 @@ from openstack_dashboard.usage import quotas class FloatingIpAllocate(forms.SelfHandlingForm): pool = forms.ThemableChoiceField(label=_("Pool")) + floating_ip_address = forms.IPField( + label=_("Floating IP Address (optional)"), + required=False, + initial="", + help_text=_("The IP address of the new floating IP (e.g. 202.2.3.4). " + "You need to specify an explicit address which is under " + "the public network CIDR (e.g. 202.2.3.0/24)."), + mask=False) description = forms.CharField(max_length=255, label=_("Description"), required=False) @@ -64,6 +72,8 @@ class FloatingIpAllocate(forms.SelfHandlingForm): return False param = {} + if data['floating_ip_address']: + param['floating_ip_address'] = data['floating_ip_address'] if data['description']: param['description'] = data['description'] if 'dns_domain' in data and data['dns_domain']: