Delete templates/dashboard.html
Browse files- templates/dashboard.html +0 -37
templates/dashboard.html
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
-
<html lang="en">
|
3 |
-
<head>
|
4 |
-
<meta charset="UTF-8">
|
5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>Dashboard</title>
|
7 |
-
<script>
|
8 |
-
let inactivityTimer;
|
9 |
-
|
10 |
-
function resetTimer() {
|
11 |
-
clearTimeout(inactivityTimer);
|
12 |
-
inactivityTimer = setTimeout(logout, 5 * 60 * 1000); // 5 minutes
|
13 |
-
}
|
14 |
-
|
15 |
-
function logout() {
|
16 |
-
fetch('/logout', { method: 'GET' }) // Call Flask logout route
|
17 |
-
.then(response => {
|
18 |
-
window.location.href = "/logout"; // Redirect to login page
|
19 |
-
})
|
20 |
-
.catch(error => console.error("Logout failed", error));
|
21 |
-
}
|
22 |
-
|
23 |
-
// Listen for user activity and reset the timer
|
24 |
-
document.addEventListener("mousemove", resetTimer);
|
25 |
-
document.addEventListener("keydown", resetTimer);
|
26 |
-
document.addEventListener("click", resetTimer);
|
27 |
-
document.addEventListener("touchstart", resetTimer);
|
28 |
-
|
29 |
-
// Start the inactivity timer on page load
|
30 |
-
resetTimer();
|
31 |
-
</script>
|
32 |
-
</head>
|
33 |
-
<body>
|
34 |
-
<h1>Welcome to the Dashboard</h1>
|
35 |
-
<p>You will be logged out automatically after 5 minutes of inactivity.</p>
|
36 |
-
</body>
|
37 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|