Browse Source

Standardized console/power/interface display

Jeremy Stretch 8 years ago
parent
commit
c0ab9f70dc

+ 29 - 14
netbox/templates/dcim/device.html

@@ -165,7 +165,7 @@
                 <div class="panel-footer text-right">
                     <a href="{% url 'dcim:ipaddress_assign' pk=device.pk %}" class="btn btn-xs btn-primary">
                         <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
-                        Assign IP Address
+                        Assign IP address
                     </a>
                 </div>
             {% endif %}
@@ -276,9 +276,6 @@
         {% if device_bays or device.device_type.is_parent_device %}
             <div class="panel panel-default">
                 <div class="panel-heading">
-                    {% if perms.dcim.add_devicebay %}
-                        <a href="{% url 'dcim:devicebay_add' pk=device.pk %}" class="btn btn-primary btn-xs pull-right"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add Device Bays</a>
-                    {% endif %}
                     <strong>Device Bays</strong>
                 </div>
                 <table class="table table-hover panel-body">
@@ -290,6 +287,14 @@
                         </tr>
                     {% endfor %}
                 </table>
+                {% if perms.dcim.add_devicebay %}
+                    <div class="panel-footer text-right">
+                        <a href="{% url 'dcim:devicebay_add' pk=device.pk %}" class="btn btn-primary btn-xs">
+                            <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
+                            Add device bays
+                        </a>
+                    </div>
+                {% endif %}
             </div>
         {% endif %}
         {% if interfaces or device.device_type.is_network_device %}
@@ -308,10 +313,10 @@
                 </table>
                 {% if perms.dcim.add_interface %}
                     <div class="panel-footer text-right">
-                      <a href="{% url 'dcim:interface_add' pk=device.pk %}" class="btn btn-xs btn-primary">
-                          <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
-                          Add interface
-                      </a>
+                        <a href="{% url 'dcim:interface_add' pk=device.pk %}" class="btn btn-primary btn-xs">
+                            <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
+                            Add interface
+                        </a>
                      </div>
                 {% endif %}
             </div>
@@ -319,9 +324,6 @@
         {% if cs_ports or device.device_type.is_console_server %}
             <div class="panel panel-default">
                 <div class="panel-heading">
-                    {% if perms.dcim.add_consoleserverport %}
-                        <a href="{% url 'dcim:consoleserverport_add' pk=device.pk %}" class="btn btn-primary btn-xs pull-right"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add Console Server Ports</a>
-                    {% endif %}
                     <strong>Console Server Ports</strong>
                 </div>
                 <table class="table table-hover panel-body">
@@ -333,14 +335,19 @@
                         </tr>
                     {% endfor %}
                 </table>
+                {% if perms.dcim.add_consoleserverport %}
+                    <div class="panel-footer text-right">
+                        <a href="{% url 'dcim:consoleserverport_add' pk=device.pk %}" class="btn btn-primary btn-xs">
+                            <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
+                            Add console server ports
+                        </a>
+                    </div>
+                {% endif %}
             </div>
         {% endif %}
         {% if power_outlets or device.device_type.is_pdu %}
             <div class="panel panel-default">
                 <div class="panel-heading">
-                    {% if perms.dcim.add_poweroutlet %}
-                        <a href="{% url 'dcim:poweroutlet_add' pk=device.pk %}" class="btn btn-primary btn-xs pull-right"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add Power Outlets</a>
-                    {% endif %}
                     <strong>Power Outlets</strong>
                 </div>
                 <table class="table table-hover panel-body">
@@ -352,6 +359,14 @@
                         </tr>
                     {% endfor %}
                 </table>
+                {% if perms.dcim.add_poweroutlet %}
+                    <div class="panel-footer text-right">
+                        <a href="{% url 'dcim:poweroutlet_add' pk=device.pk %}" class="btn btn-primary btn-xs">
+                            <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
+                            Add power outlets
+                        </a>
+                    </div>
+                {% endif %}
             </div>
         {% endif %}
 	</div>

+ 1 - 0
netbox/templates/dcim/inc/_consoleport.html

@@ -2,6 +2,7 @@
     <td>
         <i class="fa fa-fw fa-keyboard-o"></i> {{ cp.name }}
     </td>
+    <td></td>
     {% if cp.cs_port %}
         <td>
             <a href="{% url 'dcim:device' pk=cp.cs_port.device.pk %}">{{ cp.cs_port.device }}</a>

+ 10 - 9
netbox/templates/dcim/inc/_interface.html

@@ -5,27 +5,28 @@
             <i class="fa fa-fw fa-comment-o" title="{{ iface.description }}"></i>
         {% endif %}
     </td>
+    <td>
+        <small>{{ iface.mac_address|default:'' }}</small>
+    </td>
     {% if not iface.is_physical %}
-        <td>Virtual</td>
+        <td colspan="2">Virtual</td>
     {% elif iface.connection %}
         {% with iface.get_connected_interface as connected_iface %}
             <td>
                 <a href="{% url 'dcim:device' pk=connected_iface.device.pk %}">{{ connected_iface.device }}</a>
-                &Colon;
+            </td>
+            <td>
                 <span title="{{ connected_iface.get_form_factor_display }}">{{ connected_iface }}</span>
             </td>
         {% endwith %}
     {% elif iface.circuit %}
-        <td>
+        <td colspan="2">
             <a href="{% url 'circuits:circuit' pk=iface.circuit.pk %}">{{ iface.circuit }}</a>
         </td>
     {% else %}
-        <td>Not connected</td>
-    {% endif %}
-    {% if iface.mac_address %}
-        <td><span class="small text-muted">{{ iface.mac_address }}</span></td>
-    {% else %}
-        <td><span class="small text-muted">00:00:00:00:00:00</span></td>
+        <td colspan="2">
+            <span class="text-muted">Not connected</span>
+        </td>
     {% endif %}
     <td class="text-right">
         {% if iface.circuit or iface.connection %}

+ 1 - 0
netbox/templates/dcim/inc/_powerport.html

@@ -2,6 +2,7 @@
     <td>
         <i class="fa fa-fw fa-bolt"></i> {{ pp.name }}
     </td>
+    <td></td>
     {% if pp.power_outlet %}
         <td>
             <a href="{% url 'dcim:device' pk=pp.power_outlet.device.pk %}">{{ pp.power_outlet.device }}</a>