interface.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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 Mode</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. </table>
  105. </div>
  106. </div>
  107. {% include 'inc/panels/custom_fields.html' %}
  108. {% include 'inc/panels/tags.html' %}
  109. {% plugin_left_page object %}
  110. </div>
  111. <div class="col col-md-6">
  112. <div class="card">
  113. <h5 class="card-header">Addressing</h5>
  114. <div class="card-body">
  115. <table class="table table-hover">
  116. <tr>
  117. <th scope="row">MAC Address</th>
  118. <td><span class="text-monospace">{{ object.mac_address|placeholder }}</span></td>
  119. </tr>
  120. <tr>
  121. <th scope="row">WWN</th>
  122. <td><span class="text-monospace">{{ object.wwn|placeholder }}</span></td>
  123. </tr>
  124. <tr>
  125. <th scope="row">VRF</th>
  126. <td>{{ object.vrf|linkify|placeholder }}</td>
  127. </tr>
  128. </table>
  129. </div>
  130. </div>
  131. {% if not object.is_virtual %}
  132. <div class="card">
  133. <h5 class="card-header">Connection</h5>
  134. <div class="card-body">
  135. {% if object.mark_connected %}
  136. <div class="text-muted">
  137. <span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
  138. </div>
  139. {% elif object.cable %}
  140. <table class="table table-hover">
  141. {% if object.connected_endpoint.device %}
  142. <tr>
  143. <td colspan="2">
  144. {% if object.connected_endpoint.enabled %}
  145. <span class="badge bg-success">Enabled</span>
  146. {% else %}
  147. <span class="badge bg-danger">Disabled</span>
  148. {% endif %}
  149. </td>
  150. </tr>
  151. {% endif %}
  152. <tr>
  153. <th scope="row">Cable</th>
  154. <td>
  155. {{ object.cable|linkify }}
  156. <a href="{% url 'dcim:interface_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
  157. <i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
  158. </a>
  159. </td>
  160. </tr>
  161. {% if object.connected_endpoint.device %}
  162. {% with iface=object.connected_endpoint %}
  163. <tr>
  164. <th scope="row">Device</th>
  165. <td>{{ iface.device|linkify }}</td>
  166. </tr>
  167. <tr>
  168. <th scope="row">Name</th>
  169. <td>{{ iface|linkify:"name" }}</td>
  170. </tr>
  171. <tr>
  172. <th scope="row">Type</th>
  173. <td>{{ iface.get_type_display }}</td>
  174. </tr>
  175. <tr>
  176. <th scope="row">LAG</th>
  177. <td>{{ iface.lag|linkify|placeholder }}</td>
  178. </tr>
  179. <tr>
  180. <th scope="row">Description</th>
  181. <td>{{ iface.description|placeholder }}</td>
  182. </tr>
  183. <tr>
  184. <th scope="row">MTU</th>
  185. <td>{{ iface.mtu|placeholder }}</td>
  186. </tr>
  187. <tr>
  188. <th scope="row">MAC Address</th>
  189. <td>{{ iface.mac_address|placeholder }}</td>
  190. </tr>
  191. <tr>
  192. <th scope="row">802.1Q Mode</th>
  193. <td>{{ iface.get_mode_display }}</td>
  194. </tr>
  195. {% endwith %}
  196. {% elif object.connected_endpoint.circuit %}
  197. {% with ct=object.connected_endpoint %}
  198. <tr>
  199. <th scope="row">Provider</th>
  200. <td>{{ ct.circuit.provider|linkify }}</td>
  201. </tr>
  202. <tr>
  203. <th scope="row">Circuit</th>
  204. <td>{{ ct.circuit|linkify }}</td>
  205. </tr>
  206. <tr>
  207. <th scope="row">Side</th>
  208. <td>{{ ct.term_side }}</td>
  209. </tr>
  210. {% endwith %}
  211. {% endif %}
  212. <tr>
  213. <th scope="row">Path Status</th>
  214. <td>
  215. {% if object.path.is_active %}
  216. <span class="badge bg-success">Reachable</span>
  217. {% else %}
  218. <span class="badge bg-danger">Not Reachable</span>
  219. {% endif %}
  220. </td>
  221. </tr>
  222. </table>
  223. {% elif object.wireless_link %}
  224. <table class="table table-hover">
  225. <tr>
  226. <th scope="row">Wireless Link</th>
  227. <td>
  228. {{ object.wireless_link|linkify }}
  229. <a href="{% url 'dcim:interface_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
  230. <i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
  231. </a>
  232. </td>
  233. </tr>
  234. {% with peer_interface=object.connected_endpoint %}
  235. <tr>
  236. <th scope="row">Device</th>
  237. <td>{{ peer_interface.device|linkify }}</td>
  238. </tr>
  239. <tr>
  240. <th scope="row">Name</th>
  241. <td>{{ peer_interface|linkify }}</td>
  242. </tr>
  243. <tr>
  244. <th scope="row">Type</th>
  245. <td>{{ peer_interface.get_type_display }}</td>
  246. </tr>
  247. {% endwith %}
  248. </table>
  249. {% else %}
  250. <div class="text-muted">
  251. Not Connected
  252. {% if object.is_wired and perms.dcim.add_cable %}
  253. <div class="dropdown float-end">
  254. <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  255. <span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
  256. </button>
  257. <ul class="dropdown-menu dropdown-menu-end">
  258. <li>
  259. <a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.interface&return_url={{ object.get_absolute_url }}">Interface</a>
  260. </li>
  261. <li>
  262. <a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}">Front Port</a>
  263. </li>
  264. <li>
  265. <a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}">Rear Port</a>
  266. </li>
  267. <li>
  268. <a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=circuits.circuittermination&return_url={{ object.get_absolute_url }}">Circuit Termination</a>
  269. </li>
  270. </ul>
  271. </div>
  272. {% elif object.is_wireless and perms.wireless.add_wirelesslink %}
  273. <div class="dropdown float-end">
  274. <a href="{% url 'wireless:wirelesslink_add' %}?interface_a={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
  275. <span class="mdi mdi-wifi-plus" aria-hidden="true"></span> Connect
  276. </a>
  277. </div>
  278. {% endif %}
  279. </div>
  280. {% endif %}
  281. </div>
  282. </div>
  283. {% endif %}
  284. {% if object.is_wireless %}
  285. <div class="card">
  286. <h5 class="card-header">Wireless</h5>
  287. <div class="card-body">
  288. {% with peer=object.connected_endpoint %}
  289. <table class="table table-hover">
  290. <thead>
  291. <tr>
  292. <th></th>
  293. <th>Local</th>
  294. {% if peer %}
  295. <th>Peer</th>
  296. {% endif %}
  297. </tr>
  298. </thead>
  299. <tr>
  300. <th scope="row">Role</th>
  301. <td>{{ object.get_rf_role_display|placeholder }}</td>
  302. {% if peer %}
  303. <td>{{ peer.get_rf_role_display|placeholder }}</td>
  304. {% endif %}
  305. </tr>
  306. <tr>
  307. <th scope="row">Channel</th>
  308. <td>{{ object.get_rf_channel_display|placeholder }}</td>
  309. {% if peer %}
  310. <td{% if peer.rf_channel != object.rf_channel %} class="text-danger"{% endif %}>
  311. {{ peer.get_rf_channel_display|placeholder }}
  312. </td>
  313. {% endif %}
  314. </tr>
  315. <tr>
  316. <th scope="row">Channel Frequency</th>
  317. <td>
  318. {% if object.rf_channel_frequency %}
  319. {{ object.rf_channel_frequency|simplify_decimal }} MHz
  320. {% else %}
  321. {{ ''|placeholder }}
  322. {% endif %}
  323. </td>
  324. {% if peer %}
  325. <td{% if peer.rf_channel_frequency != object.rf_channel_frequency %} class="text-danger"{% endif %}>
  326. {% if peer.rf_channel_frequency %}
  327. {{ peer.rf_channel_frequency|simplify_decimal }} MHz
  328. {% else %}
  329. {{ ''|placeholder }}
  330. {% endif %}
  331. </td>
  332. {% endif %}
  333. </tr>
  334. <tr>
  335. <th scope="row">Channel Width</th>
  336. <td>
  337. {% if object.rf_channel_width %}
  338. {{ object.rf_channel_width|simplify_decimal }} MHz
  339. {% else %}
  340. {{ ''|placeholder }}
  341. {% endif %}
  342. </td>
  343. {% if peer %}
  344. <td{% if peer.rf_channel_width != object.rf_channel_width %} class="text-danger"{% endif %}>
  345. {% if peer.rf_channel_width %}
  346. {{ peer.rf_channel_width|simplify_decimal }} MHz
  347. {% else %}
  348. {{ ''|placeholder }}
  349. {% endif %}
  350. </td>
  351. {% endif %}
  352. </tr>
  353. </table>
  354. {% endwith %}
  355. </div>
  356. </div>
  357. <div class="card">
  358. <h5 class="card-header">Wireless LANs</h5>
  359. <div class="card-body">
  360. <table class="table table-hover table-headings">
  361. <thead>
  362. <tr>
  363. <th>Group</th>
  364. <th>SSID</th>
  365. </tr>
  366. </thead>
  367. <tbody>
  368. {% for wlan in object.wireless_lans.all %}
  369. <tr>
  370. <td>{{ wlan.group|linkify|placeholder }}</td>
  371. <td>{{ wlan|linkify:"ssid" }}</td>
  372. </tr>
  373. {% empty %}
  374. <tr>
  375. <td colspan="3" class="text-muted">None</td>
  376. </tr>
  377. {% endfor %}
  378. </tbody>
  379. </table>
  380. </div>
  381. </div>
  382. {% endif %}
  383. {% if object.is_lag %}
  384. <div class="card">
  385. <h5 class="card-header">LAG Members</h5>
  386. <div class="card-body">
  387. <table class="table table-hover table-headings">
  388. <thead>
  389. <tr>
  390. <th>Parent</th>
  391. <th>Interface</th>
  392. <th>Type</th>
  393. </tr>
  394. </thead>
  395. <tbody>
  396. {% for member in object.member_interfaces.all %}
  397. <tr>
  398. <td>{{ member.device|linkify }}</td>
  399. <td>{{ member|linkify }}</td>
  400. <td>{{ member.get_type_display }}</td>
  401. </tr>
  402. {% empty %}
  403. <tr>
  404. <td colspan="3" class="text-muted">No member interfaces</td>
  405. </tr>
  406. {% endfor %}
  407. </tbody>
  408. </table>
  409. </div>
  410. </div>
  411. {% endif %}
  412. {% include 'ipam/inc/panels/fhrp_groups.html' %}
  413. {% include 'dcim/inc/panels/inventory_items.html' %}
  414. {% plugin_right_page object %}
  415. </div>
  416. </div>
  417. <div class="row mb-3">
  418. <div class="col col-md-12">
  419. <div class="card">
  420. <h5 class="card-header">IP Addresses</h5>
  421. <div class="card-body table-responsive">
  422. {% if ipaddress_table.rows %}
  423. {% render_table ipaddress_table 'inc/table.html' %}
  424. {% else %}
  425. <div class="text-muted">None</div>
  426. {% endif %}
  427. </div>
  428. {% if perms.ipam.add_ipaddress %}
  429. <div class="card-footer text-end noprint">
  430. <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">
  431. <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add IP Address
  432. </a>
  433. </div>
  434. {% endif %}
  435. </div>
  436. </div>
  437. </div>
  438. <div class="row mb-3">
  439. <div class="col col-md-12">
  440. {% include 'inc/panel_table.html' with table=vlan_table heading="VLANs" %}
  441. </div>
  442. </div>
  443. {% if object.is_bridge %}
  444. <div class="row mb-3">
  445. <div class="col col-md-12">
  446. {% include 'inc/panel_table.html' with table=bridge_interfaces_table heading="Bridge Interfaces" %}
  447. </div>
  448. </div>
  449. {% endif %}
  450. <div class="row mb-3">
  451. <div class="col col-md-12">
  452. {% include 'inc/panel_table.html' with table=child_interfaces_table heading="Child Interfaces" %}
  453. </div>
  454. </div>
  455. <div class="row mb-3">
  456. <div class="col col-md-12">
  457. {% plugin_full_width_page object %}
  458. </div>
  459. </div>
  460. {% endblock %}