From f253f164a3a90f7cde8926c94793cb0197190744 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 11 Oct 2017 10:14:09 -0400 Subject: [PATCH] Closes #1510: Added ability to search by name when adding devices to a cluster --- .../virtualization/cluster_add_devices.html | 47 +++++++++++++++++-- netbox/virtualization/forms.py | 1 - 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/netbox/templates/virtualization/cluster_add_devices.html b/netbox/templates/virtualization/cluster_add_devices.html index 6c874d38f45..2029ea5b8e3 100644 --- a/netbox/templates/virtualization/cluster_add_devices.html +++ b/netbox/templates/virtualization/cluster_add_devices.html @@ -20,11 +20,27 @@

{% block title %}Add Devices to Cluster {{ cluster }}{% endblock %}

{% endif %}
-
Devices
+
Device Selection
- {% render_field form.region %} - {% render_field form.site %} - {% render_field form.rack %} + +
+ +
+ {% render_field form.region %} + {% render_field form.site %} + {% render_field form.rack %} +
+
{% render_field form.devices %}
@@ -40,5 +56,26 @@

{% block title %}Add Devices to Cluster {{ cluster }}{% endblock %}

{% endblock %} {% block javascript %} - + {% endblock %} diff --git a/netbox/virtualization/forms.py b/netbox/virtualization/forms.py index 461c1cf11d6..63561a08cc9 100644 --- a/netbox/virtualization/forms.py +++ b/netbox/virtualization/forms.py @@ -186,7 +186,6 @@ class ClusterAddDevicesForm(BootstrapMixin, ChainedFieldsMixin, forms.Form): ('site', 'site'), ('rack', 'rack'), ), - label='Device', widget=APISelectMultiple( api_url='/api/dcim/devices/?site_id={{site}}&rack_id={{rack}}', display_field='display_name',