From 8ff10d5995ddfe0a9d4025ada0dff610d032c2ab Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 14 Nov 2017 13:29:46 -0500 Subject: [PATCH 1/8] Post-release version bump --- netbox/netbox/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 791f7a068..557b8f067 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -13,7 +13,7 @@ except ImportError: ) -VERSION = '2.2.5' +VERSION = '2.2.6-dev' BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) From 0cb3e1749b2369e639332edc42b504942f2c3b15 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 15 Nov 2017 12:37:08 -0500 Subject: [PATCH 2/8] Fixes #1717: Fixed inteface validation for virtual machines --- netbox/dcim/models.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/netbox/dcim/models.py b/netbox/dcim/models.py index 84d4dc39c..003bc408a 100644 --- a/netbox/dcim/models.py +++ b/netbox/dcim/models.py @@ -1120,6 +1120,8 @@ class ConsoleServerPort(models.Model): def clean(self): # Check that the parent device's DeviceType is a console server + if self.device is None: + raise ValidationError("Console server ports must be assigned to devices.") device_type = self.device.device_type if not device_type.is_console_server: raise ValidationError("The {} {} device type not support assignment of console server ports.".format( @@ -1194,6 +1196,8 @@ class PowerOutlet(models.Model): def clean(self): # Check that the parent device's DeviceType is a PDU + if self.device is None: + raise ValidationError("Power outlets must be assigned to devices.") device_type = self.device.device_type if not device_type.is_pdu: raise ValidationError("The {} {} device type not support assignment of power outlets.".format( @@ -1257,11 +1261,12 @@ class Interface(models.Model): def clean(self): # Check that the parent device's DeviceType is a network device - device_type = self.device.device_type - if not device_type.is_network_device: - raise ValidationError("The {} {} device type not support assignment of network interfaces.".format( - device_type.manufacturer, device_type - )) + if self.device is not None: + device_type = self.device.device_type + if not device_type.is_network_device: + raise ValidationError("The {} {} device type not support assignment of network interfaces.".format( + device_type.manufacturer, device_type + )) # An Interface must belong to a Device *or* to a VirtualMachine if self.device and self.virtual_machine: From d888aa67f94850bfe6af8821d04d87d107f96eb6 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 15 Nov 2017 12:52:21 -0500 Subject: [PATCH 3/8] Fixes #1715: Added missing import buttons on object lists --- netbox/templates/circuits/circuittype_list.html | 4 ++++ netbox/templates/dcim/devicerole_list.html | 4 ++++ netbox/templates/dcim/platform_list.html | 4 ++++ netbox/templates/dcim/rackrole_list.html | 4 ++++ netbox/templates/ipam/rir_list.html | 4 ++++ netbox/templates/ipam/role_list.html | 4 ++++ netbox/templates/ipam/vlangroup_list.html | 4 ++++ netbox/templates/secrets/secretrole_list.html | 4 ++++ netbox/templates/tenancy/tenantgroup_list.html | 4 ++++ netbox/templates/virtualization/clustergroup_list.html | 4 ++++ netbox/templates/virtualization/clustertype_list.html | 4 ++++ 11 files changed, 44 insertions(+) diff --git a/netbox/templates/circuits/circuittype_list.html b/netbox/templates/circuits/circuittype_list.html index f545b1a1e..ce9cdf385 100644 --- a/netbox/templates/circuits/circuittype_list.html +++ b/netbox/templates/circuits/circuittype_list.html @@ -8,6 +8,10 @@ Add a circuit type + + + Import circuit types + {% endif %}

{% block title %}Circuit Types{% endblock %}

diff --git a/netbox/templates/dcim/devicerole_list.html b/netbox/templates/dcim/devicerole_list.html index 2e8189017..871e62806 100644 --- a/netbox/templates/dcim/devicerole_list.html +++ b/netbox/templates/dcim/devicerole_list.html @@ -8,6 +8,10 @@ Add a device role + + + Import device roles + {% endif %}

{% block title %}Device Roles{% endblock %}

diff --git a/netbox/templates/dcim/platform_list.html b/netbox/templates/dcim/platform_list.html index 124277d0b..dc8d43660 100644 --- a/netbox/templates/dcim/platform_list.html +++ b/netbox/templates/dcim/platform_list.html @@ -8,6 +8,10 @@ Add a platform + + + Import platforms + {% endif %}

{% block title %}Platforms{% endblock %}

diff --git a/netbox/templates/dcim/rackrole_list.html b/netbox/templates/dcim/rackrole_list.html index 1133cf9b2..e18bf7941 100644 --- a/netbox/templates/dcim/rackrole_list.html +++ b/netbox/templates/dcim/rackrole_list.html @@ -8,6 +8,10 @@ Add a rack role + + + Import rack roles + {% endif %}

{% block title %}Rack Roles{% endblock %}

diff --git a/netbox/templates/ipam/rir_list.html b/netbox/templates/ipam/rir_list.html index df97aec88..bd2a30c2a 100644 --- a/netbox/templates/ipam/rir_list.html +++ b/netbox/templates/ipam/rir_list.html @@ -20,6 +20,10 @@ Add a RIR + + + Import RIRs + {% endif %}

{% block title %}RIRs{% endblock %}

diff --git a/netbox/templates/ipam/role_list.html b/netbox/templates/ipam/role_list.html index d1c5356f4..54b0a8925 100644 --- a/netbox/templates/ipam/role_list.html +++ b/netbox/templates/ipam/role_list.html @@ -8,6 +8,10 @@ Add a role + + + Import roles + {% endif %}

{% block title %}Prefix/VLAN Roles{% endblock %}

diff --git a/netbox/templates/ipam/vlangroup_list.html b/netbox/templates/ipam/vlangroup_list.html index 2a9e7e3ae..77d8e9b30 100644 --- a/netbox/templates/ipam/vlangroup_list.html +++ b/netbox/templates/ipam/vlangroup_list.html @@ -8,6 +8,10 @@ Add a VLAN group + + + Import VLAN groups + {% endif %}

{% block title %}VLAN Groups{% endblock %}

diff --git a/netbox/templates/secrets/secretrole_list.html b/netbox/templates/secrets/secretrole_list.html index 936445dec..ccaa20730 100644 --- a/netbox/templates/secrets/secretrole_list.html +++ b/netbox/templates/secrets/secretrole_list.html @@ -8,6 +8,10 @@ Add a secret role + + + Import secret roles + {% endif %}

{% block title %}Secret Roles{% endblock %}

diff --git a/netbox/templates/tenancy/tenantgroup_list.html b/netbox/templates/tenancy/tenantgroup_list.html index f487122ab..3bffb5c6b 100644 --- a/netbox/templates/tenancy/tenantgroup_list.html +++ b/netbox/templates/tenancy/tenantgroup_list.html @@ -8,6 +8,10 @@ Add a tenant group + + + Import tenant groups + {% endif %}

{% block title %}Tenant Groups{% endblock %}

diff --git a/netbox/templates/virtualization/clustergroup_list.html b/netbox/templates/virtualization/clustergroup_list.html index c237a61b5..6d28400c0 100644 --- a/netbox/templates/virtualization/clustergroup_list.html +++ b/netbox/templates/virtualization/clustergroup_list.html @@ -8,6 +8,10 @@ Add a cluster group + + + Import cluster groups + {% endif %}

{% block title %}Cluster Groups{% endblock %}

diff --git a/netbox/templates/virtualization/clustertype_list.html b/netbox/templates/virtualization/clustertype_list.html index a7082ebe8..7d905ba06 100644 --- a/netbox/templates/virtualization/clustertype_list.html +++ b/netbox/templates/virtualization/clustertype_list.html @@ -8,6 +8,10 @@ Add a cluster type + + + Import cluster types + {% endif %}

{% block title %}Cluster Types{% endblock %}

From 124878ed22211ec039a4aa823b52240769dfa253 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 15 Nov 2017 14:44:33 -0500 Subject: [PATCH 4/8] Fixes #1599: Display global search in navigation menu unless display is less than 1200px wide --- netbox/project-static/css/base.css | 15 +++++++++------ netbox/templates/inc/nav_menu.html | 4 +++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/netbox/project-static/css/base.css b/netbox/project-static/css/base.css index dca3cd948..23092eda0 100644 --- a/netbox/project-static/css/base.css +++ b/netbox/project-static/css/base.css @@ -35,6 +35,13 @@ footer p { margin: 20px 0; } +/* Hide the username in the navigation menu on displays less than 1400px wide */ +@media (max-width: 1399px) { + #navbar_user { + display: none; + } +} + /* Collapse the nav menu on displays less than 1200px wide */ @media (max-width: 1199px) { .navbar-header { @@ -72,12 +79,8 @@ footer p { .collapse.in { display:block !important; } -} - -/* Hide the nav search bar on displays less than 1600px wide */ -@media (max-width: 1599px) { - #navbar_search { - display: none; + #navbar_user { + display: inline; } } diff --git a/netbox/templates/inc/nav_menu.html b/netbox/templates/inc/nav_menu.html index c1dc9dc67..dd811fb54 100644 --- a/netbox/templates/inc/nav_menu.html +++ b/netbox/templates/inc/nav_menu.html @@ -379,7 +379,9 @@ {% if request.user.is_authenticated %}