INDK commited on
Commit
a3704db
·
verified ·
1 Parent(s): 4868374

login system is not opening after putting admin in login - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +61 -1
index.html CHANGED
@@ -1194,6 +1194,60 @@
1194
  loadSampleData();
1195
  }
1196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1197
  // Set up all event listeners
1198
  function setupEventListeners() {
1199
  // Login form
@@ -1312,6 +1366,12 @@
1312
  type: nodeItem.getAttribute('data-node-type')
1313
  };
1314
  showContextMenu(e.clientX, e.clientY);
1315
-
 
 
 
 
 
 
1316
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=INDK/dk" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
1317
  </html>
 
1194
  loadSampleData();
1195
  }
1196
 
1197
+ // Handle login form submission
1198
+ function handleLogin(e) {
1199
+ e.preventDefault();
1200
+
1201
+ const username = elements.usernameInput.value.trim();
1202
+ const password = elements.passwordInput.value;
1203
+
1204
+ // Simple validation
1205
+ if (!username || !password) {
1206
+ showToast('Please enter both username and password', 'error');
1207
+ return;
1208
+ }
1209
+
1210
+ // In a real app, you would validate against a server here
1211
+ // For demo purposes, we'll accept any non-empty credentials
1212
+ state.currentUser = username;
1213
+ state.currentRole = 'admin'; // Default role for demo
1214
+
1215
+ // Update UI
1216
+ elements.userInitial.textContent = username.charAt(0).toUpperCase();
1217
+ elements.usernameDisplay.textContent = username;
1218
+
1219
+ // Hide login modal
1220
+ elements.loginModal.classList.add('hidden');
1221
+
1222
+ showToast('Login successful', 'success');
1223
+ }
1224
+
1225
+ // Show toast notification
1226
+ function showToast(message, type = 'info') {
1227
+ const toast = document.createElement('div');
1228
+ toast.className = `toast px-4 py-2 rounded-md shadow-md text-white ${
1229
+ type === 'error' ? 'bg-red-500' :
1230
+ type === 'success' ? 'bg-green-500' : 'bg-blue-500'
1231
+ }`;
1232
+ toast.textContent = message;
1233
+
1234
+ elements.toastContainer.appendChild(toast);
1235
+
1236
+ // Remove toast after animation
1237
+ setTimeout(() => {
1238
+ toast.remove();
1239
+ }, 3000);
1240
+ }
1241
+
1242
+ // Generate UUID
1243
+ function generateUUID() {
1244
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
1245
+ const r = Math.random() * 16 | 0;
1246
+ const v = c === 'x' ? r : (r & 0x3 | 0x8);
1247
+ return v.toString(16);
1248
+ });
1249
+ }
1250
+
1251
  // Set up all event listeners
1252
  function setupEventListeners() {
1253
  // Login form
 
1366
  type: nodeItem.getAttribute('data-node-type')
1367
  };
1368
  showContextMenu(e.clientX, e.clientY);
1369
+ }
1370
+ });
1371
+ }
1372
+
1373
+ // Initialize the app when DOM is loaded
1374
+ document.addEventListener('DOMContentLoaded', init);
1375
+ </script>
1376
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=INDK/dk" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
1377
  </html>