Pervyh commited on
Commit
bcd6226
·
verified ·
1 Parent(s): eac692d

Добавь страницу аутентификации и страницу пользователей - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +369 -10
index.html CHANGED
@@ -149,8 +149,10 @@
149
  </div>
150
  </header>
151
 
152
- <!-- Dashboard Content -->
153
- <div class="p-6">
 
 
154
  <!-- Status Cards -->
155
  <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
156
  <div class="bg-white p-6 rounded-lg shadow">
@@ -396,6 +398,320 @@
396
  </div>
397
  </div>
398
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  </div>
400
  </div>
401
  </div>
@@ -500,21 +816,64 @@
500
 
501
  // Initialize tab switching
502
  const sidebarItems = document.querySelectorAll('.sidebar li');
 
 
 
 
 
 
 
 
 
 
 
 
503
  sidebarItems.forEach(item => {
504
  item.addEventListener('click', function() {
505
  sidebarItems.forEach(i => i.classList.remove('active'));
506
  this.classList.add('active');
507
 
508
- // In a real app, we would load the appropriate content for each tab
509
- const title = this.querySelector('span').textContent;
510
- document.querySelector('header + .p-6').innerHTML = `
511
- <div class="bg-white p-6 rounded-lg shadow text-center">
512
- <h1 class="text-2xl font-bold mb-4">${title}</h1>
513
- <p class="text-gray-600">Content for ${title} would be displayed here</p>
514
- </div>
515
- `;
 
 
 
 
516
  });
517
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  });
519
  </script>
520
  <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=Pervyh/api-manager" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
 
149
  </div>
150
  </header>
151
 
152
+ <!-- Tab Content Container -->
153
+ <div id="tab-content" class="p-6">
154
+ <!-- Dashboard Content -->
155
+ <div id="dashboard-content">
156
  <!-- Status Cards -->
157
  <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
158
  <div class="bg-white p-6 rounded-lg shadow">
 
398
  </div>
399
  </div>
400
  </div>
401
+ </div>
402
+
403
+ <!-- Database Tables Content -->
404
+ <div id="tables-content" class="hidden">
405
+ <div class="p-6">
406
+ <div class="flex justify-between items-center mb-6">
407
+ <h1 class="text-2xl font-bold">Database Tables</h1>
408
+ <button class="px-4 py-2 bg-primary text-white rounded-md hover:bg-secondary">
409
+ Create New Table
410
+ </button>
411
+ </div>
412
+
413
+ <div class="bg-white rounded-lg shadow overflow-hidden mb-8">
414
+ <div class="p-4 border-b flex justify-between items-center">
415
+ <h2 class="text-lg font-semibold">Available Tables</h2>
416
+ <input type="text" placeholder="Search tables..." class="p-2 border rounded-lg w-64">
417
+ </div>
418
+ <div class="overflow-x-auto">
419
+ <table class="min-w-full">
420
+ <thead class="bg-gray-50">
421
+ <tr>
422
+ <th class="py-3 px-4 text-left">Table Name</th>
423
+ <th class="py-3 px-4 text-left">Columns</th>
424
+ <th class="py-3 px-4 text-left">API Endpoint</th>
425
+ <th class="py-3 px-4 text-left">Status</th>
426
+ <th class="py-3 px-4 text-left">Actions</th>
427
+ </tr>
428
+ </thead>
429
+ <tbody class="divide-y">
430
+ <tr>
431
+ <td class="py-3 px-4 font-medium">users</td>
432
+ <td class="py-3 px-4">5</td>
433
+ <td class="py-3 px-4 font-mono">/api/users</td>
434
+ <td class="py-3 px-4">
435
+ <span class="bg-green-100 text-green-800 py-1 px-2 rounded-full text-xs">Active</span>
436
+ </td>
437
+ <td class="py-3 px-4 space-x-2">
438
+ <button class="p-1 text-blue-500 hover:text-blue-700 edit-table-btn" data-table="users">
439
+ <i class="fas fa-edit"></i>
440
+ </button>
441
+ <button class="p-1 text-red-500 hover:text-red-700">
442
+ <i class="fas fa-trash"></i>
443
+ </button>
444
+ </td>
445
+ </tr>
446
+ <tr>
447
+ <td class="py-3 px-4 font-medium">products</td>
448
+ <td class="py-3 px-4">6</td>
449
+ <td class="py-3 px-4 font-mono">/api/products</td>
450
+ <td class="py-3 px-4">
451
+ <span class="bg-green-100 text-green-800 py-1 px-2 rounded-full text-xs">Active</span>
452
+ </td>
453
+ <td class="py-3 px-4 space-x-2">
454
+ <button class="p-1 text-blue-500 hover:text-blue-700 edit-table-btn" data-table="products">
455
+ <i class="fas fa-edit"></i>
456
+ </button>
457
+ <button class="p-1 text-red-500 hover:text-red-700">
458
+ <i class="fas fa-trash"></i>
459
+ </button>
460
+ </td>
461
+ </tr>
462
+ <tr>
463
+ <td class="py-3 px-4 font-medium">orders</td>
464
+ <td class="py-3 px-4">6</td>
465
+ <td class="py-3 px-4 font-mono">/api/orders</td>
466
+ <td class="py-3 px-4">
467
+ <span class="bg-yellow-100 text-yellow-800 py-1 px-2 rounded-full text-xs">Draft</span>
468
+ </td>
469
+ <td class="py-3 px-4 space-x-2">
470
+ <button class="p-1 text-blue-500 hover:text-blue-700 edit-table-btn" data-table="orders">
471
+ <i class="fas fa-edit"></i>
472
+ </button>
473
+ <button class="p-1 text-red-500 hover:text-red-700">
474
+ <i class="fas fa-trash"></i>
475
+ </button>
476
+ </td>
477
+ </tr>
478
+ </tbody>
479
+ </table>
480
+ </div>
481
+ </div>
482
+ </div>
483
+ </div>
484
+
485
+ <div id="api-config-content">
486
+ <!-- API Configuration Content -->
487
+ <div id="api-config-content" >
488
+ <div class="p-6">
489
+ <h1 class="text-2xl font-bold mb-6">API Configuration</h1>
490
+
491
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
492
+ <!-- Global Settings -->
493
+ <div class="bg-gray-50 p-6 rounded-lg">
494
+ <h2 class="text-lg font-semibold mb-4 border-b pb-2">Global Settings</h2>
495
+ <div class="space-y-4">
496
+ <div>
497
+ <label class="block text-sm font-medium text-gray-700 mb-1">Base Path</label>
498
+ <input type="text" value="/api" class="w-full p-2 border rounded focus:ring-2 focus:ring-primary focus:border-transparent">
499
+ <p class="text-xs text-gray-500 mt-1">The base path for all API endpoints</p>
500
+ </div>
501
+ <div>
502
+ <label class="block text-sm font-medium text-gray-700 mb-1">Default Limit</label>
503
+ <input type="number" value="100" class="w-full p-2 border rounded focus:ring-2 focus:ring-primary focus:border-transparent">
504
+ <p class="text-xs text-gray-500 mt-1">Default number of items returned per request</p>
505
+ </div>
506
+ <div class="flex items-center">
507
+ <input type="checkbox" id="enable-caching" class="h-4 w-4 text-primary focus:ring-primary border-gray-300 rounded" checked>
508
+ <label for="enable-caching" class="ml-2 block text-sm text-gray-700">Enable Response Caching</label>
509
+ </div>
510
+ <div>
511
+ <label class="block text-sm font-medium text-gray-700 mb-1">Cache Duration (seconds)</label>
512
+ <input type="number" value="300" class="w-full p-2 border rounded focus:ring-2 focus:ring-primary focus:border-transparent">
513
+ </div>
514
+ </div>
515
+ </div>
516
+
517
+ <!-- Security Settings -->
518
+ <div class="bg-gray-50 p-6 rounded-lg">
519
+ <h2 class="text-lg font-semibold mb-4 border-b pb-2">Security Settings</h2>
520
+ <div class="space-y-4">
521
+ <div>
522
+ <label class="block text-sm font-medium text-gray-700 mb-1">Authentication Method</label>
523
+ <select class="w-full p-2 border rounded focus:ring-2 focus:ring-primary focus:border-transparent">
524
+ <option>JWT</option>
525
+ <option>API Key</option>
526
+ <option>OAuth 2.0</option>
527
+ <option>Basic Auth</option>
528
+ <option>None</option>
529
+ </select>
530
+ </div>
531
+ <div>
532
+ <label class="block text-sm font-medium text-gray-700 mb-1">CORS Origins</label>
533
+ <input type="text" value="*" class="w-full p-2 border rounded focus:ring-2 focus:ring-primary focus:border-transparent">
534
+ <p class="text-xs text-gray-500 mt-1">Comma-separated list of allowed origins</p>
535
+ </div>
536
+ <div class="flex items-center">
537
+ <input type="checkbox" id="enable-https" class="h-4 w-4 text-primary focus:ring-primary border-gray-300 rounded" checked>
538
+ <label for="enable-https" class="ml-2 block text-sm text-gray-700">Require HTTPS</label>
539
+ </div>
540
+ <div class="flex items-center">
541
+ <input type="checkbox" id="enable-rate-limiting" class="h-4 w-4 text-primary focus:ring-primary border-gray-300 rounded" checked>
542
+ <label for="enable-rate-limiting" class="ml-2 block text-sm text-gray-700">Enable Rate Limiting</label>
543
+ </div>
544
+ <div>
545
+ <label class="block text-sm font-medium text-gray-700 mb-1">Rate Limit (requests/minute)</label>
546
+ <input type="number" value="1000" class="w-full p-2 border rounded focus:ring-2 focus:ring-primary focus:border-transparent">
547
+ </div>
548
+ </div>
549
+ </div>
550
+
551
+ <!-- Logging Settings -->
552
+ <div class="bg-gray-50 p-6 rounded-lg">
553
+ <h2 class="text-lg font-semibold mb-4 border-b pb-2">Logging & Monitoring</h2>
554
+ <div class="space-y-4">
555
+ <div class="flex items-center">
556
+ <input type="checkbox" id="enable-request-logging" class="h-4 w-4 text-primary focus:ring-primary border-gray-300 rounded" checked>
557
+ <label for="enable-request-logging" class="ml-2 block text-sm text-gray-700">Enable Request Logging</label>
558
+ </div>
559
+ <div class="flex items-center">
560
+ <input type="checkbox" id="enable-error-logging" class="h-4 w-4 text-primary focus:ring-primary border-gray-300 rounded" checked>
561
+ <label for="enable-error-logging" class="ml-2 block text-sm text-gray-700">Enable Error Logging</label>
562
+ </div>
563
+ <div>
564
+ <label class="block text-sm font-medium text-gray-700 mb-1">Log Retention (days)</label>
565
+ <input type="number" value="30" class="w-full p-2 border rounded focus:ring-2 focus:ring-primary focus:border-transparent">
566
+ </div>
567
+ </div>
568
+ </div>
569
+
570
+ <!-- Response Settings -->
571
+ <div class="bg-gray-50 p-6 rounded-lg">
572
+ <h2 class="text-lg font-semibold mb-4 border-b pb-2">Response Settings</h2>
573
+ <div class="space-y-4">
574
+ <div class="flex items-center">
575
+ <input type="checkbox" id="enable-pretty-print" class="h-4 w-4 text-primary focus:ring-primary border-gray-300 rounded" checked>
576
+ <label for="enable-pretty-print" class="ml-2 block text-sm text-gray-700">Pretty Print JSON</label>
577
+ </div>
578
+ <div class="flex items-center">
579
+ <input type="checkbox" id="include-timestamps" class="h-4 w-4 text-primary focus:ring-primary border-gray-300 rounded">
580
+ <label for="include-timestamps" class="ml-2 block text-sm text-gray-700">Include Timestamps</label>
581
+ </div>
582
+ <div>
583
+ <label class="block text-sm font-medium text-gray-700 mb-1">Default Response Format</label>
584
+ <select class="w-full p-2 border rounded focus:ring-2 focus:ring-primary focus:border-transparent">
585
+ <option>JSON</option>
586
+ <option>XML</option>
587
+ </select>
588
+ </div>
589
+ </div>
590
+ </div>
591
+ </div>
592
+
593
+ <div class="mt-8 flex justify-end space-x-4">
594
+ <button class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 bg-white hover:bg-gray-50">
595
+ Reset to Defaults
596
+ </button>
597
+ <button class="px-4 py-2 bg-primary text-white rounded-md hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary">
598
+ Save Changes
599
+ </button>
600
+ </div>
601
+ </div>
602
+ </div>
603
+ </div>
604
+ </div>
605
+ </div>
606
+
607
+ <!-- Edit Table Modal -->
608
+ <div id="edit-table-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
609
+ <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl">
610
+ <div class="p-4 border-b flex justify-between items-center">
611
+ <h3 class="text-lg font-semibold">Edit Table: <span id="edit-table-name"></span></h3>
612
+ <button id="close-edit-modal" class="text-gray-500 hover:text-gray-700">
613
+ <i class="fas fa-times"></i>
614
+ </button>
615
+ </div>
616
+ <div class="p-6">
617
+ <div class="mb-6">
618
+ <h4 class="font-medium mb-3">Table Settings</h4>
619
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
620
+ <div>
621
+ <label class="block text-sm font-medium text-gray-700 mb-1">Table Name</label>
622
+ <input type="text" class="w-full p-2 border rounded" value="users">
623
+ </div>
624
+ <div>
625
+ <label class="block text-sm font-medium text-gray-700 mb-1">API Endpoint</label>
626
+ <input type="text" class="w-full p-2 border rounded" value="/api/users">
627
+ </div>
628
+ <div>
629
+ <label class="block text-sm font-medium text-gray-700 mb-1">Status</label>
630
+ <select class="w-full p-2 border rounded">
631
+ <option>Active</option>
632
+ <option>Draft</option>
633
+ <option>Disabled</option>
634
+ </select>
635
+ </div>
636
+ </div>
637
+ </div>
638
+
639
+ <div class="mb-6">
640
+ <div class="flex justify-between items-center mb-3">
641
+ <h4 class="font-medium">Columns</h4>
642
+ <button class="text-sm text-primary hover:text-secondary">
643
+ <i class="fas fa-plus mr-1"></i> Add Column
644
+ </button>
645
+ </div>
646
+ <div class="overflow-x-auto">
647
+ <table class="min-w-full">
648
+ <thead class="bg-gray-50">
649
+ <tr>
650
+ <th class="py-2 px-3 text-left">Name</th>
651
+ <th class="py-2 px-3 text-left">Type</th>
652
+ <th class="py-2 px-3 text-left">Nullable</th>
653
+ <th class="py-2 px-3 text-left">Default</th>
654
+ <th class="py-2 px-3 text-left">Actions</th>
655
+ </tr>
656
+ </thead>
657
+ <tbody class="divide-y">
658
+ <tr>
659
+ <td class="py-2 px-3"><input type="text" class="p-1 border rounded w-full" value="id"></td>
660
+ <td class="py-2 px-3">
661
+ <select class="p-1 border rounded w-full">
662
+ <option>integer</option>
663
+ <option selected>serial</option>
664
+ <option>varchar</option>
665
+ <option>text</option>
666
+ <option>boolean</option>
667
+ <option>timestamp</option>
668
+ </select>
669
+ </td>
670
+ <td class="py-2 px-3">
671
+ <input type="checkbox" class="h-4 w-4" checked>
672
+ </td>
673
+ <td class="py-2 px-3"><input type="text" class="p-1 border rounded w-full" placeholder="None"></td>
674
+ <td class="py-2 px-3">
675
+ <button class="text-red-500 hover:text-red-700">
676
+ <i class="fas fa-trash"></i>
677
+ </button>
678
+ </td>
679
+ </tr>
680
+ <tr>
681
+ <td class="py-2 px-3"><input type="text" class="p-1 border rounded w-full" value="username"></td>
682
+ <td class="py-2 px-3">
683
+ <select class="p-1 border rounded w-full">
684
+ <option>integer</option>
685
+ <option>serial</option>
686
+ <option selected>varchar(50)</option>
687
+ <option>text</option>
688
+ <option>boolean</option>
689
+ <option>timestamp</option>
690
+ </select>
691
+ </td>
692
+ <td class="py-2 px-3">
693
+ <input type="checkbox" class="h-4 w-4">
694
+ </td>
695
+ <td class="py-2 px-3"><input type="text" class="p-1 border rounded w-full" placeholder="None"></td>
696
+ <td class="py-2 px-3">
697
+ <button class="text-red-500 hover:text-red-700">
698
+ <i class="fas fa-trash"></i>
699
+ </button>
700
+ </td>
701
+ </tr>
702
+ </tbody>
703
+ </table>
704
+ </div>
705
+ </div>
706
+
707
+ <div class="flex justify-end space-x-3">
708
+ <button class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 bg-white hover:bg-gray-50">
709
+ Cancel
710
+ </button>
711
+ <button class="px-4 py-2 bg-primary text-white rounded-md hover:bg-secondary">
712
+ Save Changes
713
+ </button>
714
+ </div>
715
  </div>
716
  </div>
717
  </div>
 
816
 
817
  // Initialize tab switching
818
  const sidebarItems = document.querySelectorAll('.sidebar li');
819
+ const tabContents = {
820
+ 'Dashboard': 'dashboard-content',
821
+ 'Database Tables': 'tables-content',
822
+ 'API Configuration': 'api-config-content',
823
+ 'Authentication': 'auth-content',
824
+ 'API Documentation': 'docs-content',
825
+ 'Request Logs': 'logs-content',
826
+ 'API Keys': 'keys-content',
827
+ 'Users': 'users-content',
828
+ 'Settings': 'settings-content'
829
+ };
830
+
831
  sidebarItems.forEach(item => {
832
  item.addEventListener('click', function() {
833
  sidebarItems.forEach(i => i.classList.remove('active'));
834
  this.classList.add('active');
835
 
836
+ const tabName = this.querySelector('span').textContent;
837
+ const contentId = tabContents[tabName];
838
+
839
+ // Hide all content
840
+ document.querySelectorAll('#tab-content > div').forEach(div => {
841
+ div.classList.add('hidden');
842
+ });
843
+
844
+ // Show selected content
845
+ if (contentId) {
846
+ document.getElementById(contentId).classList.remove('hidden');
847
+ }
848
  });
849
  });
850
+
851
+ // Initialize with dashboard visible
852
+ document.getElementById('dashboard-content').classList.remove('hidden');
853
+
854
+ // Table edit modal handling
855
+ const editModal = document.getElementById('edit-table-modal');
856
+ const editTableName = document.getElementById('edit-table-name');
857
+ const closeEditModal = document.getElementById('close-edit-modal');
858
+
859
+ document.querySelectorAll('.edit-table-btn').forEach(btn => {
860
+ btn.addEventListener('click', function() {
861
+ const tableName = this.getAttribute('data-table');
862
+ editTableName.textContent = tableName;
863
+ editModal.classList.remove('hidden');
864
+ });
865
+ });
866
+
867
+ closeEditModal.addEventListener('click', function() {
868
+ editModal.classList.add('hidden');
869
+ });
870
+
871
+ // Close modal when clicking outside
872
+ editModal.addEventListener('click', function(e) {
873
+ if (e.target === editModal) {
874
+ editModal.classList.add('hidden');
875
+ }
876
+ });
877
  });
878
  </script>
879
  <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=Pervyh/api-manager" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>