adds copy button to ip addresses in interface list #13697

This commit is contained in:
Abhimanyu Saharan 2023-11-08 21:01:52 +05:30
parent 22e474ff96
commit 27584dbea4

View File

@ -35,14 +35,26 @@ DEVICEBAY_STATUS = """
""" """
INTERFACE_IPADDRESSES = """ INTERFACE_IPADDRESSES = """
<div class="table-badge-group"> <div class="table-badge-group container">
<div class="row align-items-center">
{% for ip in value.all %} {% for ip in value.all %}
{% if ip.status != 'active' %} {% if ip.status != 'active' %}
<a href="{{ ip.get_absolute_url }}" class="table-badge badge bg-{{ ip.get_status_color }}" data-bs-toggle="tooltip" data-bs-placement="left" title="{{ ip.get_status_display }}">{{ ip }}</a> <div class="col-md-5 mb-2">
<a href="{{ ip.get_absolute_url }}" class="table-badge badge bg-{{ ip.get_status_color }} copy-content" data-bs-toggle="tooltip" data-bs-placement="left" title="{{ ip.get_status_display }}">{{ ip }}</a>
</div>
<div class="col-md-5 mb-2">
{% copy_content record.pk prefix="ipaddress_" %}
</div>
{% else %} {% else %}
<a href="{{ ip.get_absolute_url }}" class="table-badge">{{ ip }}</a> <div class="col-md-5 mb-2">
<a href="{{ ip.get_absolute_url }}" class="table-badge copy-content" id="ipaddress_{{ record.pk }}">{{ ip }}</a>
</div>
<div class="col-md-5 mb-2">
{% copy_content record.pk prefix="ipaddress_" %}
</div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div>
</div> </div>
""" """