diff --git a/netbox/templates/inc/nav_menu.html b/netbox/templates/inc/nav_menu.html index cd1e96aa5..65e6be224 100644 --- a/netbox/templates/inc/nav_menu.html +++ b/netbox/templates/inc/nav_menu.html @@ -297,7 +297,7 @@ {% if perms.virtualization.add_clustertype %}
{% endif %} Cluster Types @@ -306,7 +306,7 @@ {% if perms.virtualization.add_clustergroup %} {% endif %} Cluster Groups diff --git a/netbox/virtualization/forms.py b/netbox/virtualization/forms.py index 91c65c8f1..461c1cf11 100644 --- a/netbox/virtualization/forms.py +++ b/netbox/virtualization/forms.py @@ -38,6 +38,17 @@ class ClusterTypeForm(BootstrapMixin, forms.ModelForm): fields = ['name', 'slug'] +class ClusterTypeCSVForm(forms.ModelForm): + slug = SlugField() + + class Meta: + model = ClusterType + fields = ['name', 'slug'] + help_texts = { + 'name': 'Name of cluster type', + } + + # # Cluster groups # @@ -50,6 +61,17 @@ class ClusterGroupForm(BootstrapMixin, forms.ModelForm): fields = ['name', 'slug'] +class ClusterGroupCSVForm(forms.ModelForm): + slug = SlugField() + + class Meta: + model = ClusterGroup + fields = ['name', 'slug'] + help_texts = { + 'name': 'Name of cluster group', + } + + # # Clusters # diff --git a/netbox/virtualization/tables.py b/netbox/virtualization/tables.py index a40af6091..f7b7ffbe9 100644 --- a/netbox/virtualization/tables.py +++ b/netbox/virtualization/tables.py @@ -37,6 +37,7 @@ VIRTUALMACHINE_PRIMARY_IP = """ class ClusterTypeTable(BaseTable): pk = ToggleColumn() + name = tables.LinkColumn() cluster_count = tables.Column(verbose_name='Clusters') actions = tables.TemplateColumn( template_code=CLUSTERTYPE_ACTIONS, @@ -55,6 +56,7 @@ class ClusterTypeTable(BaseTable): class ClusterGroupTable(BaseTable): pk = ToggleColumn() + name = tables.LinkColumn() cluster_count = tables.Column(verbose_name='Clusters') actions = tables.TemplateColumn( template_code=CLUSTERGROUP_ACTIONS, diff --git a/netbox/virtualization/urls.py b/netbox/virtualization/urls.py index 9d976f300..ca794cdd8 100644 --- a/netbox/virtualization/urls.py +++ b/netbox/virtualization/urls.py @@ -12,12 +12,14 @@ urlpatterns = [ # Cluster types url(r'^cluster-types/$', views.ClusterTypeListView.as_view(), name='clustertype_list'), url(r'^cluster-types/add/$', views.ClusterTypeCreateView.as_view(), name='clustertype_add'), + url(r'^cluster-types/import/$', views.ClusterTypeBulkImportView.as_view(), name='clustertype_import'), url(r'^cluster-types/delete/$', views.ClusterTypeBulkDeleteView.as_view(), name='clustertype_bulk_delete'), url(r'^cluster-types/(?P