interface.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. {% extends 'generic/object.html' %}
  2. {% load helpers %}
  3. {% load plugins %}
  4. {% load render_table from django_tables2 %}
  5. {% block breadcrumbs %}
  6. {{ block.super }}
  7. <li class="breadcrumb-item">
  8. <a href="{% url 'dcim:device_interfaces' pk=object.device.pk %}">{{ object.device }}</a>
  9. </li>
  10. {% endblock %}
  11. {% block extra_controls %}
  12. {% if perms.dcim.add_interface and not object.is_virtual %}
  13. <a href="{% url 'dcim:interface_add' %}?device={{ object.device.pk }}&parent={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-sm btn-success">
  14. <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Child Interface
  15. </a>
  16. {% endif %}
  17. {{ block.super }}
  18. {% endblock %}
  19. {% block content %}
  20. <div class="row mb-3">
  21. <div class="col col-md-6">
  22. <div class="card">
  23. <h5 class="card-header">Interface</h5>
  24. <div class="card-body">
  25. <table class="table table-hover">
  26. <tr>
  27. <th scope="row">Device</th>
  28. <td>{{ object.device|linkify }}</td>
  29. </tr>
  30. <tr>
  31. <th scope="row">Module</th>
  32. <td>{{ object.module|linkify|placeholder }}</td>
  33. </tr>
  34. <tr>
  35. <th scope="row">Name</th>
  36. <td>{{ object.name }}</td>
  37. </tr>
  38. <tr>
  39. <th scope="row">Label</th>
  40. <td>{{ object.label|placeholder }}</td>
  41. </tr>
  42. <tr>
  43. <th scope="row">Type</th>
  44. <td>{{ object.get_type_display }}</td>
  45. </tr>
  46. <tr>
  47. <th scope="row">Speed/Duplex</th>
  48. <td>
  49. {{ object.speed|humanize_speed|placeholder }} /
  50. {{ object.get_duplex_display|placeholder }}
  51. </td>
  52. </tr>
  53. <tr>
  54. <th scope="row">MTU</th>
  55. <td>{{ object.mtu|placeholder }}</td>
  56. </tr>
  57. <tr>
  58. <th scope="row">Enabled</th>
  59. <td>{% checkmark object.enabled %}</td>
  60. </tr>
  61. <tr>
  62. <th scope="row">Management Only</th>
  63. <td>{% checkmark object.mgmt_only %}</td>
  64. </tr>
  65. <tr>
  66. <th scope="row">Description</th>
  67. <td>{{ object.description|placeholder }} </td>
  68. </tr>
  69. <tr>
  70. <th scope="row">PoE Mode</th>
  71. <td>{{ object.get_poe_mode_display|placeholder }}</td>
  72. </tr>
  73. <tr>
  74. <th scope="row">PoE Type</th>
  75. <td>{{ object.get_poe_type_display|placeholder }}</td>
  76. </tr>
  77. <tr>
  78. <th scope="row">802.1Q Mode</th>
  79. <td>{{ object.get_mode_display|placeholder }}</td>
  80. </tr>
  81. <tr>
  82. <th scope="row">Transmit power (dBm)</th>
  83. <td>{{ object.tx_power|placeholder }}</td>
  84. </tr>
  85. </table>
  86. </div>
  87. </div>
  88. <div class="card">
  89. <h5 class="card-header">Related Interfaces</h5>
  90. <div class="card-body">
  91. <table class="table table-hover">
  92. <tr>
  93. <th scope="row">Parent</th>
  94. <td>{{ object.parent|linkify|placeholder }}</td>
  95. </tr>
  96. <tr>
  97. <th scope="row">Bridge</th>
  98. <td>{{ object.bridge|linkify|placeholder }}</td>
  99. </tr>
  100. <tr>
  101. <th scope="row">LAG</th>
  102. <td>{{ object.lag|linkify|placeholder }}</td>
  103. </tr>
  104. <tr>
  105. <th scope="row">L2VPN</th>
  106. <td>{{ object.l2vpn_termination.l2vpn|linkify|placeholder }}</td>
  107. </tr>
  108. </table>
  109. </div>
  110. </div>
  111. {% include 'inc/panels/custom_fields.html' %}
  112. {% include 'inc/panels/tags.html' %}
  113. {% plugin_left_page object %}
  114. </div>
  115. <div class="col col-md-6">
  116. <div class="card">
  117. <h5 class="card-header">Addressing</h5>
  118. <div class="card-body">
  119. <table class="table table-hover">
  120. <tr>
  121. <th scope="row">MAC Address</th>
  122. <td><span class="text-monospace">{{ object.mac_address|placeholder }}</span></td>
  123. </tr>
  124. <tr>
  125. <th scope="row">WWN</th>
  126. <td><span class="text-monospace">{{ object.wwn|placeholder }}</span></td>
  127. </tr>
  128. <tr>
  129. <th scope="row">VRF</th>
  130. <td>{{ object.vrf|linkify|placeholder }}</td>
  131. </tr>
  132. </table>
  133. </div>
  134. </div>
  135. {% if not object.is_virtual %}
  136. <div class="card">
  137. <h5 class="card-header">Connection</h5>
  138. <div class="card-body">
  139. {% if object.mark_connected %}
  140. <div class="text-muted">
  141. <span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
  142. </div>
  143. {% elif object.cable %}
  144. <table class="table table-hover">
  145. {% if object.connected_endpoint.device %}
  146. <tr>
  147. <td colspan="2">
  148. {% if object.connected_endpoint.enabled %}
  149. <span class="badge bg-success">Enabled</span>
  150. {% else %}
  151. <span class="badge bg-danger">Disabled</span>
  152. {% endif %}
  153. </td>
  154. </tr>
  155. {% endif %}
  156. <tr>
  157. <th scope="row">Cable</th>
  158. <td>
  159. {{ object.cable|linkify }}
  160. <a href="{% url 'dcim:interface_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
  161. <i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
  162. </a>
  163. </td>
  164. </tr>
  165. {% if object.connected_endpoint.device %}
  166. {% with iface=object.connected_endpoint %}
  167. <tr>
  168. <th scope="row">Device</th>
  169. <td>{{ iface.device|linkify }}</td>
  170. </tr>
  171. <tr>
  172. <th scope="row">Name</th>
  173. <td>{{ iface|linkify:"name" }}</td>
  174. </tr>
  175. <tr>
  176. <th scope="row">Type</th>
  177. <td>{{ iface.get_type_display }}</td>
  178. </tr>
  179. <tr>
  180. <th scope="row">LAG</th>
  181. <td>{{ iface.lag|linkify|placeholder }}</td>
  182. </tr>
  183. <tr>
  184. <th scope="row">Description</th>
  185. <td>{{ iface.description|placeholder }}</td>
  186. </tr>
  187. <tr>
  188. <th scope="row">MTU</th>
  189. <td>{{ iface.mtu|placeholder }}</td>
  190. </tr>
  191. <tr>
  192. <th scope="row">MAC Address</th>
  193. <td>{{ iface.mac_address|placeholder }}</td>
  194. </tr>
  195. <tr>
  196. <th scope="row">802.1Q Mode</th>
  197. <td>{{ iface.get_mode_display }}</td>
  198. </tr>
  199. {% endwith %}
  200. {% elif object.connected_endpoint.circuit %}
  201. {% with ct=object.connected_endpoint %}
  202. <tr>
  203. <th scope="row">Provider</th>
  204. <td>{{ ct.circuit.provider|linkify }}</td>
  205. </tr>
  206. <tr>
  207. <th scope="row">Circuit</th>
  208. <td>{{ ct.circuit|linkify }}</td>
  209. </tr>
  210. <tr>
  211. <th scope="row">Side</th>
  212. <td>{{ ct.term_side }}</td>
  213. </tr>
  214. {% endwith %}
  215. {% endif %}
  216. <tr>
  217. <th scope="row">Path Status</th>
  218. <td>
  219. {% if object.path.is_complete and object.path.is_active %}
  220. <span class="badge bg-success">Reachable</span>
  221. {% else %}
  222. <span class="badge bg-danger">Not Reachable</span>
  223. {% endif %}
  224. </td>
  225. </tr>
  226. </table>
  227. {% elif object.wireless_link %}
  228. <table class="table table-hover">
  229. <tr>
  230. <th scope="row">Wireless Link</th>
  231. <td>
  232. {{ object.wireless_link|linkify }}
  233. <a href="{% url 'dcim:interface_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
  234. <i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
  235. </a>
  236. </td>
  237. </tr>
  238. {% with peer_interface=object.connected_endpoint %}
  239. <tr>
  240. <th scope="row">Device</th>
  241. <td>{{ peer_interface.device|linkify }}</td>
  242. </tr>
  243. <tr>
  244. <th scope="row">Name</th>
  245. <td>{{ peer_interface|linkify }}</td>
  246. </tr>
  247. <tr>
  248. <th scope="row">Type</th>
  249. <td>{{ peer_interface.get_type_display }}</td>
  250. </tr>
  251. {% endwith %}
  252. </table>
  253. {% else %}
  254. <div class="text-muted">
  255. Not Connected
  256. {% if object.is_wired and perms.dcim.add_cable %}
  257. <div class="dropdown float-end">
  258. <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  259. <span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
  260. </button>
  261. <ul class="dropdown-menu dropdown-menu-end">
  262. <li>
  263. <a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.interface&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}">Interface</a>
  264. </li>
  265. <li>
  266. <a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}">Front Port</a>
  267. </li>
  268. <li>
  269. <a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}">Rear Port</a>
  270. </li>
  271. <li>
  272. <a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=circuits.circuittermination&termination_b_site={{ object.device.site.pk }}&return_url={{ object.get_absolute_url }}">Circuit Termination</a>
  273. </li>
  274. </ul>
  275. </div>
  276. {% elif object.is_wireless and perms.wireless.add_wirelesslink %}
  277. <div class="dropdown float-end">
  278. <a href="{% url 'wireless:wirelesslink_add' %}?interface_a={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
  279. <span class="mdi mdi-wifi-plus" aria-hidden="true"></span> Connect
  280. </a>
  281. </div>
  282. {% endif %}
  283. </div>
  284. {% endif %}
  285. </div>
  286. </div>
  287. {% endif %}
  288. {% if object.is_wireless %}
  289. <div class="card">
  290. <h5 class="card-header">Wireless</h5>
  291. <div class="card-body">
  292. {% with peer=object.connected_endpoint %}
  293. <table class="table table-hover">
  294. <thead>
  295. <tr>
  296. <th></th>
  297. <th>Local</th>
  298. {% if peer %}
  299. <th>Peer</th>
  300. {% endif %}
  301. </tr>
  302. </thead>
  303. <tr>
  304. <th scope="row">Role</th>
  305. <td>{{ object.get_rf_role_display|placeholder }}</td>
  306. {% if peer %}
  307. <td>{{ peer.get_rf_role_display|placeholder }}</td>
  308. {% endif %}
  309. </tr>
  310. <tr>
  311. <th scope="row">Channel</th>
  312. <td>{{ object.get_rf_channel_display|placeholder }}</td>
  313. {% if peer %}
  314. <td{% if peer.rf_channel != object.rf_channel %} class="text-danger"{% endif %}>
  315. {{ peer.get_rf_channel_display|placeholder }}
  316. </td>
  317. {% endif %}
  318. </tr>
  319. <tr>
  320. <th scope="row">Channel Frequency</th>
  321. <td>
  322. {% if object.rf_channel_frequency %}
  323. {{ object.rf_channel_frequency|simplify_decimal }} MHz
  324. {% else %}
  325. {{ ''|placeholder }}
  326. {% endif %}
  327. </td>
  328. {% if peer %}
  329. <td{% if peer.rf_channel_frequency != object.rf_channel_frequency %} class="text-danger"{% endif %}>
  330. {% if peer.rf_channel_frequency %}
  331. {{ peer.rf_channel_frequency|simplify_decimal }} MHz
  332. {% else %}
  333. {{ ''|placeholder }}
  334. {% endif %}
  335. </td>
  336. {% endif %}
  337. </tr>
  338. <tr>
  339. <th scope="row">Channel Width</th>
  340. <td>
  341. {% if object.rf_channel_width %}
  342. {{ object.rf_channel_width|simplify_decimal }} MHz
  343. {% else %}
  344. {{ ''|placeholder }}
  345. {% endif %}
  346. </td>
  347. {% if peer %}
  348. <td{% if peer.rf_channel_width != object.rf_channel_width %} class="text-danger"{% endif %}>
  349. {% if peer.rf_channel_width %}
  350. {{ peer.rf_channel_width|simplify_decimal }} MHz
  351. {% else %}
  352. {{ ''|placeholder }}
  353. {% endif %}
  354. </td>
  355. {% endif %}
  356. </tr>
  357. </table>
  358. {% endwith %}
  359. </div>
  360. </div>
  361. <div class="card">
  362. <h5 class="card-header">Wireless LANs</h5>
  363. <div class="card-body">
  364. <table class="table table-hover table-headings">
  365. <thead>
  366. <tr>
  367. <th>Group</th>
  368. <th>SSID</th>
  369. </tr>
  370. </thead>
  371. <tbody>
  372. {% for wlan in object.wireless_lans.all %}
  373. <tr>
  374. <td>{{ wlan.group|linkify|placeholder }}</td>
  375. <td>{{ wlan|linkify:"ssid" }}</td>
  376. </tr>
  377. {% empty %}
  378. <tr>
  379. <td colspan="3" class="text-muted">None</td>
  380. </tr>
  381. {% endfor %}
  382. </tbody>
  383. </table>
  384. </div>
  385. </div>
  386. {% endif %}
  387. {% if object.is_lag %}
  388. <div class="card">
  389. <h5 class="card-header">LAG Members</h5>
  390. <div class="card-body">
  391. <table class="table table-hover table-headings">
  392. <thead>
  393. <tr>
  394. <th>Parent</th>
  395. <th>Interface</th>
  396. <th>Type</th>
  397. </tr>
  398. </thead>
  399. <tbody>
  400. {% for member in object.member_interfaces.all %}
  401. <tr>
  402. <td>{{ member.device|linkify }}</td>
  403. <td>{{ member|linkify }}</td>
  404. <td>{{ member.get_type_display }}</td>
  405. </tr>
  406. {% empty %}
  407. <tr>
  408. <td colspan="3" class="text-muted">No member interfaces</td>
  409. </tr>
  410. {% endfor %}
  411. </tbody>
  412. </table>
  413. </div>
  414. </div>
  415. {% endif %}
  416. {% include 'ipam/inc/panels/fhrp_groups.html' %}
  417. {% include 'dcim/inc/panels/inventory_items.html' %}
  418. {% plugin_right_page object %}
  419. </div>
  420. </div>
  421. <div class="row mb-3">
  422. <div class="col col-md-12">
  423. <div class="card">
  424. <h5 class="card-header">IP Addresses</h5>
  425. <div class="card-body table-responsive">
  426. {% if ipaddress_table.rows %}
  427. {% render_table ipaddress_table 'inc/table.html' %}
  428. {% else %}
  429. <div class="text-muted">None</div>
  430. {% endif %}
  431. </div>
  432. {% if perms.ipam.add_ipaddress %}
  433. <div class="card-footer text-end noprint">
  434. <a href="{% url 'ipam:ipaddress_add' %}?device={{ object.device.pk }}&interface={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-sm btn-primary">
  435. <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add IP Address
  436. </a>
  437. </div>
  438. {% endif %}
  439. </div>
  440. </div>
  441. </div>
  442. <div class="row mb-3">
  443. <div class="col col-md-12">
  444. {% include 'inc/panel_table.html' with table=vlan_table heading="VLANs" %}
  445. </div>
  446. </div>
  447. {% if object.is_bridge %}
  448. <div class="row mb-3">
  449. <div class="col col-md-12">
  450. {% include 'inc/panel_table.html' with table=bridge_interfaces_table heading="Bridge Interfaces" %}
  451. </div>
  452. </div>
  453. {% endif %}
  454. <div class="row mb-3">
  455. <div class="col col-md-12">
  456. {% include 'inc/panel_table.html' with table=child_interfaces_table heading="Child Interfaces" %}
  457. </div>
  458. </div>
  459. <div class="row mb-3">
  460. <div class="col col-md-12">
  461. {% plugin_full_width_page object %}
  462. </div>
  463. </div>
  464. {% endblock %}