Urbanzulu commited on
Commit
e59728f
·
verified ·
1 Parent(s): ce2a833

make sure the user interface is complete and functional all the way around

Browse files
Files changed (2) hide show
  1. admin.html +115 -9
  2. installation.html +103 -27
admin.html CHANGED
@@ -22,11 +22,12 @@
22
  </div>
23
  <span class="text-xl font-bold text-white">CodeForge-AI Admin</span>
24
  </div>
25
- <div class="hidden md:flex space-x-6">
26
- <a href="index.html" class="text-gray-300 hover:text-white transition-colors">Home</a>
27
- <a href="dashboard.html" class="text-gray-300 hover:text-white transition-colors">Dashboard</a>
28
- </div>
29
  </div>
 
30
  <div class="flex items-center space-x-4">
31
  <div class="text-sm text-gray-300">
32
  Welcome, <span class="text-purple-400 font-semibold">Supreme Admin</span>
@@ -101,7 +102,7 @@
101
  <button class="bg-purple-500 hover:bg-purple-600 px-4 py-2 rounded-lg text-white text-sm font-medium transition-colors">
102
  <i data-feather="plus" class="w-4 h-4 inline mr-2"></i>
103
  Add User
104
- </button>
105
  </div>
106
 
107
  <div class="overflow-x-auto">
@@ -350,9 +351,8 @@
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;
@@ -426,6 +426,67 @@
426
  }
427
  }
428
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
429
 
430
  // Logout functionality
431
  document.addEventListener('DOMContentLoaded', function() {
@@ -444,7 +505,52 @@
444
  userDiv.appendChild(logoutBtn);
445
  feather.replace();
446
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
447
  });
448
- </script>
449
  </body>
450
  </html>
 
22
  </div>
23
  <span class="text-xl font-bold text-white">CodeForge-AI Admin</span>
24
  </div>
25
+ <div class="hidden md:flex space-x-6">
26
+ <a href="index.html" class="text-gray-300 hover:text-white transition-colors">Home</a>
27
+ <a href="dashboard.html" class="text-gray-300 hover:text-white transition-colors">Dashboard</a>
28
+ <a href="installation.html" class="text-gray-300 hover:text-white transition-colors">Installation</a>
29
  </div>
30
+ </div>
31
  <div class="flex items-center space-x-4">
32
  <div class="text-sm text-gray-300">
33
  Welcome, <span class="text-purple-400 font-semibold">Supreme Admin</span>
 
102
  <button class="bg-purple-500 hover:bg-purple-600 px-4 py-2 rounded-lg text-white text-sm font-medium transition-colors">
103
  <i data-feather="plus" class="w-4 h-4 inline mr-2"></i>
104
  Add User
105
+ </button>
106
  </div>
107
 
108
  <div class="overflow-x-auto">
 
351
  const adminUsername = localStorage.getItem('adminUsername');
352
  const adminPassword = localStorage.getItem('adminPassword');
353
 
354
+ if (adminUsername !== 'urbanzulu19' || adminPassword !== 'Urbanzulu25') {
355
+ window.location.href = 'admin-login.html';
 
356
  return false;
357
  }
358
  return true;
 
426
  }
427
  }
428
  });
429
+ // Add User Modal
430
+ const addUserModal = document.createElement('div');
431
+ addUserModal.className = 'fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden';
432
+ addUserModal.innerHTML = `
433
+ <div class="bg-gray-800 rounded-2xl p-6 w-full max-w-md border border-purple-500/20">
434
+ <div class="flex justify-between items-center mb-4">
435
+ <h3 class="text-xl font-bold text-white">Add New User</h3>
436
+ <button onclick="closeAddUserModal()" class="text-gray-400 hover:text-white">
437
+ <i data-feather="x" class="w-5 h-5"></i>
438
+ </button>
439
+ </div>
440
+ <form id="addUserForm" class="space-y-4">
441
+ <div>
442
+ <label class="block text-gray-300 text-sm mb-2">Name</label>
443
+ <input type="text" id="userName" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-purple-500" required>
444
+ </div>
445
+ <div>
446
+ <label class="block text-gray-300 text-sm mb-2">Email</label>
447
+ <input type="email" id="userEmail" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-purple-500" required>
448
+ </div>
449
+ <div>
450
+ <label class="block text-gray-300 text-sm mb-2">Plan</label>
451
+ <select id="userPlan" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-purple-500">
452
+ <option value="free">Free</option>
453
+ <option value="starter">Starter</option>
454
+ <option value="pro">Pro</option>
455
+ </select>
456
+ </div>
457
+ <div class="flex justify-end space-x-3 pt-4">
458
+ <button type="button" onclick="closeAddUserModal()" class="px-4 py-2 text-gray-300 hover:text-white transition-colors">Cancel</button>
459
+ <button type="submit" class="bg-purple-500 hover:bg-purple-600 px-4 py-2 rounded-lg text-white font-medium transition-colors">Add User</button>
460
+ </div>
461
+ </form>
462
+ </div>
463
+ `;
464
+ document.body.appendChild(addUserModal);
465
+
466
+ function openAddUserModal() {
467
+ addUserModal.classList.remove('hidden');
468
+ }
469
+
470
+ function closeAddUserModal() {
471
+ addUserModal.classList.add('hidden');
472
+ }
473
+
474
+ // Handle add user form submission
475
+ document.getElementById('addUserForm').addEventListener('submit', function(e) {
476
+ e.preventDefault();
477
+ const name = document.getElementById('userName').value;
478
+ const email = document.getElementById('userEmail').value;
479
+ const plan = document.getElementById('userPlan').value;
480
+
481
+ // In a real app, you would send this to your backend
482
+ console.log('Adding user:', { name, email, plan });
483
+
484
+ // Show success message
485
+ alert(`User ${name} added successfully!`);
486
+ closeAddUserModal();
487
+ // Reset form
488
+ document.getElementById('addUserForm').reset();
489
+ });
490
 
491
  // Logout functionality
492
  document.addEventListener('DOMContentLoaded', function() {
 
505
  userDiv.appendChild(logoutBtn);
506
  feather.replace();
507
  }
508
+
509
+ // Add click handler for Add User button
510
+ const addUserBtn = document.querySelector('button.bg-purple-500');
511
+ if (addUserBtn) {
512
+ addUserBtn.onclick = openAddUserModal;
513
+ }
514
+
515
+ // Add edit and delete functionality to user table
516
+ const userTable = document.querySelector('table');
517
+ if (userTable) {
518
+ userTable.addEventListener('click', function(e) {
519
+ const target = e.target.closest('button');
520
+ if (!target) return;
521
+
522
+ const row = target.closest('tr');
523
+ const userName = row.querySelector('.font-semibold').textContent;
524
+
525
+ if (target.querySelector('i[data-feather="edit"]')) {
526
+ alert(`Edit user: ${userName}`);
527
+ } else if (target.querySelector('i[data-feather="trash-2"]')) {
528
+ if (confirm(`Are you sure you want to delete ${userName}?`)) {
529
+ row.remove();
530
+ alert(`User ${userName} deleted successfully!`);
531
+ }
532
+ }
533
+ });
534
+ }
535
+
536
+ // Add functionality to admin action buttons
537
+ const systemSettingsBtn = document.querySelector('button:contains("System Settings")');
538
+ const emergencyShutdownBtn = document.querySelector('button:contains("Emergency Shutdown")');
539
+
540
+ if (systemSettingsBtn) {
541
+ systemSettingsBtn.onclick = function() {
542
+ alert('System settings modal would open here');
543
+ };
544
+ }
545
+
546
+ if (emergencyShutdownBtn) {
547
+ emergencyShutdownBtn.onclick = function() {
548
+ if (confirm('Are you sure you want to perform emergency shutdown? This will affect all users.')) {
549
+ alert('Emergency shutdown initiated!');
550
+ }
551
+ };
552
+ }
553
  });
554
+ </script>
555
  </body>
556
  </html>
installation.html CHANGED
@@ -34,15 +34,16 @@
34
  </div>
35
  <span class="text-xl font-bold text-white">CodeForge-AI</span>
36
  </div>
37
- <div class="hidden md:flex space-x-6">
38
- <a href="workspaces.html" class="text-gray-300 hover:text-white transition-colors">Workspaces</a>
39
- <a href="templates.html" class="text-gray-300 hover:text-white transition-colors">Templates</a>
40
- <a href="deployments.html" class="text-gray-300 hover:text-white transition-colors">Deployments</a>
41
- <a href="documentation.html" class="text-gray-300 hover:text-white transition-colors">Documentation</a>
42
- <a href="installation.html" class="text-red-400 hover:text-red-300 transition-colors">Installation</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
  <a href="workspaces.html" class="bg-red-500 hover:bg-red-600 px-4 py-2 rounded-lg text-white font-medium transition-colors">
48
  Start Coding
@@ -102,30 +103,30 @@
102
  </div>
103
  <h3 class="text-lg font-semibold text-white mb-2">Docker Compose</div>
104
  <p class="text-gray-400 text-sm mb-4">Complete setup with all dependencies</p>
105
- <a href="#" class="bg-red-500 hover:bg-red-600 px-6 py-3 rounded-xl text-white font-medium transition-colors inline-block">
106
  Download
107
  </a>
108
- </div>
109
  <div class="text-center">
110
  <div class="w-16 h-16 bg-red-500 rounded-2xl flex items-center justify-center mx-auto mb-4">
111
  <i data-feather="github" class="w-8 h-8"></i>
112
  </div>
113
  <h3 class="text-lg font-semibold text-white mb-2">Source Code</div>
114
  <p class="text-gray-400 text-sm mb-4">Build from source for customization</p>
115
- <a href="#" class="bg-red-500 hover:bg-red-600 px-6 py-3 rounded-xl text-white font-medium transition-colors inline-block">
116
  GitHub
117
  </a>
118
- </div>
119
  <div class="text-center">
120
  <div class="w-16 h-16 bg-red-500 rounded-2xl flex items-center justify-center mx-auto mb-4">
121
  <i data-feather="package" class="w-8 h-8"></i>
122
  </div>
123
  <h3 class="text-lg font-semibold text-white mb-2">Binary Release</div>
124
  <p class="text-gray-400 text-sm mb-4">Pre-built binaries for quick setup</p>
125
- <a href="#" class="bg-red-500 hover:bg-red-600 px-6 py-3 rounded-xl text-white font-medium transition-colors inline-block">
126
  Download
127
  </a>
128
- </div>
129
  </div>
130
  </div>
131
 
@@ -140,10 +141,13 @@
140
  <span class="text-white font-bold">1</span>
141
  </div>
142
  <h3 class="text-xl font-semibold text-white mb-3">Download the Package</div>
143
- <div class="bg-gray-900 rounded-xl p-4 mb-4">
144
- <code class="text-green-400">curl -L https://codeforge-ai.com/download/docker-compose.yml -o docker-compose.yml</code>
145
- </div>
146
- <p class="text-gray-300">Download the latest Docker Compose configuration file.</p>
 
 
 
147
  </div>
148
 
149
  <!-- Step 2 -->
@@ -155,8 +159,11 @@
155
  <h3 class="text-xl font-semibold text-white mb-3">Configure Environment</div>
156
  <div class="bg-gray-900 rounded-xl p-4 mb-4">
157
  <code class="text-green-400">cp .env.example .env</code>
158
- </div>
159
- <p class="text-gray-300">Copy the environment configuration file and update with your settings.</p>
 
 
 
160
  </div>
161
 
162
  <!-- Step 3 -->
@@ -168,8 +175,11 @@
168
  <h3 class="text-xl font-semibold text-white mb-3">Start Services</div>
169
  <div class="bg-gray-900 rounded-xl p-4 mb-4">
170
  <code class="text-green-400">docker-compose up -d</code>
171
- </div>
172
- <p class="text-gray-300">Launch all CodeForge-AI services in detached mode.</p>
 
 
 
173
  </div>
174
 
175
  <!-- Step 4 -->
@@ -181,8 +191,11 @@
181
  <h3 class="text-xl font-semibold text-white mb-3">Verify Installation</div>
182
  <div class="bg-gray-900 rounded-xl p-4 mb-4">
183
  <code class="text-green-400">docker-compose ps</code>
184
- </div>
185
- <p class="text-gray-300">Check that all services are running correctly.</p>
 
 
 
186
  </div>
187
 
188
  <!-- Step 5 -->
@@ -194,8 +207,11 @@
194
  <h3 class="text-xl font-semibold text-white mb-3">Access Dashboard</div>
195
  <div class="bg-gray-900 rounded-xl p-4 mb-4">
196
  <code class="text-green-400">http://localhost:8080</code>
197
- </div>
198
- <p class="text-gray-300">Open your browser and navigate to the local dashboard.</p>
 
 
 
199
  </div>
200
  </div>
201
 
@@ -301,10 +317,70 @@
301
  <p>&copy; 2024 CodeForge-AI. All rights reserved. Built with security and performance in mind.</p>
302
  </div>
303
  </div>
304
-
305
  <script>
306
  // Initialize Feather Icons
307
  feather.replace();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  </script>
309
  </body>
310
  </html>
 
34
  </div>
35
  <span class="text-xl font-bold text-white">CodeForge-AI</span>
36
  </div>
37
+ <div class="hidden md:flex space-x-6">
38
+ <a href="index.html" class="text-gray-300 hover:text-white transition-colors">Home</a>
39
+ <a href="workspaces.html" class="text-gray-300 hover:text-white transition-colors">Workspaces</a>
40
+ <a href="templates.html" class="text-gray-300 hover:text-white transition-colors">Templates</a>
41
+ <a href="deployments.html" class="text-gray-300 hover:text-white transition-colors">Deployments</a>
42
+ <a href="documentation.html" class="text-gray-300 hover:text-white transition-colors">Documentation</a>
43
+ <a href="installation.html" class="text-red-400 hover:text-red-300 transition-colors">Installation</a>
44
+ <a href="admin-login.html" class="text-gray-300 hover:text-white transition-colors">Admin</a>
45
  </div>
46
+ </div>
47
  <div class="flex items-center space-x-4">
48
  <a href="workspaces.html" class="bg-red-500 hover:bg-red-600 px-4 py-2 rounded-lg text-white font-medium transition-colors">
49
  Start Coding
 
103
  </div>
104
  <h3 class="text-lg font-semibold text-white mb-2">Docker Compose</div>
105
  <p class="text-gray-400 text-sm mb-4">Complete setup with all dependencies</p>
106
+ <a href="#" onclick="downloadPackage('docker-compose')" class="bg-red-500 hover:bg-red-600 px-6 py-3 rounded-xl text-white font-medium transition-colors inline-block">
107
  Download
108
  </a>
109
+ </div>
110
  <div class="text-center">
111
  <div class="w-16 h-16 bg-red-500 rounded-2xl flex items-center justify-center mx-auto mb-4">
112
  <i data-feather="github" class="w-8 h-8"></i>
113
  </div>
114
  <h3 class="text-lg font-semibold text-white mb-2">Source Code</div>
115
  <p class="text-gray-400 text-sm mb-4">Build from source for customization</p>
116
+ <a href="https://github.com/codeforge-ai/codeforge-ai" target="_blank" class="bg-red-500 hover:bg-red-600 px-6 py-3 rounded-xl text-white font-medium transition-colors inline-block">
117
  GitHub
118
  </a>
119
+ </div>
120
  <div class="text-center">
121
  <div class="w-16 h-16 bg-red-500 rounded-2xl flex items-center justify-center mx-auto mb-4">
122
  <i data-feather="package" class="w-8 h-8"></i>
123
  </div>
124
  <h3 class="text-lg font-semibold text-white mb-2">Binary Release</div>
125
  <p class="text-gray-400 text-sm mb-4">Pre-built binaries for quick setup</p>
126
+ <a href="#" onclick="downloadPackage('binary')" class="bg-red-500 hover:bg-red-600 px-6 py-3 rounded-xl text-white font-medium transition-colors inline-block">
127
  Download
128
  </a>
129
+ </div>
130
  </div>
131
  </div>
132
 
 
141
  <span class="text-white font-bold">1</span>
142
  </div>
143
  <h3 class="text-xl font-semibold text-white mb-3">Download the Package</div>
144
+ <div class="bg-gray-900 rounded-xl p-4 mb-4">
145
+ <code class="text-green-400">curl -L https://codeforge-ai.com/download/docker-compose.yml -o docker-compose.yml</code>
146
+ <button onclick="copyToClipboard('curl -L https://codeforge-ai.com/download/docker-compose.yml -o docker-compose.yml')" class="ml-2 bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm text-white transition-colors">
147
+ <i data-feather="copy" class="w-3 h-3 inline"></i> Copy
148
+ </button>
149
+ </div>
150
+ <p class="text-gray-300">Download the latest Docker Compose configuration file.</p>
151
  </div>
152
 
153
  <!-- Step 2 -->
 
159
  <h3 class="text-xl font-semibold text-white mb-3">Configure Environment</div>
160
  <div class="bg-gray-900 rounded-xl p-4 mb-4">
161
  <code class="text-green-400">cp .env.example .env</code>
162
+ <button onclick="copyToClipboard('cp .env.example .env')" class="ml-2 bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm text-white transition-colors">
163
+ <i data-feather="copy" class="w-3 h-3 inline"></i> Copy
164
+ </button>
165
+ </div>
166
+ <p class="text-gray-300">Copy the environment configuration file and update with your settings.</p>
167
  </div>
168
 
169
  <!-- Step 3 -->
 
175
  <h3 class="text-xl font-semibold text-white mb-3">Start Services</div>
176
  <div class="bg-gray-900 rounded-xl p-4 mb-4">
177
  <code class="text-green-400">docker-compose up -d</code>
178
+ <button onclick="copyToClipboard('docker-compose up -d')" class="ml-2 bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm text-white transition-colors">
179
+ <i data-feather="copy" class="w-3 h-3 inline"></i> Copy
180
+ </button>
181
+ </div>
182
+ <p class="text-gray-300">Launch all CodeForge-AI services in detached mode.</p>
183
  </div>
184
 
185
  <!-- Step 4 -->
 
191
  <h3 class="text-xl font-semibold text-white mb-3">Verify Installation</div>
192
  <div class="bg-gray-900 rounded-xl p-4 mb-4">
193
  <code class="text-green-400">docker-compose ps</code>
194
+ <button onclick="copyToClipboard('docker-compose ps')" class="ml-2 bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm text-white transition-colors">
195
+ <i data-feather="copy" class="w-3 h-3 inline"></i> Copy
196
+ </button>
197
+ </div>
198
+ <p class="text-gray-300">Check that all services are running correctly.</p>
199
  </div>
200
 
201
  <!-- Step 5 -->
 
207
  <h3 class="text-xl font-semibold text-white mb-3">Access Dashboard</div>
208
  <div class="bg-gray-900 rounded-xl p-4 mb-4">
209
  <code class="text-green-400">http://localhost:8080</code>
210
+ <button onclick="copyToClipboard('http://localhost:8080')" class="ml-2 bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm text-white transition-colors">
211
+ <i data-feather="copy" class="w-3 h-3 inline"></i> Copy
212
+ </button>
213
+ </div>
214
+ <p class="text-gray-300">Open your browser and navigate to the local dashboard.</p>
215
  </div>
216
  </div>
217
 
 
317
  <p>&copy; 2024 CodeForge-AI. All rights reserved. Built with security and performance in mind.</p>
318
  </div>
319
  </div>
 
320
  <script>
321
  // Initialize Feather Icons
322
  feather.replace();
323
+
324
+ // Copy to clipboard function
325
+ function copyToClipboard(text) {
326
+ navigator.clipboard.writeText(text).then(function() {
327
+ // Show success feedback
328
+ const buttons = document.querySelectorAll('button');
329
+ buttons.forEach(btn => {
330
+ if (btn.textContent.includes('Copy')) {
331
+ const originalText = btn.innerHTML;
332
+ btn.innerHTML = '<i data-feather="check" class="w-3 h-3 inline"></i> Copied!';
333
+ setTimeout(() => {
334
+ btn.innerHTML = originalText;
335
+ feather.replace();
336
+ }, 2000);
337
+ }
338
+ });
339
+ }).catch(function(err) {
340
+ console.error('Failed to copy: ', err);
341
+ alert('Failed to copy to clipboard');
342
+ });
343
+ }
344
+
345
+ // Download package function
346
+ function downloadPackage(type) {
347
+ let url;
348
+ switch(type) {
349
+ case 'docker-compose':
350
+ url = 'https://codeforge-ai.com/download/docker-compose.yml';
351
+ break;
352
+ case 'binary':
353
+ url = 'https://codeforge-ai.com/download/codeforge-ai-latest.zip';
354
+ break;
355
+ default:
356
+ url = '#';
357
+ }
358
+
359
+ if (url !== '#') {
360
+ const link = document.createElement('a');
361
+ link.href = url;
362
+ link.download = '';
363
+ document.body.appendChild(link);
364
+ link.click();
365
+ document.body.removeChild(link);
366
+ } else {
367
+ alert('Download link not available');
368
+ }
369
+ }
370
+
371
+ // Add smooth scrolling for better UX
372
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
373
+ anchor.addEventListener('click', function (e) {
374
+ e.preventDefault();
375
+ const target = document.querySelector(this.getAttribute('href'));
376
+ if (target) {
377
+ target.scrollIntoView({
378
+ behavior: 'smooth',
379
+ block: 'start'
380
+ });
381
+ }
382
+ });
383
+ });
384
  </script>
385
  </body>
386
  </html>