forked from IrfanTech-X/NetOptima
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
381 lines (362 loc) · 19.3 KB
/
index.html
File metadata and controls
381 lines (362 loc) · 19.3 KB
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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NetOptima - Network Diagnostic Dashboard</title>
<link rel="icon" type="image/png" href="favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://d3js.org/d3.v7.min.js"></script>
<style>
.metric-card {
transition: all 0.3s ease;
}
.metric-card:hover {
transform: translateY(-2px);
}
.pulse-dot {
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.network-node {
cursor: pointer;
transition: all 0.3s ease;
}
.network-node:hover {
transform: scale(1.1);
}
.port-status-open {
color: #10b981;
}
.port-status-closed {
color: #ef4444;
}
.dns-result {
background: #f8fafc;
border-left: 4px solid #3b82f6;
}
.pulse-node {
animation: pulse-topology 2s infinite;
}
@keyframes pulse-topology {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
.topology-link {
animation: dash-flow 3s linear infinite;
}
@keyframes dash-flow {
0% { stroke-dashoffset: 0; }
100% { stroke-dashoffset: -20; }
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<!-- Header -->
<header class="bg-white shadow-sm border-b">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4">
<div class="flex items-center justify-between">
<div class="flex items-center space-x-3">
<div class="w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center">
<svg class="w-5 h-5 text-white" fill="currentColor" viewBox="0 0 20 20">
<path d="M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"/>
</svg>
</div>
<h1 class="text-2xl font-bold text-gray-900">NetOptima</h1>
</div>
<div class="flex items-center space-x-2">
<div class="pulse-dot w-3 h-3 bg-green-500 rounded-full"></div>
<span class="text-sm text-gray-600">Live Monitoring</span>
</div>
</div>
</div>
</header>
<!-- Main Dashboard -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Status Cards Grid -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<!-- Public IP Card -->
<div class="metric-card bg-white rounded-lg shadow-sm border p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-sm font-medium text-gray-500">Public IP</h3>
<svg class="w-5 h-5 text-blue-500" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 12a2 2 0 100-4 2 2 0 000 4z"/>
<path fill-rule="evenodd" d="M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z"/>
</svg>
</div>
<div class="text-2xl font-bold text-gray-900" id="publicIP">Loading...</div>
<div class="text-sm text-gray-500 mt-1" id="location">Detecting location...</div>
<div class="text-xs text-gray-400 mt-1" id="isp">ISP: Loading...</div>
</div>
<!-- Latency Card -->
<div class="metric-card bg-white rounded-lg shadow-sm border p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-sm font-medium text-gray-500">Latency</h3>
<svg class="w-5 h-5 text-green-500" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z"/>
</svg>
</div>
<div class="text-2xl font-bold text-gray-900" id="latency">-- ms</div>
<div class="text-sm text-gray-500 mt-1">Packet Loss: <span id="packetLoss">0%</span></div>
</div>
<!-- Bandwidth Card -->
<div class="metric-card bg-white rounded-lg shadow-sm border p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-sm font-medium text-gray-500">Bandwidth</h3>
<svg class="w-5 h-5 text-purple-500" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z"/>
</svg>
</div>
<div class="text-2xl font-bold text-gray-900" id="bandwidth">-- Mbps</div>
<div class="text-sm text-gray-500 mt-1" id="bandwidthStatus">Ready to test</div>
</div>
<!-- Connection Stats Card -->
<div class="metric-card bg-white rounded-lg shadow-sm border p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-sm font-medium text-gray-500">Connection Stats</h3>
<svg class="w-5 h-5 text-orange-500" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M3 3a1 1 0 000 2v8a2 2 0 002 2h2.586l-1.293 1.293a1 1 0 101.414 1.414L10 15.414l2.293 2.293a1 1 0 001.414-1.414L12.414 15H15a2 2 0 002-2V5a1 1 0 100-2H3zm11.707 4.707a1 1 0 00-1.414-1.414L10 9.586 8.707 8.293a1 1 0 00-1.414 0l-2 2a1 1 0 001.414 1.414L8 10.414l1.293 1.293a1 1 0 001.414 0l4-4z"/>
</svg>
</div>
<div class="space-y-2">
<div class="flex justify-between items-center">
<span class="text-sm text-gray-600">Type:</span>
<span class="text-sm font-semibold text-gray-900" id="connectionType">4G</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-600">Downlink:</span>
<span class="text-sm font-semibold text-gray-900" id="downlink">10 Mbps</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-600">RTT:</span>
<span class="text-sm font-semibold text-gray-900" id="rtt">100ms</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-600">Save Data:</span>
<span class="text-sm font-semibold text-gray-900" id="saveData">Off</span>
</div>
</div>
<div class="mt-3 pt-3 border-t border-gray-100">
<div class="text-xs text-gray-500" id="connectionStatus">Stable connection</div>
</div>
</div>
</div>
<!-- Charts Section -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
<!-- Bandwidth Chart -->
<div class="bg-white rounded-lg shadow-sm border p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Bandwidth Over Time</h3>
<div class="h-64">
<canvas id="bandwidthChart"></canvas>
</div>
</div>
<!-- Latency Chart -->
<div class="bg-white rounded-lg shadow-sm border p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Latency Over Time</h3>
<div class="h-64">
<canvas id="latencyChart"></canvas>
</div>
</div>
</div>
<!-- Speed Tester Section -->
<div class="bg-white rounded-lg shadow-sm border p-6 mb-8">
<div class="flex items-center justify-between mb-6">
<h3 class="text-lg font-semibold text-gray-900">Speed Tester</h3>
<button
onclick="runSpeedTest()"
id="speedTestBtn"
class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors"
>
Start Test
</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<!-- Download Speed -->
<div class="text-center">
<div class="w-24 h-24 mx-auto mb-4 relative">
<svg class="w-24 h-24 transform -rotate-90" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="45" stroke="#e5e7eb" stroke-width="8" fill="none"/>
<circle cx="50" cy="50" r="45" stroke="#3b82f6" stroke-width="8" fill="none"
stroke-dasharray="283" stroke-dashoffset="283" id="downloadProgress"/>
</svg>
<div class="absolute inset-0 flex items-center justify-center">
<div class="text-center">
<div class="text-lg font-bold text-gray-900" id="downloadSpeed">0</div>
<div class="text-xs text-gray-500">Mbps</div>
</div>
</div>
</div>
<h4 class="text-sm font-medium text-gray-700">Download</h4>
<p class="text-xs text-gray-500" id="downloadStatus">Ready</p>
</div>
<!-- Upload Speed -->
<div class="text-center">
<div class="w-24 h-24 mx-auto mb-4 relative">
<svg class="w-24 h-24 transform -rotate-90" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="45" stroke="#e5e7eb" stroke-width="8" fill="none"/>
<circle cx="50" cy="50" r="45" stroke="#10b981" stroke-width="8" fill="none"
stroke-dasharray="283" stroke-dashoffset="283" id="uploadProgress"/>
</svg>
<div class="absolute inset-0 flex items-center justify-center">
<div class="text-center">
<div class="text-lg font-bold text-gray-900" id="uploadSpeed">0</div>
<div class="text-xs text-gray-500">Mbps</div>
</div>
</div>
</div>
<h4 class="text-sm font-medium text-gray-700">Upload</h4>
<p class="text-xs text-gray-500" id="uploadStatus">Ready</p>
</div>
<!-- Ping -->
<div class="text-center">
<div class="w-24 h-24 mx-auto mb-4 relative">
<svg class="w-24 h-24 transform -rotate-90" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="45" stroke="#e5e7eb" stroke-width="8" fill="none"/>
<circle cx="50" cy="50" r="45" stroke="#f59e0b" stroke-width="8" fill="none"
stroke-dasharray="283" stroke-dashoffset="283" id="pingProgress"/>
</svg>
<div class="absolute inset-0 flex items-center justify-center">
<div class="text-center">
<div class="text-lg font-bold text-gray-900" id="pingSpeed">0</div>
<div class="text-xs text-gray-500">ms</div>
</div>
</div>
</div>
<h4 class="text-sm font-medium text-gray-700">Ping</h4>
<p class="text-xs text-gray-500" id="pingStatus">Ready</p>
</div>
</div>
<!-- Test Progress Bar -->
<div class="mt-6">
<div class="flex justify-between text-sm text-gray-600 mb-2">
<span id="testPhase">Ready to start</span>
<span id="testProgress">0%</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2">
<div class="bg-blue-600 h-2 rounded-full transition-all duration-300" style="width: 0%" id="overallProgress"></div>
</div>
</div>
</div>
<!-- Network Tools Section -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
<!-- DNS Lookup Tool -->
<div class="bg-white rounded-lg shadow-sm border p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">DNS Lookup</h3>
<div class="flex space-x-2 mb-4">
<input
type="text"
id="dnsInput"
placeholder="Enter domain (e.g., google.com)"
class="flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
>
<button
onclick="performDNSLookup()"
class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"
>
Lookup
</button>
</div>
<div id="dnsResults" class="space-y-2 max-h-48 overflow-y-auto">
<p class="text-gray-500 text-sm">Enter a domain name to perform DNS lookup</p>
</div>
</div>
<!-- Port Status Checker -->
<div class="bg-white rounded-lg shadow-sm border p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Port Status Checker</h3>
<div class="flex space-x-2 mb-4">
<input
type="text"
id="portHost"
placeholder="Enter hostname (e.g., google.com)"
class="flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
>
<button
onclick="checkPorts()"
class="px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500"
>
Scan
</button>
</div>
<div id="portResults" class="space-y-2">
<p class="text-gray-500 text-sm">Enter a hostname to check common ports (80, 443, 22)</p>
</div>
</div>
</div>
<!-- Network Topology Visualization -->
<div class="bg-white rounded-lg shadow-sm border p-6 mb-8">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Network Path Visualization</h3>
<p class="text-sm text-gray-600 mb-4">Shows the actual path your data takes from your device to the internet</p>
<div id="networkTopology" class="w-full h-96 border border-gray-200 rounded-lg relative"></div>
</div>
<!-- Network Details Table -->
<div class="bg-white rounded-lg shadow-sm border overflow-hidden">
<div class="px-6 py-4 border-b">
<h3 class="text-lg font-semibold text-gray-900">Network Details</h3>
</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">Metric</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Value</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Last Updated</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="networkTable">
<!-- Table rows will be populated by JavaScript -->
</tbody>
</table>
</div>
</div>
</main>
<!-- Footer Design -->
<footer class="bg-black text-gray-300 py-8 animate-fade-in">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex flex-col items-center space-y-6">
<!-- Contributors -->
<div class="flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-8 text-sm">
<div class="flex items-center">
<svg class="w-5 h-5 text-blue-400 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 2a8 8 0 100 16 8 8 0 000-16zm0 14a6 6 0 110-12 6 6 0 010 12zm0-10a1 1 0 00-1 1v4a1 1 0 002 0V7a1 1 0 00-1-1z"/>
</svg>
<span class="mr-2">Contributor:</span>
<a href="https://github.com/IrfanTech-X" target="_blank" rel="noopener noreferrer" class="text-blue-400 hover:text-blue-300 hover:scale-105 transition-transform duration-200" aria-label="IrfanTech-X GitHub Profile">IrfanTech-X</a>
</div>
<div class="flex items-center">
<svg class="w-5 h-5 text-blue-400 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 2a8 8 0 100 16 8 8 0 000-16zm0 14a6 6 0 110-12 6 6 0 010 12zm0-10a1 1 0 00-1 1v4a1 1 0 002 0V7a1 1 0 00-1-1z"/>
</svg>
<span class="mr-2">Contributor:</span>
<a href="https://github.com/MossarrafHossainRobin" target="_blank" rel="noopener noreferrer" class="text-blue-400 hover:text-blue-300 hover:scale-105 transition-transform duration-200" aria-label="Jane Smith GitHub Profile">MossarrafHossainRobin</a>
</div>
</div>
<!-- Divider -->
<div class="w-full border-t border-gray-700"></div>
<!-- Copyright Notice -->
<div class="text-sm text-gray-300">
© <span id="currentYear"></span> NetOptima. All rights reserved.
</div>
</div>
</div>
</footer>
<style>
.animate-fade-in {
animation: fadeIn 1s ease-in;
}
@keyframes fadeIn {
0% { opacity: 0; transform: translateY(10px); }
100% { opacity: 1; transform: translateY(0); }
}
/* end of Footer design */
</style>
<script>
document.getElementById('currentYear').textContent = new Date().getFullYear();
</script>
<script src="working_function.js"></script>
</body>
</html>