home.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. {% extends '_base.html' %}
  2. {% load helpers %}
  3. {% block header %}
  4. {{ block.super }}
  5. {% if new_release %}
  6. <div class="alert alert-info" role="alert">
  7. A new release is available:
  8. {% if new_release_url %}<a target="_blank" href="{{ new_release_url }}">{% endif %}
  9. NetBox v{{ new_release }}
  10. {% if latest_version_url %}</a>{% endif %}
  11. </div>
  12. {% endif %}
  13. {% endblock %}
  14. {% block content %}
  15. {% include 'search_form.html' %}
  16. <div class="row">
  17. <div class="col-sm-6 col-md-4">
  18. <div class="panel panel-default">
  19. <div class="panel-heading">
  20. <strong>Organization</strong>
  21. </div>
  22. <div class="list-group">
  23. <div class="list-group-item">
  24. {% if perms.dcim.view_site %}
  25. <span class="badge pull-right">{{ stats.site_count }}</span>
  26. <h4 class="list-group-item-heading"><a href="{% url 'dcim:site_list' %}">Sites</a></h4>
  27. {% else %}
  28. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  29. <h4 class="list-group-item-heading">Sites</h4>
  30. {% endif %}
  31. <p class="list-group-item-text text-muted">Geographic locations</p>
  32. </div>
  33. <div class="list-group-item">
  34. {% if perms.tenancy.view_tenant %}
  35. <span class="badge pull-right">{{ stats.tenant_count }}</span>
  36. <h4 class="list-group-item-heading"><a href="{% url 'tenancy:tenant_list' %}">Tenants</a></h4>
  37. {% else %}
  38. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  39. <h4 class="list-group-item-heading">Tenants</h4>
  40. {% endif %}
  41. <p class="list-group-item-text text-muted">Customers or departments</p>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="panel panel-default">
  46. <div class="panel-heading">
  47. <strong>DCIM</strong>
  48. </div>
  49. <div class="list-group">
  50. <div class="list-group-item">
  51. {% if perms.dcim.view_rack %}
  52. <span class="badge pull-right">{{ stats.rack_count }}</span>
  53. <h4 class="list-group-item-heading"><a href="{% url 'dcim:rack_list' %}">Racks</a></h4>
  54. {% else %}
  55. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  56. <h4 class="list-group-item-heading">Racks</h4>
  57. {% endif %}
  58. <p class="list-group-item-text text-muted">Equipment racks, optionally organized by group</p>
  59. </div>
  60. <div class="list-group-item">
  61. {% if perms.dcim.view_devicetype %}
  62. <span class="badge pull-right">{{ stats.devicetype_count }}</span>
  63. <h4 class="list-group-item-heading"><a href="{% url 'dcim:devicetype_list' %}">Device Types</a></h4>
  64. {% else %}
  65. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  66. <h4 class="list-group-item-heading">Device Types</h4>
  67. {% endif %}
  68. <p class="list-group-item-text text-muted">Physical hardware models by manufacturer</p>
  69. </div>
  70. <div class="list-group-item">
  71. {% if perms.dcim.view_device %}
  72. <span class="badge pull-right">{{ stats.device_count }}</span>
  73. <h4 class="list-group-item-heading"><a href="{% url 'dcim:device_list' %}">Devices</a></h4>
  74. {% else %}
  75. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  76. <h4 class="list-group-item-heading">Devices</h4>
  77. {% endif %}
  78. <p class="list-group-item-text text-muted">Rack-mounted network equipment, servers, and other devices</p>
  79. </div>
  80. <div class="list-group-item">
  81. <h4 class="list-group-item-heading">Connections</h4>
  82. {% if perms.dcim.view_cable %}
  83. <span class="badge pull-right">{{ stats.cable_count }}</span>
  84. <p style="padding-left: 20px;"><a href="{% url 'dcim:cable_list' %}">Cables</a></p>
  85. {% else %}
  86. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  87. <p style="padding-left: 20px;">Cables</p>
  88. {% endif %}
  89. {% if perms.dcim.view_interface %}
  90. <span class="badge pull-right">{{ stats.interface_connections_count }}</span>
  91. <p style="padding-left: 20px;"><a href="{% url 'dcim:interface_connections_list' %}">Interfaces</a></p>
  92. {% else %}
  93. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  94. <p style="padding-left: 20px;">Interfaces</p>
  95. {% endif %}
  96. {% if perms.dcim.view_consoleport and perms.dcim.view_consoleserverport %}
  97. <span class="badge pull-right">{{ stats.console_connections_count }}</span>
  98. <p style="padding-left: 20px;"><a href="{% url 'dcim:console_connections_list' %}">Console</a></p>
  99. {% else %}
  100. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  101. <p style="padding-left: 20px;">Console</p>
  102. {% endif %}
  103. {% if perms.dcim.view_powerport and perms.dcim.view_poweroutlet %}
  104. <span class="badge pull-right">{{ stats.power_connections_count }}</span>
  105. <p class="list-group-item-text" style="padding-left: 20px;"><a href="{% url 'dcim:power_connections_list' %}">Power</a></p>
  106. {% else %}
  107. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  108. <p style="padding-left: 20px;">Power</p>
  109. {% endif %}
  110. </div>
  111. </div>
  112. </div>
  113. <div class="panel panel-default">
  114. <div class="panel-heading">
  115. <strong>Power</strong>
  116. </div>
  117. <div class="list-group">
  118. <div class="list-group-item">
  119. {% if perms.dcim.view_powerfeed %}
  120. <span class="badge pull-right">{{ stats.powerfeed_count }}</span>
  121. <h4 class="list-group-item-heading"><a href="{% url 'dcim:powerfeed_list' %}">Power Feeds</a></h4>
  122. {% else %}
  123. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  124. <h4 class="list-group-item-heading">Power Feeds</h4>
  125. {% endif %}
  126. <p class="list-group-item-text text-muted">Electrical circuits delivering power from panels</p>
  127. </div>
  128. <div class="list-group-item">
  129. {% if perms.dcim.view_powerpanel %}
  130. <span class="badge pull-right">{{ stats.powerpanel_count }}</span>
  131. <h4 class="list-group-item-heading"><a href="{% url 'dcim:powerpanel_list' %}">Power Panels</a></h4>
  132. {% else %}
  133. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  134. <h4 class="list-group-item-heading">Power Panels</h4>
  135. {% endif %}
  136. <p class="list-group-item-text text-muted">Electrical panels receiving utility power</p>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="col-sm-6 col-md-4">
  142. <div class="panel panel-default">
  143. <div class="panel-heading">
  144. <strong>IPAM</strong>
  145. </div>
  146. <div class="list-group">
  147. <div class="list-group-item">
  148. {% if perms.ipam.view_vrf %}
  149. <span class="badge pull-right">{{ stats.vrf_count }}</span>
  150. <h4 class="list-group-item-heading"><a href="{% url 'ipam:vrf_list' %}">VRFs</a></h4>
  151. {% else %}
  152. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  153. <h4 class="list-group-item-heading">VRFs</h4>
  154. {% endif %}
  155. <p class="list-group-item-text text-muted">Virtual routing and forwarding tables</p>
  156. </div>
  157. <div class="list-group-item">
  158. {% if perms.ipam.view_aggregate %}
  159. <span class="badge pull-right">{{ stats.aggregate_count }}</span>
  160. <h4 class="list-group-item-heading"><a href="{% url 'ipam:aggregate_list' %}">Aggregates</a></h4>
  161. {% else %}
  162. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  163. <h4 class="list-group-item-heading">Aggregates</h4>
  164. {% endif %}
  165. <p class="list-group-item-text text-muted">Top-level IP allocations</p>
  166. </div>
  167. <div class="list-group-item">
  168. {% if perms.ipam.view_prefix %}
  169. <span class="badge pull-right">{{ stats.prefix_count }}</span>
  170. <h4 class="list-group-item-heading"><a href="{% url 'ipam:prefix_list' %}">Prefixes</a></h4>
  171. {% else %}
  172. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  173. <h4 class="list-group-item-heading">Prefixes</h4>
  174. {% endif %}
  175. <p class="list-group-item-text text-muted">IPv4 and IPv6 network assignments</p>
  176. </div>
  177. <div class="list-group-item">
  178. {% if perms.ipam.view_ipaddress %}
  179. <span class="badge pull-right">{{ stats.ipaddress_count }}</span>
  180. <h4 class="list-group-item-heading"><a href="{% url 'ipam:ipaddress_list' %}">IP Addresses</a></h4>
  181. {% else %}
  182. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  183. <h4 class="list-group-item-heading">IP Addresses</h4>
  184. {% endif %}
  185. <p class="list-group-item-text text-muted">Individual IPv4 and IPv6 addresses</p>
  186. </div>
  187. <div class="list-group-item">
  188. {% if perms.ipam.view_vlan %}
  189. <span class="badge pull-right">{{ stats.vlan_count }}</span>
  190. <h4 class="list-group-item-heading"><a href="{% url 'ipam:vlan_list' %}">VLANs</a></h4>
  191. {% else %}
  192. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  193. <h4 class="list-group-item-heading">VLANs</h4>
  194. {% endif %}
  195. <p class="list-group-item-text text-muted">Layer two domains, identified by VLAN ID</p>
  196. </div>
  197. </div>
  198. </div>
  199. <div class="panel panel-default">
  200. <div class="panel-heading">
  201. <strong>Circuits</strong>
  202. </div>
  203. <div class="list-group">
  204. <div class="list-group-item">
  205. {% if perms.circuits.view_provider %}
  206. <span class="badge pull-right">{{ stats.provider_count }}</span>
  207. <h4 class="list-group-item-heading"><a href="{% url 'circuits:provider_list' %}">Providers</a></h4>
  208. {% else %}
  209. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  210. <h4 class="list-group-item-heading">Providers</h4>
  211. {% endif %}
  212. <p class="list-group-item-text text-muted">Organizations which provide circuit connectivity</p>
  213. </div>
  214. <div class="list-group-item">
  215. {% if perms.circuits.view_circuit %}
  216. <span class="badge pull-right">{{ stats.circuit_count }}</span>
  217. <h4 class="list-group-item-heading"><a href="{% url 'circuits:circuit_list' %}">Circuits</a></h4>
  218. {% else %}
  219. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  220. <h4 class="list-group-item-heading">Circuits</h4>
  221. {% endif %}
  222. <p class="list-group-item-text text-muted">Communication links for Internet transit, peering, and other services</p>
  223. </div>
  224. </div>
  225. </div>
  226. <div class="panel panel-default">
  227. <div class="panel-heading">
  228. <strong>Virtualization</strong>
  229. </div>
  230. <div class="list-group">
  231. <div class="list-group-item">
  232. {% if perms.virtualization.view_cluster %}
  233. <span class="badge pull-right">{{ stats.cluster_count }}</span>
  234. <h4 class="list-group-item-heading"><a href="{% url 'virtualization:cluster_list' %}">Clusters</a></h4>
  235. {% else %}
  236. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  237. <h4 class="list-group-item-heading">Clusters</h4>
  238. {% endif %}
  239. <p class="list-group-item-text text-muted">Clusters of physical hosts in which VMs reside</p>
  240. </div>
  241. <div class="list-group-item">
  242. {% if perms.virtualization.view_virtualmachine %}
  243. <span class="badge pull-right">{{ stats.virtualmachine_count }}</span>
  244. <h4 class="list-group-item-heading"><a href="{% url 'virtualization:virtualmachine_list' %}">Virtual Machines</a></h4>
  245. {% else %}
  246. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  247. <h4 class="list-group-item-heading">Virtual Machines</h4>
  248. {% endif %}
  249. <p class="list-group-item-text text-muted">Virtual compute instances running inside clusters</p>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. <div class="col-sm-6 col-md-4">
  255. <div class="panel panel-default">
  256. <div class="panel-heading">
  257. <strong>Secrets</strong>
  258. </div>
  259. <div class="list-group">
  260. <div class="list-group-item">
  261. {% if perms.secrets.view_secret %}
  262. <span class="badge pull-right">{{ stats.secret_count }}</span>
  263. <h4 class="list-group-item-heading"><a href="{% url 'secrets:secret_list' %}">Secrets</a></h4>
  264. {% else %}
  265. <span class="badge pull-right"><i class="fa fa-lock"></i></span>
  266. <h4 class="list-group-item-heading">Secrets</h4>
  267. {% endif %}
  268. <p class="list-group-item-text text-muted">Cryptographically secured secret data</p>
  269. </div>
  270. </div>
  271. </div>
  272. <div class="panel panel-default">
  273. <div class="panel-heading">
  274. <strong>Reports</strong>
  275. </div>
  276. {% if report_results and perms.extras.view_reportresult %}
  277. <table class="table table-hover panel-body">
  278. {% for result in report_results %}
  279. <tr>
  280. <td><a href="{% url 'extras:report' name=result.report %}">{{ result.report }}</a></td>
  281. <td class="text-right"><span title="{{ result.created }}">{% include 'extras/inc/report_label.html' %}</span></td>
  282. </tr>
  283. {% endfor %}
  284. </table>
  285. {% elif perms.extras.view_reportresult %}
  286. <div class="panel-body text-muted">
  287. None found
  288. </div>
  289. {% else %}
  290. <div class="panel-body text-muted">
  291. <i class="fa fa-lock"></i> No permission
  292. </div>
  293. {% endif %}
  294. </div>
  295. <div class="panel panel-default">
  296. <div class="panel-heading">
  297. <strong>Change Log</strong>
  298. </div>
  299. {% if changelog and perms.extras.view_objectchange %}
  300. <div class="list-group">
  301. {% for change in changelog %}
  302. {% with action=change.get_action_display|lower %}
  303. <div class="list-group-item">
  304. {% if action == 'created' %}
  305. <span class="label label-success"><i class="fa fa-plus"></i></span>
  306. {% elif action == 'updated' %}
  307. <span class="label label-warning"><i class="fa fa-pencil"></i></span>
  308. {% elif action == 'deleted' %}
  309. <span class="label label-danger"><i class="fa fa-trash"></i></span>
  310. {% endif %}
  311. {{ change.changed_object_type.name|bettertitle }}
  312. {% if change.changed_object.get_absolute_url %}
  313. <a href="{{ change.changed_object.get_absolute_url }}">{{ change.changed_object }}</a>
  314. {% else %}
  315. {{ change.changed_object|default:change.object_repr }}
  316. {% endif %}
  317. <br />
  318. <small>
  319. <span class="text-muted">{{ change.user|default:change.user_name }} -</span>
  320. <a href="{{ change.get_absolute_url }}" class="text-muted">{{ change.time|date:'SHORT_DATETIME_FORMAT' }}</a>
  321. </small>
  322. </div>
  323. {% endwith %}
  324. {% if forloop.last %}
  325. <div class="list-group-item text-right">
  326. <a href="{% url 'extras:objectchange_list' %}">View All Changes</a>
  327. </div>
  328. {% endif %}
  329. {% endfor %}
  330. </div>
  331. {% elif perms.extras.view_objectchange %}
  332. <div class="panel-body text-muted">
  333. No change history found
  334. </div>
  335. {% else %}
  336. <div class="panel-body text-muted">
  337. <i class="fa fa-lock"></i> No permission
  338. </div>
  339. {% endif %}
  340. </div>
  341. </div>
  342. </div>
  343. {% endblock %}