Update Teruss

This commit is contained in:
atuy
2026-06-27 10:59:04 +07:00
parent 699225821d
commit 1249cdbb42
+21 -22
View File
@@ -576,29 +576,28 @@ $("#example10").DataTable({
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
// Aksi ketika tombol dengan ID tombol-logout ditekan // Apapun tombolnya, selama dia mengarah ke link logout, tangkap!
$(document).on('click', '.tombol-logout', function(e) { $('a[href*="login/logout"]').on('click', function(e) {
e.preventDefault(); // Mencegah link langsung pindah e.preventDefault();
var link = $(this).attr('href'); var link = $(this).attr('href');
Swal.fire({ Swal.fire({
title: 'Yakin ingin keluar?', title: 'Yakin ingin keluar?',
text: "Sesi Anda akan segera diakhiri!", text: "Sesi Anda akan segera diakhiri!",
icon: 'warning', icon: 'warning',
showCancelButton: true, showCancelButton: true,
confirmButtonColor: '#3085d6', confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33', cancelButtonColor: '#d33',
confirmButtonText: 'Ya, Keluar!', confirmButtonText: 'Ya, Keluar!',
cancelButtonText: 'Batal', cancelButtonText: 'Batal'
reverseButtons: true }).then((result) => {
}).then((result) => { if (result.isConfirmed) {
if (result.isConfirmed) { window.location.href = link;
window.location.href = link; // Lanjutkan proses logout jika klik Ya }
} });
}); });
}); });
});
</script> </script>
</body> </body>