mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #4556: Update form for adding devices to clusters
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
* [#4527](https://github.com/netbox-community/netbox/issues/4527) - Fix assignment of certain tags to config contexts
|
||||
* [#4545](https://github.com/netbox-community/netbox/issues/4545) - Removed all squashed schema migrations to allow direct upgrades from very old releases
|
||||
* [#4549](https://github.com/netbox-community/netbox/issues/4549) - Fix encoding unicode webhook body data
|
||||
* [#4556](https://github.com/netbox-community/netbox/issues/4556) - Update form for adding devices to clusters
|
||||
|
||||
---
|
||||
|
||||
|
@ -138,7 +138,7 @@
|
||||
{% if perms.virtualization.change_cluster %}
|
||||
<div class="panel-footer noprint">
|
||||
<div class="pull-right">
|
||||
<a href="{% url 'virtualization:cluster_add_devices' pk=cluster.pk %}" class="btn btn-primary btn-xs">
|
||||
<a href="{% url 'virtualization:cluster_add_devices' pk=cluster.pk %}?site={{ cluster.site.pk }}" class="btn btn-primary btn-xs">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
Add devices
|
||||
</a>
|
||||
|
@ -22,26 +22,7 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><strong>Device Selection</strong></div>
|
||||
<div class="panel-body">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#search" aria-controls="search" role="tab" data-toggle="tab">Search</a></li>
|
||||
<li role="presentation"><a href="#select" aria-controls="home" role="tab" data-toggle="tab">Select</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="search">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label" for="id_search">Search</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" name="search" id="id_search" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="select">
|
||||
{% render_field form.region %}
|
||||
{% render_field form.site %}
|
||||
{% render_field form.rack %}
|
||||
</div>
|
||||
</div>
|
||||
{% render_field form.devices %}
|
||||
{% render_form form %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -168,7 +168,7 @@ class ClusterAddDevicesView(PermissionRequiredMixin, View):
|
||||
def get(self, request, pk):
|
||||
|
||||
cluster = get_object_or_404(Cluster, pk=pk)
|
||||
form = self.form(cluster)
|
||||
form = self.form(cluster, initial=request.GET)
|
||||
|
||||
return render(request, self.template_name, {
|
||||
'cluster': cluster,
|
||||
|
Reference in New Issue
Block a user