Spaces:
Running
Running
Create dashboard.html
Browse files- templates/dashboard.html +33 -0
templates/dashboard.html
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
window.location.href = "/logout"; // Redirect to logout
|
17 |
+
}
|
18 |
+
|
19 |
+
// Reset timer on user activity
|
20 |
+
document.addEventListener("mousemove", resetTimer);
|
21 |
+
document.addEventListener("keydown", resetTimer);
|
22 |
+
document.addEventListener("click", resetTimer);
|
23 |
+
document.addEventListener("touchstart", resetTimer);
|
24 |
+
|
25 |
+
// Initialize the timer when the page loads
|
26 |
+
resetTimer();
|
27 |
+
</script>
|
28 |
+
</head>
|
29 |
+
<body>
|
30 |
+
<h1>Welcome to the Dashboard</h1>
|
31 |
+
<p>You will be logged out automatically after 5 minutes of inactivity.</p>
|
32 |
+
</body>
|
33 |
+
</html>
|