interface.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  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:interface_connect' termination_a_id=object.pk termination_b_type='interface' %}?return_url={{ object.get_absolute_url }}">
  260. Interface
  261. </a>
  262. </li>
  263. <li>
  264. <a class="dropdown-item" href="{% url 'dcim:interface_connect' termination_a_id=object.pk termination_b_type='front-port' %}?return_url={{ object.get_absolute_url }}">
  265. Front Port
  266. </a>
  267. </li>
  268. <li>
  269. <a class="dropdown-item" href="{% url 'dcim:interface_connect' termination_a_id=object.pk termination_b_type='rear-port' %}?return_url={{ object.get_absolute_url }}">
  270. Rear Port
  271. </a>
  272. </li>
  273. <li>
  274. <a class="dropdown-item" href="{% url 'dcim:interface_connect' termination_a_id=object.pk termination_b_type='circuit-termination' %}?return_url={{ object.get_absolute_url }}">
  275. Circuit Termination
  276. </a>
  277. </li>
  278. </ul>
  279. </div>
  280. {% elif object.is_wireless and perms.wireless.add_wirelesslink %}
  281. <div class="dropdown float-end">
  282. <a href="{% url 'wireless:wirelesslink_add' %}?interface_a={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
  283. <span class="mdi mdi-wifi-plus" aria-hidden="true"></span> Connect
  284. </a>
  285. </div>
  286. {% endif %}
  287. </div>
  288. {% endif %}
  289. </div>
  290. </div>
  291. {% endif %}
  292. {% if object.is_wireless %}
  293. <div class="card">
  294. <h5 class="card-header">Wireless</h5>
  295. <div class="card-body">
  296. {% with peer=object.connected_endpoint %}
  297. <table class="table table-hover">
  298. <thead>
  299. <tr>
  300. <th></th>
  301. <th>Local</th>
  302. {% if peer %}
  303. <th>Peer</th>
  304. {% endif %}
  305. </tr>
  306. </thead>
  307. <tr>
  308. <th scope="row">Role</th>
  309. <td>{{ object.get_rf_role_display|placeholder }}</td>
  310. {% if peer %}
  311. <td>{{ peer.get_rf_role_display|placeholder }}</td>
  312. {% endif %}
  313. </tr>
  314. <tr>
  315. <th scope="row">Channel</th>
  316. <td>{{ object.get_rf_channel_display|placeholder }}</td>
  317. {% if peer %}
  318. <td{% if peer.rf_channel != object.rf_channel %} class="text-danger"{% endif %}>
  319. {{ peer.get_rf_channel_display|placeholder }}
  320. </td>
  321. {% endif %}
  322. </tr>
  323. <tr>
  324. <th scope="row">Channel Frequency</th>
  325. <td>
  326. {% if object.rf_channel_frequency %}
  327. {{ object.rf_channel_frequency|simplify_decimal }} MHz
  328. {% else %}
  329. {{ ''|placeholder }}
  330. {% endif %}
  331. </td>
  332. {% if peer %}
  333. <td{% if peer.rf_channel_frequency != object.rf_channel_frequency %} class="text-danger"{% endif %}>
  334. {% if peer.rf_channel_frequency %}
  335. {{ peer.rf_channel_frequency|simplify_decimal }} MHz
  336. {% else %}
  337. {{ ''|placeholder }}
  338. {% endif %}
  339. </td>
  340. {% endif %}
  341. </tr>
  342. <tr>
  343. <th scope="row">Channel Width</th>
  344. <td>
  345. {% if object.rf_channel_width %}
  346. {{ object.rf_channel_width|simplify_decimal }} MHz
  347. {% else %}
  348. {{ ''|placeholder }}
  349. {% endif %}
  350. </td>
  351. {% if peer %}
  352. <td{% if peer.rf_channel_width != object.rf_channel_width %} class="text-danger"{% endif %}>
  353. {% if peer.rf_channel_width %}
  354. {{ peer.rf_channel_width|simplify_decimal }} MHz
  355. {% else %}
  356. {{ ''|placeholder }}
  357. {% endif %}
  358. </td>
  359. {% endif %}
  360. </tr>
  361. </table>
  362. {% endwith %}
  363. </div>
  364. </div>
  365. <div class="card">
  366. <h5 class="card-header">Wireless LANs</h5>
  367. <div class="card-body">
  368. <table class="table table-hover table-headings">
  369. <thead>
  370. <tr>
  371. <th>Group</th>
  372. <th>SSID</th>
  373. </tr>
  374. </thead>
  375. <tbody>
  376. {% for wlan in object.wireless_lans.all %}
  377. <tr>
  378. <td>{{ wlan.group|linkify|placeholder }}</td>
  379. <td>{{ wlan|linkify:"ssid" }}</td>
  380. </tr>
  381. {% empty %}
  382. <tr>
  383. <td colspan="3" class="text-muted">None</td>
  384. </tr>
  385. {% endfor %}
  386. </tbody>
  387. </table>
  388. </div>
  389. </div>
  390. {% endif %}
  391. {% if object.is_lag %}
  392. <div class="card">
  393. <h5 class="card-header">LAG Members</h5>
  394. <div class="card-body">
  395. <table class="table table-hover table-headings">
  396. <thead>
  397. <tr>
  398. <th>Parent</th>
  399. <th>Interface</th>
  400. <th>Type</th>
  401. </tr>
  402. </thead>
  403. <tbody>
  404. {% for member in object.member_interfaces.all %}
  405. <tr>
  406. <td>{{ member.device|linkify }}</td>
  407. <td>{{ member|linkify }}</td>
  408. <td>{{ member.get_type_display }}</td>
  409. </tr>
  410. {% empty %}
  411. <tr>
  412. <td colspan="3" class="text-muted">No member interfaces</td>
  413. </tr>
  414. {% endfor %}
  415. </tbody>
  416. </table>
  417. </div>
  418. </div>
  419. {% endif %}
  420. {% include 'ipam/inc/panels/fhrp_groups.html' %}
  421. {% include 'dcim/inc/panels/inventory_items.html' %}
  422. {% plugin_right_page object %}
  423. </div>
  424. </div>
  425. <div class="row mb-3">
  426. <div class="col col-md-12">
  427. <div class="card">
  428. <h5 class="card-header">IP Addresses</h5>
  429. <div class="card-body table-responsive">
  430. {% if ipaddress_table.rows %}
  431. {% render_table ipaddress_table 'inc/table.html' %}
  432. {% else %}
  433. <div class="text-muted">None</div>
  434. {% endif %}
  435. </div>
  436. {% if perms.ipam.add_ipaddress %}
  437. <div class="card-footer text-end noprint">
  438. <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">
  439. <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add IP Address
  440. </a>
  441. </div>
  442. {% endif %}
  443. </div>
  444. </div>
  445. </div>
  446. <div class="row mb-3">
  447. <div class="col col-md-12">
  448. {% include 'inc/panel_table.html' with table=vlan_table heading="VLANs" %}
  449. </div>
  450. </div>
  451. {% if object.is_bridge %}
  452. <div class="row mb-3">
  453. <div class="col col-md-12">
  454. {% include 'inc/panel_table.html' with table=bridge_interfaces_table heading="Bridge Interfaces" %}
  455. </div>
  456. </div>
  457. {% endif %}
  458. <div class="row mb-3">
  459. <div class="col col-md-12">
  460. {% include 'inc/panel_table.html' with table=child_interfaces_table heading="Child Interfaces" %}
  461. </div>
  462. </div>
  463. <div class="row mb-3">
  464. <div class="col col-md-12">
  465. {% plugin_full_width_page object %}
  466. </div>
  467. </div>
  468. {% endblock %}