This commit is contained in:
Pinga 2023-12-27 13:52:09 +02:00
parent 9f3fbd5630
commit e80afaa0e9
8 changed files with 61 additions and 21 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -7,6 +7,7 @@
{% else %}
<link href="/assets/css/tabulator.min.css" rel="stylesheet">
{% endif %}
<link href="/assets/css/sweetalert2.min.css" rel="stylesheet">
<style>
.small-dropdown .dropdown-item {
padding: 0.25rem 1.5rem;

View file

@ -1,4 +1,5 @@
<script src="/assets/js/tabulator.min.js" defer></script>
<script src="/assets/js/sweetalert2.min.js" defer></script>
<script src="/assets/js/tabler.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
@ -122,10 +123,16 @@
{title: "Actions", formatter: actionsFormatter, headerSort: false, download:false, hozAlign: "center", responsive:0, cellClick: function(e, cell){
if (e.target.closest('.delete-btn')) {
e.preventDefault(); // Prevent the default link behavior
if (confirm("Are you sure you want to delete this application?")) {
Swal.fire({
title: "Are you sure you want to delete this application?",
showCancelButton: true,
confirmButtonText: "Confirm"
}).then((result) => {
if (result.isConfirmed) {
let deleteUrl = e.target.closest('.delete-btn').getAttribute('data-delete-url');
window.location.href = deleteUrl;
}
}
});
}
}},
],

View file

@ -1,4 +1,5 @@
<script src="/assets/js/tabulator.min.js" defer></script>
<script src="/assets/js/sweetalert2.min.js" defer></script>
<script src="/assets/js/tabler.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
@ -100,10 +101,16 @@
{title: "Actions", formatter: actionsFormatter, headerSort: false, download:false, hozAlign: "center", responsive:0, cellClick: function(e, cell){
if (e.target.closest('.delete-btn')) {
e.preventDefault(); // Prevent the default link behavior
if (confirm("Are you sure you want to delete this contact?")) {
Swal.fire({
title: "Are you sure you want to delete this contact?",
showCancelButton: true,
confirmButtonText: "Confirm"
}).then((result) => {
if (result.isConfirmed) {
let deleteUrl = e.target.closest('.delete-btn').getAttribute('data-delete-url');
window.location.href = deleteUrl;
}
}
});
}
}},
],

View file

@ -1,4 +1,5 @@
<script src="/assets/js/tabulator.min.js" defer></script>
<script src="/assets/js/sweetalert2.min.js" defer></script>
<script src="/assets/js/tabler.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
@ -119,22 +120,40 @@
{title: "Actions", formatter: actionsFormatter, headerSort: false, download:false, hozAlign: "center", responsive:0, cellClick: function(e, cell){
if (e.target.closest('.delete-btn')) {
e.preventDefault(); // Prevent the default link behavior
if (confirm("Are you sure you want to delete this domain?")) {
Swal.fire({
title: "Are you sure you want to delete this domain?",
showCancelButton: true,
confirmButtonText: "Confirm"
}).then((result) => {
if (result.isConfirmed) {
let deleteUrl = e.target.closest('.delete-btn').getAttribute('data-delete-url');
window.location.href = deleteUrl;
}
}
});
} else if (e.target.closest('.restore-btn')) {
e.preventDefault(); // Prevent the default link behavior
if (confirm("Are you sure you want to restore this domain?")) {
Swal.fire({
title: "Are you sure you want to restore this domain?",
showCancelButton: true,
confirmButtonText: "Confirm"
}).then((result) => {
if (result.isConfirmed) {
let restoreUrl = e.target.closest('.restore-btn').getAttribute('data-restore-url');
window.location.href = restoreUrl;
}
}
});
} else if (e.target.closest('.report-btn')) {
e.preventDefault(); // Prevent the default link behavior
if (confirm("Are you sure you want to submit restore report for this domain?")) {
Swal.fire({
title: "Are you sure you want to submit restore report for this domain?",
showCancelButton: true,
confirmButtonText: "Confirm"
}).then((result) => {
if (result.isConfirmed) {
let reportUrl = e.target.closest('.report-btn').getAttribute('data-report-url');
window.location.href = reportUrl;
}
}
});
}
}},
],

View file

@ -1,4 +1,5 @@
<script src="/assets/js/tabulator.min.js" defer></script>
<script src="/assets/js/sweetalert2.min.js" defer></script>
<script src="/assets/js/tabler.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
@ -98,10 +99,16 @@
{title: "Actions", formatter: actionsFormatter, headerSort: false, download:false, hozAlign: "center", responsive:0, cellClick: function(e, cell){
if (e.target.closest('.delete-btn')) {
e.preventDefault(); // Prevent the default link behavior
if (confirm("Are you sure you want to delete this host?")) {
Swal.fire({
title: "Are you sure you want to delete this host?",
showCancelButton: true,
confirmButtonText: "Confirm"
}).then((result) => {
if (result.isConfirmed) {
let deleteUrl = e.target.closest('.delete-btn').getAttribute('data-delete-url');
window.location.href = deleteUrl;
}
}
});
}
}},
],

View file

@ -1,4 +1,5 @@
<script src="/assets/js/tabulator.min.js" defer></script>
<script src="/assets/js/sweetalert2.min.js" defer></script>
<script src="/assets/js/tabler.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
@ -106,15 +107,7 @@
}
});
});
function updateRecord(id) {
console.log("Updating record with ID: " + id);
}
function deleteRecord(id) {
console.log("Deleting record with ID: " + id);
}
function downloadCSV() {
table.download("csv", "data.csv");
}