zhlajiex commited on
Commit
201cf10
·
1 Parent(s): 17b78b2

UI: Add logout buttons to Settings modal and Homepage menu

Browse files
backend/public/chat.html CHANGED
@@ -135,7 +135,7 @@
135
  <a href="/sentinel" class="flex items-center gap-4 text-[8px] font-black text-green-900 hover:text-green-400 transition uppercase tracking-widest">
136
  <i class="fas fa-microchip"></i> Sentinel Terminal
137
  </a>
138
- <button onclick="logout()" class="text-[8px] font-black text-red-950 uppercase tracking-widest hover:text-red-500 transition text-left">Terminate Link</button>
139
  </div>
140
  </aside>
141
 
@@ -227,7 +227,10 @@
227
  </div>
228
  </div>
229
 
230
- <button onclick="saveSettings()" class="w-full py-6 bg-white text-black rounded-3xl font-black text-[10px] uppercase tracking-[0.4em] shadow-xl active:scale-95 transition">Apply Neural Protocols</button>
 
 
 
231
  </div>
232
  </div>
233
 
 
135
  <a href="/sentinel" class="flex items-center gap-4 text-[8px] font-black text-green-900 hover:text-green-400 transition uppercase tracking-widest">
136
  <i class="fas fa-microchip"></i> Sentinel Terminal
137
  </a>
138
+ <button onclick="logout()" class="text-[8px] font-black text-red-950 uppercase tracking-widest hover:text-red-500 transition text-left">Logout / Terminate Link</button>
139
  </div>
140
  </aside>
141
 
 
227
  </div>
228
  </div>
229
 
230
+ <div class="flex justify-between items-center gap-4">
231
+ <button onclick="logout()" class="flex-1 py-6 bg-red-950/20 border border-red-900/30 text-red-500 rounded-3xl font-black text-[10px] uppercase tracking-[0.4em] hover:bg-red-500 hover:text-black transition">Terminate Session</button>
232
+ <button onclick="saveSettings()" class="flex-[2] py-6 bg-white text-black rounded-3xl font-black text-[10px] uppercase tracking-[0.4em] shadow-xl active:scale-95 transition">Apply Neural Protocols</button>
233
+ </div>
234
  </div>
235
  </div>
236
 
backend/public/index.html CHANGED
@@ -114,6 +114,9 @@
114
  <button onclick="location.href='/about'" class="text-[9px] font-black text-zinc-700 uppercase tracking-[0.6em] hover:text-white transition flex items-center justify-center gap-4 flex-1">
115
  <i class="fas fa-fingerprint text-xs"></i> Profile
116
  </button>
 
 
 
117
  </div>
118
  </div>
119
  </div>
@@ -133,6 +136,11 @@
133
  }, 3000);
134
 
135
  async function updateUptime() {
 
 
 
 
 
136
  try {
137
  const res = await fetch('/api/status/uptime');
138
  const data = await res.json();
@@ -216,6 +224,10 @@
216
  });
217
  });
218
  }
 
 
 
 
219
  </script>
220
  </body>
221
  </html>
 
114
  <button onclick="location.href='/about'" class="text-[9px] font-black text-zinc-700 uppercase tracking-[0.6em] hover:text-white transition flex items-center justify-center gap-4 flex-1">
115
  <i class="fas fa-fingerprint text-xs"></i> Profile
116
  </button>
117
+ <button id="logout-btn" onclick="logout()" class="hidden text-[9px] font-black text-red-900 uppercase tracking-[0.6em] hover:text-red-500 transition flex items-center justify-center gap-4 flex-1">
118
+ <i class="fas fa-sign-out-alt text-xs"></i> Logout
119
+ </button>
120
  </div>
121
  </div>
122
  </div>
 
136
  }, 3000);
137
 
138
  async function updateUptime() {
139
+ // Check for token to show logout button
140
+ if (localStorage.getItem('token')) {
141
+ document.getElementById('logout-btn').classList.remove('hidden');
142
+ }
143
+
144
  try {
145
  const res = await fetch('/api/status/uptime');
146
  const data = await res.json();
 
224
  });
225
  });
226
  }
227
+ function logout() {
228
+ localStorage.removeItem('token');
229
+ location.reload();
230
+ }
231
  </script>
232
  </body>
233
  </html>