Closes #7504: Include IP range data under IPAM role views

This commit is contained in:
jeremystretch
2022-02-01 16:47:29 -05:00
parent 8545a547b9
commit 4f4e6938eb
4 changed files with 34 additions and 3 deletions

View File

@@ -38,6 +38,30 @@
<a href="{% url 'ipam:prefix_list' %}?role_id={{ object.pk }}">{{ prefixes_table.rows|length }}</a>
</td>
</tr>
<tr>
<th scope="row">IP Ranges</th>
<td>
{% with ipranges_count=object.ip_ranges.count %}
{% if ipranges_count %}
<a href="{% url 'ipam:iprange_list' %}?role_id={{ object.pk }}">{{ ipranges_count }}</a>
{% else %}
&mdash;
{% endif %}
{% endwith %}
</td>
</tr>
<tr>
<th scope="row">VLANs</th>
<td>
{% with vlans_count=object.vlans.count %}
{% if vlans_count %}
<a href="{% url 'ipam:vlan_list' %}?role_id={{ object.pk }}">{{ vlans_count }}</a>
{% else %}
&mdash;
{% endif %}
{% endwith %}
</td>
</tr>
</table>
</div>
</div>