64 lines
No EOL
2.8 KiB
HTML
64 lines
No EOL
2.8 KiB
HTML
<!-- Add this in the action buttons section -->
|
|
<div class="col-auto ms-auto">
|
|
<div class="btn-list">
|
|
<a href="{{ url_for('dashboard.subnet_edit', subnet_id=subnet.id) }}" class="btn btn-primary">
|
|
<span class="ti ti-edit me-2"></span>Edit Subnet
|
|
</a>
|
|
<button class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteSubnetModal">
|
|
<span class="ti ti-trash me-2"></span>Delete
|
|
</button>
|
|
<button class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#forceDeleteSubnetModal">
|
|
<span class="ti ti-alert-triangle me-2"></span>Force Delete
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Add this at the bottom of the template -->
|
|
<!-- Force Delete Subnet Modal -->
|
|
<div class="modal modal-blur fade" id="forceDeleteSubnetModal" tabindex="-1">
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title text-danger">⚠️ Dangerous Action: Force Delete</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="alert alert-danger">
|
|
<h4 class="alert-title">Warning: This action cannot be undone!</h4>
|
|
<p>You are about to <strong>permanently delete</strong> the subnet {{ subnet.cidr }} and <strong>ALL</strong>
|
|
of its:</p>
|
|
<ul>
|
|
<li>{{ subnet.servers|length }} server(s)</li>
|
|
<li>All applications on those servers</li>
|
|
<li>All port configurations</li>
|
|
<li>All documentation</li>
|
|
</ul>
|
|
</div>
|
|
<p>To confirm, please type <strong>{{ subnet.cidr }}</strong> below:</p>
|
|
<input type="text" id="force-delete-confirmation" class="form-control"
|
|
placeholder="Type subnet CIDR to confirm">
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
<form method="POST" action="{{ url_for('ipam.subnet_force_delete', subnet_id=subnet.id) }}"
|
|
id="force-delete-form">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<button type="submit" class="btn btn-danger" id="force-delete-button" disabled>Force Delete
|
|
Everything</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
const confirmationInput = document.getElementById('force-delete-confirmation');
|
|
const deleteButton = document.getElementById('force-delete-button');
|
|
const subnetCidr = "{{ subnet.cidr }}";
|
|
|
|
confirmationInput.addEventListener('input', function () {
|
|
deleteButton.disabled = confirmationInput.value !== subnetCidr;
|
|
});
|
|
});
|
|
</script> |