From 27584dbea4a4ba2dc8c6d12ce00a6f8762a9e92d Mon Sep 17 00:00:00 2001 From: Abhimanyu Saharan Date: Wed, 8 Nov 2023 21:01:52 +0530 Subject: [PATCH] adds copy button to ip addresses in interface list #13697 --- netbox/dcim/tables/template_code.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/netbox/dcim/tables/template_code.py b/netbox/dcim/tables/template_code.py index e0f38afef..3f0235a37 100644 --- a/netbox/dcim/tables/template_code.py +++ b/netbox/dcim/tables/template_code.py @@ -35,14 +35,26 @@ DEVICEBAY_STATUS = """ """ INTERFACE_IPADDRESSES = """ -
- {% for ip in value.all %} - {% if ip.status != 'active' %} - {{ ip }} - {% else %} - {{ ip }} - {% endif %} - {% endfor %} +
+
+ {% for ip in value.all %} + {% if ip.status != 'active' %} +
+ {{ ip }} +
+
+ {% copy_content record.pk prefix="ipaddress_" %} +
+ {% else %} +
+ {{ ip }} +
+
+ {% copy_content record.pk prefix="ipaddress_" %} +
+ {% endif %} + {% endfor %} +
"""