mirror of
https://github.com/TakeusV1/flask_ipam.git
synced 2026-10-13 17:15:33 +02:00
58 lines
2.4 KiB
HTML
58 lines
2.4 KiB
HTML
{% for allocation in allocations %}
|
|
<tr>
|
|
<td><b>{{allocation.ipv4}}</b></td>
|
|
<td>{{allocation.hostname}}</td>
|
|
<td>{{allocation.description}}</td>
|
|
<td>
|
|
{% if Inventory.query.filter_by(id=allocation.device_id).first() %}
|
|
<a href="{{Inventory.query.filter_by(id=allocation.device_id).first().id}}" style="text-decoration:none;">link</a>
|
|
{% else %}
|
|
N/A
|
|
{% endif %}
|
|
</td>
|
|
<td>{{allocation.is_dhcp}}</td>
|
|
<td>{{allocation.is_gateway}}</td>
|
|
<td>{{allocation.is_decom}}</td>
|
|
<td>
|
|
{% if allocation.is_used %}
|
|
<button
|
|
hx-get="{{ url_for('network.allocation_edit_modal',net_id=network.id,ipv4=allocation.ipv4) }}?page={{active_page}}"
|
|
hx-trigger="click"
|
|
hx-target="#modal-edit"
|
|
data-bs-toggle="modal"
|
|
data-bs-target="#modal-edit"
|
|
class="btn btn-sm btn-outline-info"
|
|
style="padding-top:1px;padding-bottom:1px"
|
|
> Edit
|
|
</button>
|
|
{% if allocation.is_decom %}
|
|
<a href="{{ url_for('network.allocation_decom',action=2,net_id=network.id,ipv4=allocation.ipv4) }}?page={{active_page}}" class="btn btn-sm btn-outline-primary" style="padding-top:1px;padding-bottom:1px">Undecom</a>
|
|
{% else %}
|
|
<a href="{{ url_for('network.allocation_decom',action=1,net_id=network.id,ipv4=allocation.ipv4) }}?page={{active_page}}" class="btn btn-sm btn-outline-warning" style="padding-top:1px;padding-bottom:1px">Decom</a>
|
|
{% endif %}
|
|
<button
|
|
hx-get="{{ url_for('network.allocation_del_modal',net_id=network.id,ipv4=allocation.ipv4) }}?page={{active_page}}"
|
|
hx-trigger="click"
|
|
hx-target="#modal-del"
|
|
data-bs-toggle="modal"
|
|
data-bs-target="#modal-del"
|
|
class="btn btn-sm btn-outline-danger"
|
|
style="padding-top:1px;padding-bottom:1px"
|
|
> Unallocate
|
|
</button>
|
|
{% else %}
|
|
<button
|
|
hx-get="{{ url_for('network.allocation_edit_modal',net_id=network.id,ipv4=allocation.ipv4) }}?page={{active_page}}"
|
|
hx-trigger="click"
|
|
hx-target="#modal-edit"
|
|
data-bs-toggle="modal"
|
|
data-bs-target="#modal-edit"
|
|
class="btn btn-sm btn-outline-success"
|
|
style="padding-top:1px;padding-bottom:1px"
|
|
> Allocate
|
|
</button>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|