update revisi
This commit is contained in:
@@ -281,3 +281,28 @@
|
||||
|
||||
periode.textContent = `${month} (12 ${month} - 10 ${nextMonth} ${year})`;
|
||||
</script>
|
||||
|
||||
<script>
|
||||
let logoutTimer;
|
||||
|
||||
function resetLogoutTimer() {
|
||||
clearTimeout(logoutTimer);
|
||||
logoutTimer = setTimeout(() => {
|
||||
fetch("{{ route('admin.logout.submit') }}", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": "{{ csrf_token() }}",
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({})
|
||||
}).then(() => {
|
||||
window.location.href = "{{ url('/login') }}";
|
||||
});
|
||||
}, 30 * 60 * 1000); // 30 minutes
|
||||
}
|
||||
|
||||
document.addEventListener('mousemove', resetLogoutTimer);
|
||||
document.addEventListener('keydown', resetLogoutTimer);
|
||||
|
||||
resetLogoutTimer();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user