Spaces:
Running
Running
i want an admin username and password setup. that way only i can access admin settings. set the admin username as urbanzulu19 and the password as Urbanzulu25$
Browse files- admin-login.html +133 -0
- admin.html +38 -1
- index.html +4 -4
admin-login.html
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" class="dark">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Admin Login | CodeForge-AI</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
+
<script>
|
| 12 |
+
tailwind.config = {
|
| 13 |
+
darkMode: 'class',
|
| 14 |
+
theme: {
|
| 15 |
+
extend: {
|
| 16 |
+
colors: {
|
| 17 |
+
primary: '#ef4444',
|
| 18 |
+
secondary: '#6b7280'
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
</script>
|
| 24 |
+
</head>
|
| 25 |
+
<body class="bg-gray-900 text-white min-h-screen flex items-center justify-center">
|
| 26 |
+
<div class="max-w-md w-full mx-4">
|
| 27 |
+
<div class="bg-gray-800 rounded-2xl p-8 border border-purple-500/20 shadow-2xl">
|
| 28 |
+
<!-- Logo -->
|
| 29 |
+
<div class="text-center mb-8">
|
| 30 |
+
<div class="flex items-center justify-center space-x-3 mb-4">
|
| 31 |
+
<div class="w-12 h-12 bg-purple-500 rounded-xl flex items-center justify-center">
|
| 32 |
+
<i data-feather="shield" class="w-6 h-6"></i>
|
| 33 |
+
</div>
|
| 34 |
+
<span class="text-2xl font-bold text-white">CodeForge-AI</span>
|
| 35 |
+
</div>
|
| 36 |
+
<h1 class="text-3xl font-bold text-white">Admin Login</h1>
|
| 37 |
+
<p class="text-gray-400 mt-2">Enter your credentials to access the admin panel</p>
|
| 38 |
+
</div>
|
| 39 |
+
|
| 40 |
+
<!-- Login Form -->
|
| 41 |
+
<form id="loginForm" class="space-y-6">
|
| 42 |
+
<div>
|
| 43 |
+
<label for="username" class="block text-sm font-medium text-gray-300 mb-2">Username</label>
|
| 44 |
+
<input
|
| 45 |
+
type="text"
|
| 46 |
+
id="username"
|
| 47 |
+
name="username"
|
| 48 |
+
required
|
| 49 |
+
class="w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent transition-colors"
|
| 50 |
+
placeholder="Enter your username"
|
| 51 |
+
>
|
| 52 |
+
</div>
|
| 53 |
+
|
| 54 |
+
<div>
|
| 55 |
+
<label for="password" class="block text-sm font-medium text-gray-300 mb-2">Password</label>
|
| 56 |
+
<input
|
| 57 |
+
type="password"
|
| 58 |
+
id="password"
|
| 59 |
+
name="password"
|
| 60 |
+
required
|
| 61 |
+
class="w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent transition-colors"
|
| 62 |
+
placeholder="Enter your password"
|
| 63 |
+
>
|
| 64 |
+
</div>
|
| 65 |
+
|
| 66 |
+
<div id="errorMessage" class="hidden bg-red-500/20 border border-red-500/50 rounded-xl p-4">
|
| 67 |
+
<div class="flex items-center space-x-2 text-red-400">
|
| 68 |
+
<i data-feather="alert-circle" class="w-5 h-5"></i>
|
| 69 |
+
<span class="text-sm font-medium" id="errorText">Invalid username or password</span>
|
| 70 |
+
</div>
|
| 71 |
+
</div>
|
| 72 |
+
|
| 73 |
+
<button
|
| 74 |
+
type="submit"
|
| 75 |
+
class="w-full bg-purple-500 hover:bg-purple-600 text-white py-3 rounded-xl font-semibold transition-colors flex items-center justify-center"
|
| 76 |
+
>
|
| 77 |
+
<i data-feather="log-in" class="w-5 h-5 mr-2"></i>
|
| 78 |
+
Sign In
|
| 79 |
+
</button>
|
| 80 |
+
</form>
|
| 81 |
+
|
| 82 |
+
<div class="mt-6 text-center">
|
| 83 |
+
<a href="index.html" class="text-purple-400 hover:text-purple-300 transition-colors text-sm">
|
| 84 |
+
<i data-feather="arrow-left" class="w-4 h-4 inline mr-1"></i>
|
| 85 |
+
Back to Home
|
| 86 |
+
</a>
|
| 87 |
+
</div>
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
|
| 91 |
+
<script>
|
| 92 |
+
// Initialize Feather Icons
|
| 93 |
+
feather.replace();
|
| 94 |
+
|
| 95 |
+
// Handle form submission
|
| 96 |
+
document.getElementById('loginForm').addEventListener('submit', function(e) {
|
| 97 |
+
e.preventDefault();
|
| 98 |
+
|
| 99 |
+
const username = document.getElementById('username').value;
|
| 100 |
+
const password = document.getElementById('password').value;
|
| 101 |
+
const errorMessage = document.getElementById('errorMessage');
|
| 102 |
+
const errorText = document.getElementById('errorText');
|
| 103 |
+
|
| 104 |
+
// Check credentials
|
| 105 |
+
if (username === 'urbanzulu19' && password === 'Urbanzulu25$') {
|
| 106 |
+
// Store credentials in localStorage
|
| 107 |
+
localStorage.setItem('adminUsername', username);
|
| 108 |
+
localStorage.setItem('adminPassword', password);
|
| 109 |
+
|
| 110 |
+
// Redirect to admin panel
|
| 111 |
+
window.location.href = 'admin.html';
|
| 112 |
+
} else {
|
| 113 |
+
// Show error message
|
| 114 |
+
errorText.textContent = 'Invalid username or password';
|
| 115 |
+
errorMessage.classList.remove('hidden');
|
| 116 |
+
|
| 117 |
+
// Clear password field
|
| 118 |
+
document.getElementById('password').value = '';
|
| 119 |
+
}
|
| 120 |
+
});
|
| 121 |
+
|
| 122 |
+
// Check if already logged in
|
| 123 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 124 |
+
const adminUsername = localStorage.getItem('adminUsername');
|
| 125 |
+
const adminPassword = localStorage.getItem('adminPassword');
|
| 126 |
+
|
| 127 |
+
if (adminUsername === 'urbanzulu19' && adminPassword === 'Urbanzulu25$') {
|
| 128 |
+
window.location.href = 'admin.html';
|
| 129 |
+
}
|
| 130 |
+
});
|
| 131 |
+
</script>
|
| 132 |
+
</body>
|
| 133 |
+
</html>
|
admin.html
CHANGED
|
@@ -344,11 +344,29 @@
|
|
| 344 |
</div>
|
| 345 |
</div>
|
| 346 |
</div>
|
| 347 |
-
|
| 348 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 349 |
// Initialize Feather Icons
|
| 350 |
feather.replace();
|
| 351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
// Initialize System Chart
|
| 353 |
const systemCtx = document.getElementById('systemChart').getContext('2d');
|
| 354 |
new Chart(systemCtx, {
|
|
@@ -408,6 +426,25 @@
|
|
| 408 |
}
|
| 409 |
}
|
| 410 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 411 |
</script>
|
| 412 |
</body>
|
| 413 |
</html>
|
|
|
|
| 344 |
</div>
|
| 345 |
</div>
|
| 346 |
</div>
|
|
|
|
| 347 |
<script>
|
| 348 |
+
// Check if user is logged in as admin
|
| 349 |
+
function checkAdminAuth() {
|
| 350 |
+
const adminUsername = localStorage.getItem('adminUsername');
|
| 351 |
+
const adminPassword = localStorage.getItem('adminPassword');
|
| 352 |
+
|
| 353 |
+
if (adminUsername !== 'urbanzulu19' || adminPassword !== 'Urbanzulu25</body>
|
| 354 |
+
</html>) {
|
| 355 |
+
window.location.href = 'admin-login.html';
|
| 356 |
+
return false;
|
| 357 |
+
}
|
| 358 |
+
return true;
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
// Initialize Feather Icons
|
| 362 |
feather.replace();
|
| 363 |
|
| 364 |
+
// Check authentication on page load
|
| 365 |
+
if (!checkAdminAuth()) {
|
| 366 |
+
// Redirect to login page
|
| 367 |
+
window.location.href = 'admin-login.html';
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
// Initialize System Chart
|
| 371 |
const systemCtx = document.getElementById('systemChart').getContext('2d');
|
| 372 |
new Chart(systemCtx, {
|
|
|
|
| 426 |
}
|
| 427 |
}
|
| 428 |
});
|
| 429 |
+
|
| 430 |
+
// Logout functionality
|
| 431 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 432 |
+
// Add logout button to navigation
|
| 433 |
+
const userDiv = document.querySelector('.flex.items-center.space-x-4');
|
| 434 |
+
if (userDiv) {
|
| 435 |
+
const logoutBtn = document.createElement('button');
|
| 436 |
+
logoutBtn.className = 'text-gray-300 hover:text-white transition-colors';
|
| 437 |
+
logoutBtn.innerHTML = '<i data-feather="log-out" class="w-5 h-5"></i>';
|
| 438 |
+
logoutBtn.title = 'Logout';
|
| 439 |
+
logoutBtn.onclick = function() {
|
| 440 |
+
localStorage.removeItem('adminUsername');
|
| 441 |
+
localStorage.removeItem('adminPassword');
|
| 442 |
+
window.location.href = 'admin-login.html';
|
| 443 |
+
};
|
| 444 |
+
userDiv.appendChild(logoutBtn);
|
| 445 |
+
feather.replace();
|
| 446 |
+
}
|
| 447 |
+
});
|
| 448 |
</script>
|
| 449 |
</body>
|
| 450 |
</html>
|
index.html
CHANGED
|
@@ -40,17 +40,17 @@
|
|
| 40 |
<a href="#" class="text-gray-300 hover:text-white transition-colors">Templates</a>
|
| 41 |
<a href="#" class="text-gray-300 hover:text-white transition-colors">Deployments</a>
|
| 42 |
<a href="#" class="text-gray-300 hover:text-white transition-colors">Documentation</a>
|
| 43 |
-
<a href="admin.html" class="text-gray-300 hover:text-white transition-colors">Admin</a>
|
| 44 |
-
|
| 45 |
</div>
|
| 46 |
<div class="flex items-center space-x-4">
|
| 47 |
<button class="bg-red-500 hover:bg-red-600 px-4 py-2 rounded-lg text-white font-medium transition-colors">
|
| 48 |
Start Coding
|
| 49 |
</button>
|
| 50 |
-
<a href="admin.html" class="bg-purple-500 hover:bg-purple-600 px-4 py-2 rounded-lg text-white font-medium transition-colors">
|
| 51 |
Admin Panel
|
| 52 |
</a>
|
| 53 |
-
|
| 54 |
<i data-feather="user" class="w-5 h-5"></i>
|
| 55 |
</button>
|
| 56 |
</div>
|
|
|
|
| 40 |
<a href="#" class="text-gray-300 hover:text-white transition-colors">Templates</a>
|
| 41 |
<a href="#" class="text-gray-300 hover:text-white transition-colors">Deployments</a>
|
| 42 |
<a href="#" class="text-gray-300 hover:text-white transition-colors">Documentation</a>
|
| 43 |
+
<a href="admin-login.html" class="text-gray-300 hover:text-white transition-colors">Admin</a>
|
| 44 |
+
</div>
|
| 45 |
</div>
|
| 46 |
<div class="flex items-center space-x-4">
|
| 47 |
<button class="bg-red-500 hover:bg-red-600 px-4 py-2 rounded-lg text-white font-medium transition-colors">
|
| 48 |
Start Coding
|
| 49 |
</button>
|
| 50 |
+
<a href="admin-login.html" class="bg-purple-500 hover:bg-purple-600 px-4 py-2 rounded-lg text-white font-medium transition-colors">
|
| 51 |
Admin Panel
|
| 52 |
</a>
|
| 53 |
+
<button class="text-gray-300 hover:text-white transition-colors">
|
| 54 |
<i data-feather="user" class="w-5 h-5"></i>
|
| 55 |
</button>
|
| 56 |
</div>
|