home.html 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {% extends 'base/layout.html' %}
  2. {% load get_status %}
  3. {% load helpers %}
  4. {% load render_table from django_tables2 %}
  5. {% block header %}
  6. {% if new_release %}
  7. {# new_release is set only if the current user is a superuser or staff member #}
  8. <div class="header-alert-container">
  9. <div class="alert alert-info text-center mw-md-50" role="alert">
  10. <h6 class="alert-heading">
  11. <i class="mdi mdi-information-outline"></i><br/>New Release Available
  12. </h6>
  13. <small><a href="{{ new_release.url }}">NetBox v{{ new_release.version }}</a> is available.</small>
  14. <hr class="my-2" />
  15. <small class="mb-0">
  16. <a href="https://netbox.readthedocs.io/en/stable/installation/upgrading/">Upgrade Instructions</a>
  17. </small>
  18. </div>
  19. </div>
  20. {% endif %}
  21. {% endblock %}
  22. {% block title %}Home{% endblock %}
  23. {% block content-wrapper %}
  24. <div class="p-3">
  25. {# General stats #}
  26. <div class="row masonry">
  27. {% for section, items, icon in stats %}
  28. <div class="col col-sm-12 col-lg-6 col-xl-4 my-2 masonry-item">
  29. <div class="card">
  30. <h6 class="card-header text-primary text-center">
  31. <i class="mdi mdi-{{ icon }}"></i>
  32. <span class="ms-1">{{ section }}</span>
  33. </h6>
  34. <div class="card-body">
  35. <div class="list-group list-group-flush">
  36. {% for item in items %}
  37. {% if not item.disabled %}
  38. <a href="{% url item.url %}" class="list-group-item list-group-item-action">
  39. <div class="d-flex w-100 justify-content-between align-items-center">
  40. {{ item.label }}
  41. <h4 class="mb-1">{{ item.count }}</h4>
  42. </div>
  43. </a>
  44. {% else %}
  45. <li class="list-group-item list-group-item-action disabled">
  46. <div class="d-flex w-100 justify-content-between align-items-center">
  47. {{ item.label }}
  48. <h4 class="mb-1">
  49. <i title="No permission" class="mdi mdi-lock"></i>
  50. </h4>
  51. </div>
  52. </li>
  53. {% endif %}
  54. {% endfor %}
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. {% endfor %}
  60. </div>
  61. {# Changelog #}
  62. {% if perms.extras.view_objectchange %}
  63. <div class="row my-4 flex-grow-1 changelog-container">
  64. <div class="col">
  65. <div class="card">
  66. <h6 class="card-header text-primary text-center">
  67. <i class="mdi mdi-clipboard-clock"></i>
  68. <span class="ms-1">Change Log</span>
  69. </h6>
  70. <div class="card-body table-responsive">
  71. {% render_table changelog_table 'inc/table.html' %}
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. {% endif %}
  77. </div>
  78. {% endblock content-wrapper %}