DSatishchandra commited on
Commit
4e55c66
·
verified ·
1 Parent(s): 1f20655

Update templates/dashboard.html

Browse files
Files changed (1) hide show
  1. templates/dashboard.html +9 -5
templates/dashboard.html CHANGED
@@ -69,7 +69,7 @@
69
  <a href="/menu">Go to Menu</a>
70
 
71
  <!-- Button for triggering voice recognition -->
72
- <button id="listen-btn">Say "Go to Menu"</button>
73
 
74
  <!-- Logout Button -->
75
  <button id="logout-btn" onclick="logout()">Logout</button>
@@ -97,7 +97,7 @@
97
  // Button for listening to user input
98
  const listenButton = document.getElementById("listen-btn");
99
  listenButton.addEventListener("click", () => {
100
- speak("Please say 'Go to Menu' to navigate to the menu.");
101
  recognition.start();
102
  });
103
 
@@ -108,6 +108,10 @@
108
  // If user says "Go to Menu", navigate to the menu
109
  if (command.includes("go to menu")) {
110
  window.location.href = "/menu";
 
 
 
 
111
  }
112
  };
113
 
@@ -123,10 +127,10 @@
123
  // Example of clearing session storage or cookies (if applicable)
124
  // sessionStorage.clear(); // Uncomment if using sessionStorage
125
 
126
- // Redirect to the login page or any other page for logout
127
- window.location.href = "/login"; // Modify with actual logout route
128
  }
129
  </script>
130
 
131
  </body>
132
- </html>
 
69
  <a href="/menu">Go to Menu</a>
70
 
71
  <!-- Button for triggering voice recognition -->
72
+ <button id="listen-btn">Say "Go to Menu" or "Logout"</button>
73
 
74
  <!-- Logout Button -->
75
  <button id="logout-btn" onclick="logout()">Logout</button>
 
97
  // Button for listening to user input
98
  const listenButton = document.getElementById("listen-btn");
99
  listenButton.addEventListener("click", () => {
100
+ speak("Please say 'Go to Menu' to navigate to the menu or 'Logout' to log out.");
101
  recognition.start();
102
  });
103
 
 
108
  // If user says "Go to Menu", navigate to the menu
109
  if (command.includes("go to menu")) {
110
  window.location.href = "/menu";
111
+ }
112
+ // If user says "Logout", log out
113
+ else if (command.includes("logout")) {
114
+ logout();
115
  }
116
  };
117
 
 
127
  // Example of clearing session storage or cookies (if applicable)
128
  // sessionStorage.clear(); // Uncomment if using sessionStorage
129
 
130
+ // Redirect to the landing page (Modify this URL with the correct path)
131
+ window.location.href = "/landing"; // Modify with actual logout route
132
  }
133
  </script>
134
 
135
  </body>
136
+ </html>