소스 검색

Fixed IP toggle button

Jeremy Stretch 8 년 전
부모
커밋
3ded8196c4
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  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 %}