Browse Source

Fixed IP toggle button

Jeremy Stretch 7 years ago
parent
commit
3ded8196c4
1 changed files with 17 additions and 0 deletions
  1. 17 0
      netbox/templates/virtualization/virtualmachine.html

+ 17 - 0
netbox/templates/virtualization/virtualmachine.html

@@ -258,3 +258,20 @@
 	</div>
 </div>
 {% endblock %}
+
+{% block javascript %}
+<script type="text/javascript">
+// Toggle the display of IP addresses under interfaces
+$('button.toggle-ips').click(function() {
+    var selected = $(this).attr('selected');
+    if (selected) {
+        $('#interfaces_table tr.ipaddress').hide();
+    } else {
+        $('#interfaces_table tr.ipaddress').show();
+    }
+    $(this).attr('selected', !selected);
+    $(this).children('span').toggleClass('glyphicon-check glyphicon-unchecked');
+    return false;
+});
+</script>
+{% endblock %}