rearport.html 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. {% extends 'dcim/device_component.html' %}
  2. {% load helpers %}
  3. {% load plugins %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-md-6">
  7. <div class="panel panel-default">
  8. <div class="panel-heading">
  9. <strong>Rear Port</strong>
  10. </div>
  11. <table class="table table-hover panel-body attr-table">
  12. <tr>
  13. <td>Device</td>
  14. <td>
  15. <a href="{{ instance.device.get_absolute_url }}">{{ instance.device }}</a>
  16. </td>
  17. </tr>
  18. <tr>
  19. <td>Name</td>
  20. <td>{{ instance.name }}</td>
  21. </tr>
  22. <tr>
  23. <td>Label</td>
  24. <td>{{ instance.label|placeholder }}</td>
  25. </tr>
  26. <tr>
  27. <td>Type</td>
  28. <td>{{ instance.get_type_display }}</td>
  29. </tr>
  30. <tr>
  31. <td>Positions</td>
  32. <td>{{ instance.positions }}</td>
  33. </tr>
  34. <tr>
  35. <td>Description</td>
  36. <td>{{ instance.description|placeholder }}</td>
  37. </tr>
  38. </table>
  39. </div>
  40. {% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %}
  41. {% plugin_left_page instance %}
  42. </div>
  43. <div class="col-md-6">
  44. <div class="panel panel-default">
  45. <div class="panel-heading">
  46. <strong>Connection</strong>
  47. </div>
  48. {% if instance.cable %}
  49. <table class="table table-hover panel-body attr-table">
  50. <tr>
  51. <td>Cable</td>
  52. <td>
  53. <a href="{{ instance.cable.get_absolute_url }}">{{ instance.cable }}</a>
  54. <a href="{% url 'dcim:rearport_trace' pk=instance.pk %}" class="btn btn-primary btn-xs" title="Trace">
  55. <i class="fa fa-share-alt" aria-hidden="true"></i>
  56. </a>
  57. </td>
  58. </tr>
  59. <tr>
  60. <td>Connection Status</td>
  61. <td>
  62. {% if instance.cable.status %}
  63. <span class="label label-success">{{ instance.cable.get_status_display }}</span>
  64. {% else %}
  65. <span class="label label-info">{{ instance.cable.get_status_display }}</span>
  66. {% endif %}
  67. </td>
  68. </tr>
  69. </table>
  70. {% else %}
  71. <div class="panel-body text-muted">
  72. Not connected
  73. {% if perms.dcim.add_cable %}
  74. <span class="dropdown pull-right">
  75. <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  76. <span class="glyphicon glyphicon-resize-small" aria-hidden="true"></span> Connect
  77. </button>
  78. <ul class="dropdown-menu dropdown-menu-right">
  79. <li><a href="{% url 'dcim:rearport_connect' termination_a_id=instance.pk termination_b_type='interface' %}?return_url={{ instance.get_absolute_url }}">Interface</a></li>
  80. <li><a href="{% url 'dcim:rearport_connect' termination_a_id=instance.pk termination_b_type='front-port' %}?return_url={{ instance.get_absolute_url }}">Front Port</a></li>
  81. <li><a href="{% url 'dcim:rearport_connect' termination_a_id=instance.pk termination_b_type='rear-port' %}?return_url={{ instance.get_absolute_url }}">Rear Port</a></li>
  82. <li><a href="{% url 'dcim:rearport_connect' termination_a_id=instance.pk termination_b_type='circuit-termination' %}?return_url={{ instance.get_absolute_url }}">Circuit Termination</a></li>
  83. </ul>
  84. </span>
  85. {% endif %}
  86. </div>
  87. {% endif %}
  88. </div>
  89. {% plugin_right_page instance %}
  90. </div>
  91. </div>
  92. <div class="row">
  93. <div class="col-md-12">
  94. {% plugin_full_width_page instance %}
  95. </div>
  96. </div>
  97. {% endblock %}