This commit is contained in:
Takeus committed 2025-02-12 16:35:23 +01:00
1 parent 711d1fbba3
commit a9e8a70df5
4 files changed
+70 -75

No files matched your search

@@ -1,4 +1,4 @@
{% for allocation in db_alloc %}
{% for allocation in allocations %}
<tr>
<td><b>{{allocation.ipv4}}</b></td>
<td>{{allocation.hostname}}</td>
@@ -10,6 +10,9 @@
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
@@ -22,13 +25,18 @@
style="padding-top:1px;padding-bottom:1px"
> Edit
</button>
{% if allocation.is_decom %}
<a href="{{ url_for('base.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('base.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('base.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-warning"
class="btn btn-sm btn-outline-danger"
style="padding-top:1px;padding-bottom:1px"
> Unallocate
</button>
@@ -46,4 +54,4 @@
{% endif %}
</td>
</tr>
{% endfor %}
{% endfor %}
+4 -49
View File
@@ -25,59 +25,14 @@
<th scope="col">Hostname</th>
<th scope="col">Description</th>
<th scope="col">Device</th>
<th scope="col">DHCP</th>
<th scope="col">GATEWAY</th>
<th scope="col">DECOM</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody id="search-results">
{% 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>
{% if allocation.is_used %}
<button
hx-get="{{ url_for('base.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>
<button
hx-get="{{ url_for('base.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-warning"
style="padding-top:1px;padding-bottom:1px"
> Unallocate
</button>
{% else %}
<button
hx-get="{{ url_for('base.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 %}
{% include 'panel/_table-alloc.html' %}
</tbody>
</table>
</div>