2
0

device_header.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 }}</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. {% if perms.dcim.napalm_read %}
  49. {% if device.status == 1 and device.platform.napalm_driver and device.primary_ip %}
  50. <li role="presentation"{% if active_tab == 'status' %} class="active"{% endif %}><a href="{% url 'dcim:device_status' pk=device.pk %}">Status</a></li>
  51. <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>
  52. <li role="presentation"{% if active_tab == 'config' %} class="active"{% endif %}><a href="{% url 'dcim:device_config' pk=device.pk %}">Configuration</a></li>
  53. {% else %}
  54. <li role="presentation" class="disabled"><a href="#">Status</a></li>
  55. <li role="presentation" class="disabled"><a href="#">LLDP Neighbors</a></li>
  56. <li role="presentation" class="disabled"><a href="#">Configuration</a></li>
  57. {% endif %}
  58. {% endif %}
  59. </ul>