device_header.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <div class="row">
  2. <div class="col-sm-8 col-md-9">
  3. <ol class="breadcrumb">
  4. <li><a href="{% url 'dcim:site' slug=device.site.slug %}">{{ device.site }}</a></li>
  5. {% if device.rack %}
  6. <li><a href="{% url 'dcim:rack_list' %}?site={{ device.site.slug }}">Racks</a></li>
  7. <li><a href="{% url 'dcim:rack' pk=device.rack.pk %}">{{ device.rack }}</a></li>
  8. {% endif %}
  9. {% if device.parent_bay %}
  10. <li><a href="{% url 'dcim:device' pk=device.parent_bay.device.pk %}">{{ device.parent_bay.device }}</a></li>
  11. <li>{{ device.parent_bay.name }}</li>
  12. {% endif %}
  13. <li>{{ device }}</li>
  14. </ol>
  15. </div>
  16. <div class="col-sm-4 col-md-3">
  17. <form action="{% url 'dcim:device_list' %}" method="get">
  18. <div class="input-group">
  19. <input type="text" name="q" class="form-control" placeholder="Search devices" />
  20. <span class="input-group-btn">
  21. <button type="submit" class="btn btn-primary">
  22. <span class="fa fa-search" aria-hidden="true"></span>
  23. </button>
  24. </span>
  25. </div>
  26. </form>
  27. </div>
  28. </div>
  29. <div class="pull-right">
  30. {% if perms.dcim.change_device %}
  31. <a href="{% url 'dcim:device_edit' pk=device.pk %}" class="btn btn-warning">
  32. <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
  33. Edit this device
  34. </a>
  35. {% endif %}
  36. {% if perms.dcim.delete_device %}
  37. <a href="{% url 'dcim:device_delete' pk=device.pk %}" class="btn btn-danger">
  38. <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
  39. Delete this device
  40. </a>
  41. {% endif %}
  42. </div>
  43. <h1>{{ device }}</h1>
  44. {% include 'inc/created_updated.html' with obj=device %}
  45. <ul class="nav nav-tabs" style="margin-bottom: 20px">
  46. <li role="presentation"{% if active_tab == 'info' %} class="active"{% endif %}><a href="{% url 'dcim:device' pk=device.pk %}">Info</a></li>
  47. <li role="presentation"{% if active_tab == 'inventory' %} class="active"{% endif %}><a href="{% url 'dcim:device_inventory' pk=device.pk %}">Inventory</a></li>
  48. <li role="presentation"{% if active_tab == 'status' %} class="active"{% endif %}><a href="{% url 'dcim:device_status' pk=device.pk %}">Status</a></li>
  49. {% if device.status == 1 and device.platform.rpc_client and device.primary_ip %}
  50. <li role="presentation"{% if active_tab == 'lldp-neighbors' %} class="active"{% endif %}><a href="{% url 'dcim:device_lldp_neighbors' pk=device.pk %}">LLDP Neighbors</a></li>
  51. {% endif %}
  52. </ul>