Browse Source

Merge pull request #23 from digitalocean/develop

1.0.1
Jeremy Stretch 9 years ago
parent
commit
a35d927235
7 changed files with 19 additions and 8 deletions
  1. 6 0
      README.md
  2. BIN
      docs/screenshot1.png
  3. BIN
      docs/screenshot2.png
  4. BIN
      docs/screenshot3.png
  5. 6 0
      netbox/dcim/filters.py
  6. 5 6
      netbox/dcim/forms.py
  7. 2 2
      netbox/templates/_base.html

+ 6 - 0
README.md

@@ -2,6 +2,12 @@ NetBox is an IP address management (IPAM) and data center infrastructure managem
 
 NetBox runs as a web application atop the [Django](https://www.djangoproject.com/) Python framework with a [PostgreSQL](http://www.postgresql.org/) database. For a complete list of requirements, see `requirements.txt`. The code is available [on GitHub](https://github.com/digitalocean/netbox).
 
+![Screenshot of main page](docs/screenshot1.png "Main page")
+
+![Screenshot of rack elevation](docs/screenshot2.png "Rack elevation")
+
+![Screenshot of prefix hierarchy](docs/screenshot3.png "Prefix hierarchy")
+
 # Installation
 
 Please see docs/getting-started.md for instructions on installing NetBox.

BIN
docs/screenshot1.png


BIN
docs/screenshot2.png


BIN
docs/screenshot3.png


+ 6 - 0
netbox/dcim/filters.py

@@ -47,6 +47,12 @@ class RackFilter(django_filters.FilterSet):
         queryset=RackGroup.objects.all(),
         label='Group (ID)',
     )
+    group = django_filters.ModelMultipleChoiceFilter(
+        name='group',
+        queryset=RackGroup.objects.all(),
+        to_field_name='slug',
+        label='Group',
+    )
 
     class Meta:
         model = Rack

+ 5 - 6
netbox/dcim/forms.py

@@ -138,24 +138,23 @@ class RackForm(forms.ModelForm, BootstrapMixin):
 class RackFromCSVForm(forms.ModelForm):
     site = forms.ModelChoiceField(queryset=Site.objects.all(), to_field_name='name',
                                   error_messages={'invalid_choice': 'Site not found.'})
-    group = forms.ModelChoiceField(queryset=RackGroup.objects.all(), required=False, to_field_name='name',
-                                   error_messages={'invalid_choice': 'Group not found.'})
+    group_name = forms.CharField(required=False)
 
     class Meta:
         model = Rack
-        fields = ['site', 'group', 'name', 'facility_id', 'u_height']
+        fields = ['site', 'group_name', 'name', 'facility_id', 'u_height']
 
     def clean(self):
 
         site = self.cleaned_data.get('site')
-        group = self.cleaned_data.get('group')
+        group = self.cleaned_data.get('group_name')
 
-        # Validate device type
+        # Validate rack group
         if site and group:
             try:
                 self.instance.group = RackGroup.objects.get(site=site, name=group)
             except RackGroup.DoesNotExist:
-                self.add_error('group', "Invalid rack group ({})".format(group))
+                self.add_error('group_name', "Invalid rack group ({})".format(group))
 
 
 class RackImportForm(BulkImportForm, BootstrapMixin):

+ 2 - 2
netbox/templates/_base.html

@@ -219,7 +219,7 @@
         {% if settings.MAINTENANCE_MODE %}
             <div class="alert alert-warning text-center" role="alert">
                 <h4><i class="fa fa-exclamation-triangle"></i> Maintenance Mode</h4>
-                <p>The application is currently in maintenance mode.</p>
+                <p>NetBox is currently in maintenance mode. Functionality may be limited.</p>
             </div>
         {% endif %}
 	    {% for message in messages %}
@@ -246,7 +246,7 @@
                     <p class="text-muted">
                         <i class="fa fa-fw fa-book text-primary"></i> <a href="{% url 'docs_root' %}">Docs</a> &middot;
                         <i class="fa fa-fw fa-cloud text-primary"></i> <a href="/api/docs/">API</a> &middot;
-                        <i class="fa fa-fw fa-code text-primary"></i><a href="https://github.com/digitalocean/netbox">Code</a>
+                        <i class="fa fa-fw fa-code text-primary"></i> <a href="https://github.com/digitalocean/netbox">Code</a>
                     </p>
                 </div>
             </div>