File size: 15,414 Bytes
b25c766
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Dashboard - CraftyHost</title>
    <link rel="stylesheet" href="style.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body class="bg-gray-900 text-white">
    <custom-navbar></custom-navbar>
    
    <main class="container mx-auto px-4 py-8">
        <div class="flex items-center justify-between mb-8">
            <h1 class="text-2xl md:text-3xl font-bold">Admin Dashboard</h1>
            <div class="text-sm text-gray-400">
                Last updated: <span id="last-updated">Just now</span>
            </div>
        </div>
        
        <!-- Stats Overview -->
        <div class="grid md:grid-cols-4 gap-6 mb-8">
            <div class="bg-gray-800 rounded-xl p-6">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-400 text-sm">Total Users</p>
                        <p class="text-3xl font-bold">1,284</p>
                    </div>
                    <i data-feather="users" class="w-10 h-10 text-blue-500"></i>
                </div>
                <div class="mt-4">
                    <p class="text-sm text-green-500 flex items-center">
                        <i data-feather="trending-up" class="w-4 h-4 mr-1"></i>
                        +12.5% from last month
                    </p>
                </div>
            </div>
            
            <div class="bg-gray-800 rounded-xl p-6">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-400 text-sm">Active Servers</p>
                        <p class="text-3xl font-bold">892</p>
                    </div>
                    <i data-feather="server" class="w-10 h-10 text-emerald-500"></i>
                </div>
                <div class="mt-4">
                    <p class="text-sm text-green-500 flex items-center">
                        <i data-feather="trending-up" class="w-4 h-4 mr-1"></i>
                        +8.3% from last month
                    </p>
                </div>
            </div>
            
            <div class="bg-gray-800 rounded-xl p-6">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-400 text-sm">Monthly Revenue</p>
                        <p class="text-3xl font-bold">$12,845</p>
                    </div>
                    <i data-feather="dollar-sign" class="w-10 h-10 text-purple-500"></i>
                </div>
                <div class="mt-4">
                    <p class="text-sm text-green-500 flex items-center">
                        <i data-feather="trending-up" class="w-4 h-4 mr-1"></i>
                        +5.2% from last month
                    </p>
                </div>
            </div>
            
            <div class="bg-gray-800 rounded-xl p-6">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-400 text-sm">Support Tickets</p>
                        <p class="text-3xl font-bold">24</p>
                    </div>
                    <i data-feather="mail" class="w-10 h-10 text-yellow-500"></i>
                </div>
                <div class="mt-4">
                    <p class="text-sm text-red-500 flex items-center">
                        <i data-feather="trending-down" class="w-4 h-4 mr-1"></i>
                        -3 from yesterday
                    </p>
                </div>
            </div>
        </div>
        
        <!-- Charts -->
        <div class="grid md:grid-cols-2 gap-6 mb-8">
            <div class="bg-gray-800 rounded-xl p-6">
                <h2 class="text-xl font-semibold mb-4">User Growth</h2>
                <canvas id="user-growth-chart" height="250"></canvas>
            </div>
            <div class="bg-gray-800 rounded-xl p-6">
                <h2 class="text-xl font-semibold mb-4">Revenue Breakdown</h2>
                <canvas id="revenue-chart" height="250"></canvas>
            </div>
        </div>
        
        <!-- Recent Activity -->
        <div class="bg-gray-800 rounded-xl p-6 mb-8">
            <h2 class="text-xl font-semibold mb-4">Recent Activity</h2>
            <div class="overflow-x-auto">
                <table class="w-full">
                    <thead>
                        <tr class="text-left text-gray-400 border-b border-gray-700">
                            <th class="pb-2 pl-2">Time</th>
                            <th class="pb-2">User</th>
                            <th class="pb-2">Action</th>
                            <th class="pb-2 pr-2">Details</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="border-b border-gray-700 hover:bg-gray-700/50">
                            <td class="py-3 pl-2">2 min ago</td>
                            <td>user123</td>
                            <td>Created server</td>
                            <td class="pr-2">Premium Plan (25 slots)</td>
                        </tr>
                        <tr class="border-b border-gray-700 hover:bg-gray-700/50">
                            <td class="py-3 pl-2">15 min ago</td>
                            <td>mcplayer99</td>
                            <td>Renewed subscription</td>
                            <td class="pr-2">Pro Plan (50 slots)</td>
                        </tr>
                        <tr class="border-b border-gray-700 hover:bg-gray-700/50">
                            <td class="py-3 pl-2">32 min ago</td>
                            <td>admin</td>
                            <td>Resolved ticket</td>
                            <td class="pr-2">#TKT-1245 (Plugin issue)</td>
                        </tr>
                        <tr class="border-b border-gray-700 hover:bg-gray-700/50">
                            <td class="py-3 pl-2">1 hour ago</td>
                            <td>builderman</td>
                            <td>Uploaded plugin</td>
                            <td class="pr-2">WorldEdit v7.2.12</td>
                        </tr>
                        <tr class="hover:bg-gray-700/50">
                            <td class="py-3 pl-2">2 hours ago</td>
                            <td>serveradmin</td>
                            <td>Restarted server</td>
                            <td class="pr-2">Server ID: SRV-4892</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        
        <!-- System Health -->
        <div class="bg-gray-800 rounded-xl p-6">
            <h2 class="text-xl font-semibold mb-4">System Health</h2>
            <div class="grid md:grid-cols-3 gap-6">
                <div>
                    <h3 class="text-lg font-medium mb-3">Node 1</h3>
                    <div class="space-y-4">
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span>CPU Usage</span>
                                <span>42%</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2">
                                <div class="bg-blue-500 h-2 rounded-full" style="width: 42%"></div>
                            </div>
                        </div>
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span>Memory</span>
                                <span>64GB / 128GB</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2">
                                <div class="bg-purple-500 h-2 rounded-full" style="width: 50%"></div>
                            </div>
                        </div>
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span>Storage</span>
                                <span>4.2TB / 10TB</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2">
                                <div class="bg-emerald-500 h-2 rounded-full" style="width: 42%"></div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div>
                    <h3 class="text-lg font-medium mb-3">Node 2</h3>
                    <div class="space-y-4">
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span>CPU Usage</span>
                                <span>38%</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2">
                                <div class="bg-blue-500 h-2 rounded-full" style="width: 38%"></div>
                            </div>
                        </div>
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span>Memory</span>
                                <span>58GB / 128GB</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2">
                                <div class="bg-purple-500 h-2 rounded-full" style="width: 45%"></div>
                            </div>
                        </div>
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span>Storage</span>
                                <span>3.8TB / 10TB</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2">
                                <div class="bg-emerald-500 h-2 rounded-full" style="width: 38%"></div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div>
                    <h3 class="text-lg font-medium mb-3">Node 3</h3>
                    <div class="space-y-4">
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span>CPU Usage</span>
                                <span>29%</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2">
                                <div class="bg-blue-500 h-2 rounded-full" style="width: 29%"></div>
                            </div>
                        </div>
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span>Memory</span>
                                <span>42GB / 128GB</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2">
                                <div class="bg-purple-500 h-2 rounded-full" style="width: 33%"></div>
                            </div>
                        </div>
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span>Storage</span>
                                <span>3.1TB / 10TB</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2">
                                <div class="bg-emerald-500 h-2 rounded-full" style="width: 31%"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <custom-footer></custom-footer>

    <script src="components/navbar.js"></script>
    <script src="components/footer.js"></script>
    <script src="script.js"></script>
    <script>
        feather.replace();
        
        // Initialize charts
        document.addEventListener('DOMContentLoaded', () => {
            // User Growth Chart
            const userGrowthCtx = document.getElementById('user-growth-chart').getContext('2d');
            new Chart(userGrowthCtx, {
                type: 'line',
                data: {
                    labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'],
                    datasets: [{
                        label: 'Total Users',
                        data: [850, 920, 1000, 1050, 1120, 1200, 1284],
                        borderColor: '#3b82f6',
                        backgroundColor: 'rgba(59, 130, 246, 0.1)',
                        borderWidth: 2,
                        tension: 0.3,
                        fill: true
                    }]
                },
                options: {
                    responsive: true,
                    plugins: {
                        legend: {
                            display: false
                        }
                    },
                    scales: {
                        y: {
                            grid: {
                                color: 'rgba(255, 255, 255, 0.1)'
                            }
                        },
                        x: {
                            grid: {
                                color: 'rgba(255, 255, 255, 0.1)'
                            }
                        }
                    }
                }
            });
            
            // Revenue Chart
            const revenueCtx = document.getElementById('revenue-chart').getContext('2d');
            new Chart(revenueCtx, {
                type: 'doughnut',
                data: {
                    labels: ['Starter ($5)', 'Premium ($10)', 'Pro ($20)'],
                    datasets: [{
                        data: [3200, 6500, 3145],
                        backgroundColor: [
                            'rgba(59, 130, 246, 0.8)',
                            'rgba(16, 185, 129, 0.8)',
                            'rgba(139, 92, 246, 0.8)'
                        ],
                        borderColor: [
                            'rgba(59, 130, 246, 1)',
                            'rgba(16, 185, 129, 1)',
                            'rgba(139, 92, 246, 1)'
                        ],
                        borderWidth: 1
                    }]
                },
                options: {
                    responsive: true,
                    plugins: {
                        legend: {
                            position: 'right'
                        }
                    }
                }
            });
            
            // Update last updated time
            setInterval(() => {
                document.getElementById('last-updated').textContent = 'Just now';
            }, 60000);
        });
    </script>
</body>
</html>