Parcourir la source

Fixes #143: Noted that the lowest occupied U is used for mounting multi-U devices

Jeremy Stretch il y a 8 ans
Parent
commit
d2bcd71b32
3 fichiers modifiés avec 8 ajouts et 8 suppressions
  1. 3 3
      docs/dcim.md
  2. 4 4
      netbox/dcim/forms.py
  3. 1 1
      netbox/templates/dcim/device_import.html

+ 3 - 3
docs/dcim.md

@@ -59,11 +59,11 @@ Note that assignment of components from templates occurs only at the time of dev
 
 # Devices
 
-Every piece of hardware which is installed within a rack exists in NetBox as a device. Devices are measured in rack units (U) and whether they are full depth. 0U devices which can be installed in a rack but don't consume vertical rack space (such as a vertically-mounted power distribution unit) can also be defined.
+Every piece of hardware which is installed within a rack exists in NetBox as a device. Devices are measured in rack units (U) and depth. 0U devices which can be installed in a rack but don't consume vertical rack space (such as a vertically-mounted power distribution unit) can also be defined.
 
-A device is said to be "full depth" if its installation on one rack face prevents the installation of any other device on the opposite face within the same rack unit(s). This could be either because the device is physically too deep to allow a device behind it, or because the installation of an opposing device would impede air flow.
+When assigning a multi-U device to a rack, it is considered to be mounted in the lowest-numbered rack unit which it occupies. For example, a 3U device which occupies U8 through U10 shows as being mounted in U8.
 
-Each device has a physical device type (make and model), which is discussed below.
+A device is said to be "full depth" if its installation on one rack face prevents the installation of any other device on the opposite face within the same rack unit(s). This could be either because the device is physically too deep to allow a device behind it, or because the installation of an opposing device would impede air flow.
 
 ### Roles
 

+ 4 - 4
netbox/dcim/forms.py

@@ -326,10 +326,10 @@ class DeviceForm(forms.ModelForm, BootstrapMixin):
         display_field='display_name',
         attrs={'filter-for': 'position'}
     ))
-    position = forms.TypedChoiceField(required=False, empty_value=None, widget=APISelect(
-        api_url='/api/dcim/racks/{{rack}}/rack-units/?face={{face}}',
-        disabled_indicator='device',
-    ))
+    position = forms.TypedChoiceField(required=False, empty_value=None,
+                                      help_text="For multi-U devices, this is the lowest occupied rack unit.",
+                                      widget=APISelect(api_url='/api/dcim/racks/{{rack}}/rack-units/?face={{face}}',
+                                                       disabled_indicator='device'))
     manufacturer = forms.ModelChoiceField(queryset=Manufacturer.objects.all(),
                                           widget=forms.Select(attrs={'filter-for': 'device_type'}))
     device_type = forms.ModelChoiceField(queryset=DeviceType.objects.all(), label='Model', widget=APISelect(

+ 1 - 1
netbox/templates/dcim/device_import.html

@@ -68,7 +68,7 @@
 				</tr>
 				<tr>
 					<td>Position (U)</td>
-					<td>Numeric rack position (optional)</td>
+					<td>Lowest rack unit occupied by the device (optional)</td>
 					<td>21</td>
 				</tr>
 				<tr>