home.html 19 KB

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