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

Разработай полноценную систему для автоматического создания REST API к базе данных PostgreSQL со следующими возможностями: Основные требования Интерфейс управления API Веб-интерфейс для настройки и управления API Возможность выбора конкретных таблиц базы данных для экспозиции через API Визуальное отображение структуры таблиц и связей между ними Функциональность API Только операции чтения (GET-запросы) Поддержка фильтрации данных по различным полям Возможность сортировки и пагинации результатов Поддержка базовых агрегатных функций (COUNT, SUM, AVG) Система авторизации Механизм аутентификации пользователей (JWT или OAuth 2.0) Разграничение доступа к разным таблицам для разных пользователей Управление API-ключами и их ограничениями Техническая реализация Автоматическая генерация документации API (Swagger/OpenAPI) Журналирование запросов для мониторинга и отладки Защита от SQL-инъекций и других атак Кэширование часто запрашиваемых данных Система должна быть простой в использовании даже для пользователей без глубоких технических знаний, но достаточно гибкой для продвинутых сценариев использования. - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +521 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Api Manager
3
- emoji: 🚀
4
- colorFrom: yellow
5
- colorTo: pink
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: api-manager
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: blue
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,521 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>REST API Manager for PostgreSQL</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <script>
10
+ tailwind.config = {
11
+ theme: {
12
+ extend: {
13
+ colors: {
14
+ primary: '#4361ee',
15
+ secondary: '#3f37c9',
16
+ dark: '#1e293b',
17
+ success: '#10b981',
18
+ warning: '#f59e0b',
19
+ danger: '#ef4444',
20
+ info: '#3b82f6'
21
+ }
22
+ }
23
+ }
24
+ }
25
+ </script>
26
+ <style>
27
+ :root {
28
+ --sidebar-width: 250px;
29
+ }
30
+
31
+ .sidebar {
32
+ width: var(--sidebar-width);
33
+ transition: all 0.3s;
34
+ }
35
+
36
+ .main-content {
37
+ margin-left: var(--sidebar-width);
38
+ transition: all 0.3s;
39
+ }
40
+
41
+ .collapsed .sidebar {
42
+ width: 60px;
43
+ }
44
+
45
+ .collapsed .main-content {
46
+ margin-left: 60px;
47
+ }
48
+
49
+ .table-view {
50
+ max-height: calc(100vh - 200px);
51
+ overflow-y: auto;
52
+ }
53
+
54
+ .api-method {
55
+ width: 80px;
56
+ }
57
+
58
+ .draggable-item {
59
+ cursor: move;
60
+ }
61
+
62
+ .swagger-ui {
63
+ max-height: calc(100vh - 150px);
64
+ overflow-y: auto;
65
+ }
66
+
67
+ @media (max-width: 768px) {
68
+ .sidebar {
69
+ width: 60px;
70
+ }
71
+ .main-content {
72
+ margin-left: 60px;
73
+ }
74
+ .collapsed .sidebar {
75
+ width: 0;
76
+ }
77
+ .collapsed .main-content {
78
+ margin-left: 0;
79
+ }
80
+ }
81
+ </style>
82
+ </head>
83
+ <body class="bg-gray-100">
84
+ <div id="app" class="min-h-screen flex">
85
+ <!-- Sidebar -->
86
+ <div class="sidebar bg-dark text-white fixed h-screen overflow-y-auto z-30">
87
+ <div class="p-4 border-b border-gray-700 flex items-center">
88
+ <i class="fas fa-database text-xl mr-3 text-primary"></i>
89
+ <span class="font-bold text-lg">API Manager</span>
90
+ </div>
91
+ <ul class="mt-5">
92
+ <li class="py-3 px-4 hover:bg-gray-700 cursor-pointer flex items-center active">
93
+ <i class="fas fa-tachometer-alt mr-3"></i>
94
+ <span>Dashboard</span>
95
+ </li>
96
+ <li class="py-3 px-4 hover:bg-gray-700 cursor-pointer flex items-center">
97
+ <i class="fas fa-table mr-3"></i>
98
+ <span>Database Tables</span>
99
+ </li>
100
+ <li class="py-3 px-4 hover:bg-gray-700 cursor-pointer flex items-center">
101
+ <i class="fas fa-wrench mr-3"></i>
102
+ <span>API Configuration</span>
103
+ </li>
104
+ <li class="py-3 px-4 hover:bg-gray-700 cursor-pointer flex items-center">
105
+ <i class="fas fa-shield-alt mr-3"></i>
106
+ <span>Authentication</span>
107
+ </li>
108
+ <li class="py-3 px-4 hover:bg-gray-700 cursor-pointer flex items-center">
109
+ <i class="fas fa-book mr-3"></i>
110
+ <span>API Documentation</span>
111
+ </li>
112
+ <li class="py-3 px-4 hover:bg-gray-700 cursor-pointer flex items-center">
113
+ <i class="fas fa-history mr-3"></i>
114
+ <span>Request Logs</span>
115
+ </li>
116
+ <li class="py-3 px-4 hover:bg-gray-700 cursor-pointer flex items-center">
117
+ <i class="fas fa-key mr-3"></i>
118
+ <span>API Keys</span>
119
+ </li>
120
+ <li class="py-3 px-4 hover:bg-gray-700 cursor-pointer flex items-center">
121
+ <i class="fas fa-users mr-3"></i>
122
+ <span>Users</span>
123
+ </li>
124
+ <li class="py-3 px-4 hover:bg-gray-700 cursor-pointer flex items-center">
125
+ <i class="fas fa-cog mr-3"></i>
126
+ <span>Settings</span>
127
+ </li>
128
+ </ul>
129
+ </div>
130
+
131
+ <!-- Main Content -->
132
+ <div class="main-content flex-1">
133
+ <!-- Header -->
134
+ <header class="bg-white shadow py-4 px-6 flex justify-between items-center">
135
+ <div>
136
+ <button class="p-2 rounded-md hover:bg-gray-200 text-dark">
137
+ <i class="fas fa-bars text-xl"></i>
138
+ </button>
139
+ </div>
140
+ <div class="flex items-center">
141
+ <div class="relative mr-4">
142
+ <i class="fas fa-bell text-xl text-gray-600"></i>
143
+ <span class="absolute -top-1 -right-1 bg-danger text-white rounded-full text-xs w-5 h-5 flex items-center justify-center">3</span>
144
+ </div>
145
+ <div class="flex items-center">
146
+ <img src="https://ui-avatars.com/api/?name=Admin&background=4361ee&color=fff" alt="Admin" class="w-8 h-8 rounded-full mr-2">
147
+ <span class="hidden md:block">Admin</span>
148
+ </div>
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">
157
+ <div class="flex justify-between">
158
+ <div>
159
+ <p class="text-gray-500">Active APIs</p>
160
+ <p class="text-2xl font-bold mt-2">14</p>
161
+ </div>
162
+ <div class="bg-blue-100 w-12 h-12 rounded-full flex items-center justify-center">
163
+ <i class="fas fa-plug text-blue-600 text-xl"></i>
164
+ </div>
165
+ </div>
166
+ </div>
167
+ <div class="bg-white p-6 rounded-lg shadow">
168
+ <div class="flex justify-between">
169
+ <div>
170
+ <p class="text-gray-500">Monthly Requests</p>
171
+ <p class="text-2xl font-bold mt-2">48.2K</p>
172
+ </div>
173
+ <div class="bg-green-100 w-12 h-12 rounded-full flex items-center justify-center">
174
+ <i class="fas fa-chart-line text-green-600 text-xl"></i>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ <div class="bg-white p-6 rounded-lg shadow">
179
+ <div class="flex justify-between">
180
+ <div>
181
+ <p class="text-gray-500">API Users</p>
182
+ <p class="text-2xl font-bold mt-2">26</p>
183
+ </div>
184
+ <div class="bg-purple-100 w-12 h-12 rounded-full flex items-center justify-center">
185
+ <i class="fas fa-users text-purple-600 text-xl"></i>
186
+ </div>
187
+ </div>
188
+ </div>
189
+ <div class="bg-white p-6 rounded-lg shadow">
190
+ <div class="flex justify-between">
191
+ <div>
192
+ <p class="text-gray-500">Errors</p>
193
+ <p class="text-2xl font-bold mt-2">12</p>
194
+ </div>
195
+ <div class="bg-red-100 w-12 h-12 rounded-full flex items-center justify-center">
196
+ <i class="fas fa-exclamation-triangle text-red-600 text-xl"></i>
197
+ </div>
198
+ </div>
199
+ </div>
200
+ </div>
201
+
202
+ <!-- API Endpoints -->
203
+ <div class="bg-white rounded-lg shadow mb-8">
204
+ <div class="p-4 border-b">
205
+ <h2 class="text-lg font-semibold">API Endpoints</h2>
206
+ </div>
207
+ <div class="p-4">
208
+ <div class="mb-4">
209
+ <input type="text" placeholder="Search endpoints..." class="w-full p-3 border rounded-lg">
210
+ </div>
211
+
212
+ <div class="overflow-x-auto">
213
+ <table class="min-w-full">
214
+ <thead class="bg-gray-50">
215
+ <tr>
216
+ <th class="py-3 px-4 text-left">Method</th>
217
+ <th class="py-3 px-4 text-left">Endpoint</th>
218
+ <th class="py-3 px-4 text-left">Description</th>
219
+ <th class="py-3 px-4 text-left">Status</th>
220
+ <th class="py-3 px-4 text-left">Actions</th>
221
+ </tr>
222
+ </thead>
223
+ <tbody class="divide-y">
224
+ <tr>
225
+ <td class="py-3 px-4">
226
+ <span class="api-method bg-green-100 text-green-800 py-1 px-2 rounded text-sm">GET</span>
227
+ </td>
228
+ <td class="py-3 px-4 font-mono">/api/users</td>
229
+ <td class="py-3 px-4">Retrieve all users</td>
230
+ <td class="py-3 px-4">
231
+ <span class="bg-green-100 text-green-800 py-1 px-2 rounded-full text-xs">Active</span>
232
+ </td>
233
+ <td class="py-3 px-4">
234
+ <button class="p-1 text-blue-500 hover:text-blue-700">
235
+ <i class="fas fa-edit"></i>
236
+ </button>
237
+ <button class="p-1 text-red-500 hover:text-red-700">
238
+ <i class="fas fa-trash"></i>
239
+ </button>
240
+ </td>
241
+ </tr>
242
+ <tr>
243
+ <td class="py-3 px-4">
244
+ <span class="api-method bg-green-100 text-green-800 py-1 px-2 rounded text-sm">GET</span>
245
+ </td>
246
+ <td class="py-3 px-4 font-mono">/api/products</td>
247
+ <td class="py-3 px-4">Retrieve all products</td>
248
+ <td class="py-3 px-4">
249
+ <span class="bg-green-100 text-green-800 py-1 px-2 rounded-full text-xs">Active</span>
250
+ </td>
251
+ <td class="py-3 px-4">
252
+ <button class="p-1 text-blue-500 hover:text-blue-700">
253
+ <i class="fas fa-edit"></i>
254
+ </button>
255
+ <button class="p-1 text-red-500 hover:text-red-700">
256
+ <i class="fas fa-trash"></i>
257
+ </button>
258
+ </td>
259
+ </tr>
260
+ <tr>
261
+ <td class="py-3 px-4">
262
+ <span class="api-method bg-green-100 text-green-800 py-1 px-2 rounded text-sm">GET</span>
263
+ </td>
264
+ <td class="py-3 px-4 font-mono">/api/orders</td>
265
+ <td class="py-3 px-4">Retrieve all orders</td>
266
+ <td class="py-3 px-4">
267
+ <span class="bg-green-100 text-green-800 py-1 px-2 rounded-full text-xs">Active</span>
268
+ </td>
269
+ <td class="py-3 px-4">
270
+ <button class="p-1 text-blue-500 hover:text-blue-700">
271
+ <i class="fas fa-edit"></i>
272
+ </button>
273
+ <button class="p-1 text-red-500 hover:text-red-700">
274
+ <i class="fas fa-trash"></i>
275
+ </button>
276
+ </td>
277
+ </tr>
278
+ <tr>
279
+ <td class="py-3 px-4">
280
+ <span class="api-method bg-blue-100 text-blue-800 py-1 px-2 rounded text-sm">GET</span>
281
+ </td>
282
+ <td class="py-3 px-4 font-mono">/api/orders/{id}</td>
283
+ <td class="py-3 px-4">Retrieve order details</td>
284
+ <td class="py-3 px-4">
285
+ <span class="bg-yellow-100 text-yellow-800 py-1 px-2 rounded-full text-xs">Draft</span>
286
+ </td>
287
+ <td class="py-3 px-4">
288
+ <button class="p-1 text-blue-500 hover:text-blue-700">
289
+ <i class="fas fa-edit"></i>
290
+ </button>
291
+ <button class="p-1 text-red-500 hover:text-red-700">
292
+ <i class="fas fa-trash"></i>
293
+ </button>
294
+ </td>
295
+ </tr>
296
+ </tbody>
297
+ </table>
298
+ </div>
299
+ </div>
300
+ </div>
301
+
302
+ <!-- Recent Activity -->
303
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
304
+ <div class="bg-white rounded-lg shadow">
305
+ <div class="p-4 border-b">
306
+ <h2 class="text-lg font-semibold">Recent Activity</h2>
307
+ </div>
308
+ <div class="p-4">
309
+ <div class="space-y-4">
310
+ <div class="flex items-start">
311
+ <div class="bg-blue-100 p-2 rounded-full mr-3">
312
+ <i class="fas fa-plus text-blue-600"></i>
313
+ </div>
314
+ <div class="flex-1">
315
+ <p class="font-medium">New endpoint created</p>
316
+ <p class="text-gray-600 text-sm">/api/products endpoint was added</p>
317
+ <p class="text-gray-400 text-xs">2 hours ago</p>
318
+ </div>
319
+ </div>
320
+ <div class="flex items-start">
321
+ <div class="bg-green-100 p-2 rounded-full mr-3">
322
+ <i class="fas fa-check text-green-600"></i>
323
+ </div>
324
+ <div class="flex-1">
325
+ <p class="font-medium">Endpoint activated</p>
326
+ <p class="text-gray-600 text-sm">/api/users endpoint is now active</p>
327
+ <p class="text-gray-400 text-xs">5 hours ago</p>
328
+ </div>
329
+ </div>
330
+ <div class="flex items-start">
331
+ <div class="bg-red-100 p-2 rounded-full mr-3">
332
+ <i class="fas fa-exclamation text-red-600"></i>
333
+ </div>
334
+ <div class="flex-1">
335
+ <p class="font-medium">High traffic detected</p>
336
+ <p class="text-gray-600 text-sm">/api/orders received 1240 requests in last hour</p>
337
+ <p class="text-gray-400 text-xs">Yesterday</p>
338
+ </div>
339
+ </div>
340
+ <div class="flex items-start">
341
+ <div class="bg-yellow-100 p-2 rounded-full mr-3">
342
+ <i class="fas fa-cog text-yellow-600"></i>
343
+ </div>
344
+ <div class="flex-1">
345
+ <p class="font-medium">Configuration updated</p>
346
+ <p class="text-gray-600 text-sm">Caching settings for products were modified</p>
347
+ <p class="text-gray-400 text-xs">2 days ago</p>
348
+ </div>
349
+ </div>
350
+ </div>
351
+ </div>
352
+ </div>
353
+
354
+ <!-- API Performance -->
355
+ <div class="bg-white rounded-lg shadow">
356
+ <div class="p-4 border-b">
357
+ <h2 class="text-lg font-semibold">API Performance</h2>
358
+ </div>
359
+ <div class="p-4">
360
+ <div class="flex items-center justify-between mb-4">
361
+ <p>Response Times (ms)</p>
362
+ <div class="flex">
363
+ <button class="text-xs px-2 py-1 bg-gray-100 rounded-l">24h</button>
364
+ <button class="text-xs px-2 py-1 bg-primary text-white rounded-r">7d</button>
365
+ </div>
366
+ </div>
367
+ <div class="h-48 bg-gray-100 rounded flex items-center justify-center mb-4">
368
+ <div class="text-center">
369
+ <i class="fas fa-chart-bar text-4xl text-gray-300 mb-2"></i>
370
+ <p class="text-gray-500">Performance chart</p>
371
+ </div>
372
+ </div>
373
+ <div class="space-y-2">
374
+ <div class="flex justify-between">
375
+ <div>
376
+ <span class="inline-block w-3 h-3 bg-primary rounded-full mr-2"></span>
377
+ <span>Average Response</span>
378
+ </div>
379
+ <span>142 ms</span>
380
+ </div>
381
+ <div class="flex justify-between">
382
+ <div>
383
+ <span class="inline-block w-3 h-3 bg-success rounded-full mr-2"></span>
384
+ <span>Success Rate</span>
385
+ </div>
386
+ <span>98.4%</span>
387
+ </div>
388
+ <div class="flex justify-between">
389
+ <div>
390
+ <span class="inline-block w-3 h-3 bg-danger rounded-full mr-2"></span>
391
+ <span>Error Rate</span>
392
+ </div>
393
+ <span>1.6%</span>
394
+ </div>
395
+ </div>
396
+ </div>
397
+ </div>
398
+ </div>
399
+ </div>
400
+ </div>
401
+ </div>
402
+
403
+ <script>
404
+ // Mock database tables for demonstration
405
+ const databaseTables = [
406
+ {
407
+ name: 'users',
408
+ columns: [
409
+ {name: 'id', type: 'integer', primaryKey: true},
410
+ {name: 'username', type: 'varchar(50)'},
411
+ {name: 'email', type: 'varchar(100)'},
412
+ {name: 'created_at', type: 'timestamp'},
413
+ {name: 'role', type: 'varchar(20)'}
414
+ ],
415
+ endpoint: '/api/users',
416
+ status: 'active'
417
+ },
418
+ {
419
+ name: 'products',
420
+ columns: [
421
+ {name: 'id', type: 'integer', primaryKey: true},
422
+ {name: 'name', type: 'varchar(255)'},
423
+ {name: 'price', type: 'numeric(10,2)'},
424
+ {name: 'category', type: 'varchar(50)'},
425
+ {name: 'stock', type: 'integer'},
426
+ {name: 'created_at', type: 'timestamp'}
427
+ ],
428
+ endpoint: '/api/products',
429
+ status: 'active'
430
+ },
431
+ {
432
+ name: 'orders',
433
+ columns: [
434
+ {name: 'id', type: 'integer', primaryKey: true},
435
+ {name: 'user_id', type: 'integer', foreignKey: 'users.id'},
436
+ {name: 'product_id', type: 'integer', foreignKey: 'products.id'},
437
+ {name: 'quantity', type: 'integer'},
438
+ {name: 'total_price', type: 'numeric(10,2)'},
439
+ {name: 'created_at', type: 'timestamp'}
440
+ ],
441
+ endpoint: '/api/orders',
442
+ status: 'draft'
443
+ }
444
+ ];
445
+
446
+ // Mock API endpoints
447
+ const apiEndpoints = [
448
+ {
449
+ method: 'GET',
450
+ path: '/api/users',
451
+ description: 'Retrieve all users',
452
+ status: 'active',
453
+ filters: ['id', 'username', 'email', 'role'],
454
+ sorting: ['id', 'username', 'created_at'],
455
+ authentication: 'JWT'
456
+ },
457
+ {
458
+ method: 'GET',
459
+ path: '/api/products',
460
+ description: 'Retrieve all products',
461
+ status: 'active',
462
+ filters: ['id', 'name', 'category', 'price'],
463
+ sorting: ['id', 'name', 'price'],
464
+ authentication: 'API Key'
465
+ },
466
+ {
467
+ method: 'GET',
468
+ path: '/api/orders',
469
+ description: 'Retrieve all orders',
470
+ status: 'draft',
471
+ filters: ['id', 'user_id', 'product_id'],
472
+ sorting: ['id', 'created_at'],
473
+ authentication: 'JWT'
474
+ }
475
+ ];
476
+
477
+ // Mock users for demonstration
478
+ const users = [
479
+ {id: 1, username: 'admin', role: 'Administrator', email: 'admin@company.com', createdAt: '2023-05-12'},
480
+ {id: 2, username: 'manager', role: 'Manager', email: 'manager@company.com', createdAt: '2023-06-01'},
481
+ {id: 3, username: 'developer', role: 'Developer', email: 'dev@company.com', createdAt: '2023-07-15'},
482
+ {id: 4, username: 'client1', role: 'Client', email: 'client1@business.com', createdAt: '2023-08-20'},
483
+ ];
484
+
485
+ // Mock API keys
486
+ const apiKeys = [
487
+ {id: 1, key: 'a1b2c3d4e5f6', name: 'Mobile App', status: 'active', rateLimit: 1000, permissions: ['read:users', 'read:products']},
488
+ {id: 2, key: 'x7y8z9abcdef', name: 'Web Dashboard', status: 'active', rateLimit: 5000, permissions: ['read:all']},
489
+ {id: 3, key: 'ghijklmnopqr', name: 'Internal Script', status: 'inactive', rateLimit: 100, permissions: ['read:orders']},
490
+ ];
491
+
492
+ // Initialize sidebar toggling
493
+ document.addEventListener('DOMContentLoaded', function() {
494
+ const sidebarToggle = document.querySelector('header button');
495
+ const app = document.getElementById('app');
496
+
497
+ sidebarToggle.addEventListener('click', function() {
498
+ app.classList.toggle('collapsed');
499
+ });
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>
521
+ </html>