This commit is contained in:
Takeus committed 2025-02-12 12:01:08 +01:00
1 parent e5fbf15828
commit 4628df54e1
8 files changed
+163 -16

No files matched your search

+31 -6
View File
@@ -4,8 +4,20 @@
{% include 'panel/_flash.html' %}
<div class="container" style="margin-top:5vh;">
<div class="row">
<!-- Search BAR -->
<div class="col-12">
<div class="mb-3">
<input class="form-control" type="search"
name="search" placeholder="Begin Typing To Search Users..."
hx-post="{{ url_for('base.allocation_search',net_id=network.id) }}"
hx-trigger="input changed delay:500ms, keyup[key=='Enter']"
hx-target="#search-results"
hx-indicator=".htmx-indicator"
>
</div>
</div>
<!-- IPV4 TABLE -->
<div class="col-9">
<div class="col-12">
<table class="table table-striped table-hover table-sm">
<thead>
<tr>
@@ -16,7 +28,7 @@
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<tbody id="search-results">
{% for allocation in allocations %}
<tr>
<td><b>{{allocation.ipv4}}</b></td>
@@ -30,6 +42,7 @@
{% 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"
@@ -46,17 +59,29 @@
hx-target="#modal-del"
data-bs-toggle="modal"
data-bs-target="#modal-del"
class="btn btn-sm btn-outline-danger"
class="btn btn-sm btn-outline-warning"
style="padding-top:1px;padding-bottom:1px"
> Delete
> 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 %}
</tbody>
</table>
</div>
<!-- IPV4 FORM -->
<!-- IPV4 FORM
<div class="col-3">
<div class="card p-4 shadow rounded-3">
<h2 class="text-center mb-4">Add IPv4</h2>
@@ -77,7 +102,7 @@
<button type="submit" class="btn btn-secondary w-100">Submit</button>
</form>
</div>
</div>
</div> -->
</div>
<div class="d-flex justify-content-between">
<nav>