File size: 23,436 Bytes
c84ec29
 
 
 
 
400fcb9
c84ec29
 
 
400fcb9
 
c84ec29
400fcb9
 
 
 
c84ec29
 
400fcb9
c84ec29
 
400fcb9
 
c84ec29
400fcb9
 
 
 
 
 
 
 
 
c84ec29
400fcb9
 
c84ec29
400fcb9
 
 
 
 
 
c84ec29
400fcb9
 
 
c84ec29
400fcb9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c84ec29
 
 
 
400fcb9
c84ec29
 
 
 
 
 
 
400fcb9
c84ec29
400fcb9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c84ec29
400fcb9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c84ec29
 
 
 
 
400fcb9
 
 
c84ec29
400fcb9
 
 
 
 
 
c84ec29
400fcb9
c84ec29
400fcb9
c84ec29
 
400fcb9
c84ec29
 
 
 
 
400fcb9
c84ec29
 
 
400fcb9
 
 
 
 
c84ec29
 
 
400fcb9
 
 
 
 
 
 
 
 
c84ec29
400fcb9
 
 
c84ec29
400fcb9
 
c84ec29
 
400fcb9
 
c84ec29
400fcb9
 
c84ec29
 
400fcb9
 
 
c84ec29
 
 
400fcb9
 
c84ec29
 
400fcb9
 
c84ec29
400fcb9
 
c84ec29
 
400fcb9
 
 
c84ec29
 
 
400fcb9
 
c84ec29
 
400fcb9
 
c84ec29
400fcb9
 
c84ec29
 
400fcb9
 
 
c84ec29
 
 
400fcb9
 
c84ec29
 
400fcb9
 
c84ec29
400fcb9
 
c84ec29
 
400fcb9
 
 
c84ec29
 
 
 
400fcb9
 
 
 
c84ec29
400fcb9
c84ec29
400fcb9
 
 
 
 
 
 
 
 
 
c84ec29
 
 
400fcb9
 
 
 
 
 
 
 
 
c84ec29
400fcb9
c84ec29
400fcb9
 
 
c84ec29
 
 
 
400fcb9
c84ec29
 
400fcb9
c84ec29
400fcb9
 
 
 
 
 
 
 
 
 
c84ec29
 
 
400fcb9
 
 
 
c84ec29
400fcb9
 
 
c84ec29
 
400fcb9
 
 
 
 
c84ec29
 
 
 
 
400fcb9
 
c84ec29
 
400fcb9
c84ec29
 
400fcb9
c84ec29
 
 
 
400fcb9
 
 
 
 
 
 
 
 
 
 
 
 
 
c84ec29
 
 
 
400fcb9
c84ec29
 
400fcb9
c84ec29
 
400fcb9
c84ec29
 
 
 
400fcb9
 
 
 
 
 
 
 
 
 
 
 
 
 
c84ec29
 
 
 
400fcb9
c84ec29
 
400fcb9
c84ec29
 
400fcb9
c84ec29
 
 
 
400fcb9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c84ec29
 
 
 
 
400fcb9
 
 
 
 
c84ec29
400fcb9
c84ec29
 
 
400fcb9
 
 
 
 
 
 
 
 
 
c84ec29
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>NxDog | Network Monitoring</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .nxdog-bg {
            background-color: #1a1d24;
        }
        .panel {
            background-color: #23272f;
            border-radius: 4px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .graph-container {
            height: 200px;
            position: relative;
        }
        .metric-card {
            transition: all 0.2s ease;
        }
        .metric-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .status-indicator {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            display: inline-block;
        }
        .dropdown-menu {
            display: none;
            position: absolute;
            right: 0;
            z-index: 10;
            min-width: 200px;
        }
        .dropdown:hover .dropdown-menu {
            display: block;
        }
        .nav-tab {
            border-bottom: 3px solid transparent;
            transition: all 0.2s ease;
        }
        .nav-tab.active {
            border-bottom-color: #7746e1;
            color: white;
        }
        .nav-tab:hover:not(.active) {
            border-bottom-color: #4a5568;
        }
        .alert-badge {
            position: absolute;
            top: -5px;
            right: -5px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            font-size: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .tooltip {
            visibility: hidden;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .has-tooltip:hover .tooltip {
            visibility: visible;
            opacity: 1;
        }
    </style>
</head>
<body class="nxdog-bg text-gray-300 font-sans">
    <div class="min-h-screen flex flex-col">
        <!-- Top Navigation -->
        <header class="bg-black py-2 px-4 border-b border-gray-800">
            <div class="flex items-center justify-between">
                <div class="flex items-center space-x-8">
                    <div class="flex items-center">
                        <div class="w-8 h-8 bg-purple-600 rounded-md flex items-center justify-center">
                            <i class="fas fa-chart-line text-white"></i>
                        </div>
                        <span class="ml-2 font-bold text-white">NxDog</span>
                    </div>
                    <nav class="hidden md:flex space-x-6">
                        <a href="#" class="text-white hover:text-gray-300">Dashboards</a>
                        <a href="#" class="hover:text-gray-300">Infrastructure</a>
                        <a href="#" class="hover:text-gray-300">Monitors</a>
                        <a href="#" class="hover:text-gray-300">Events</a>
                        <a href="#" class="hover:text-gray-300">Integrations</a>
                    </nav>
                </div>
                <div class="flex items-center space-x-4">
                    <div class="relative">
                        <input type="text" placeholder="Search..." class="bg-gray-800 text-white px-3 py-1 rounded-md text-sm focus:outline-none focus:ring-1 focus:ring-purple-500 w-64">
                        <i class="fas fa-search absolute right-3 top-2 text-gray-400"></i>
                    </div>
                    <div class="relative">
                        <button class="relative p-1 text-gray-400 hover:text-white">
                            <i class="fas fa-bell text-lg"></i>
                            <span class="alert-badge bg-red-500 text-white">3</span>
                        </button>
                    </div>
                    <div class="flex items-center space-x-2">
                        <div class="w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center">
                            <i class="fas fa-user text-sm"></i>
                        </div>
                        <span class="hidden md:inline text-sm">Admin</span>
                    </div>
                </div>
            </div>
        </header>

        <!-- Dashboard Header -->
        <div class="py-4 px-6 border-b border-gray-800">
            <div class="flex justify-between items-center">
                <div>
                    <h1 class="text-xl font-bold text-white">Network Monitoring Dashboard</h1>
                    <div class="flex items-center space-x-4 mt-1">
                        <span class="text-sm text-gray-400">SNMP Metrics</span>
                        <span class="text-xs bg-gray-700 px-2 py-0.5 rounded text-gray-300">prod-us-west</span>
                        <span class="text-xs bg-gray-700 px-2 py-0.5 rounded text-gray-300">last updated: <span id="last-updated">just now</span></span>
                    </div>
                </div>
                <div class="flex space-x-2">
                    <div class="relative">
                        <select class="bg-gray-800 border border-gray-700 text-white rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-purple-500">
                            <option>Last 15 minutes</option>
                            <option selected>Last 1 hour</option>
                            <option>Last 4 hours</option>
                            <option>Last 24 hours</option>
                        </select>
                    </div>
                    <button class="bg-gray-800 hover:bg-gray-700 text-white px-3 py-1 rounded-md text-sm flex items-center space-x-1">
                        <i class="fas fa-sync-alt"></i>
                        <span class="hidden md:inline">Refresh</span>
                    </button>
                    <button class="bg-gray-800 hover:bg-gray-700 text-white px-3 py-1 rounded-md text-sm flex items-center space-x-1">
                        <i class="fas fa-share-alt"></i>
                        <span class="hidden md:inline">Share</span>
                    </button>
                    <button class="bg-purple-600 hover:bg-purple-700 text-white px-3 py-1 rounded-md text-sm flex items-center space-x-1">
                        <i class="fas fa-plus"></i>
                        <span class="hidden md:inline">New</span>
                    </button>
                </div>
            </div>
            <div class="flex space-x-6 mt-4 border-b border-gray-800">
                <a href="#" class="nav-tab active pb-2 text-sm font-medium">Overview</a>
                <a href="#" class="nav-tab pb-2 text-sm font-medium">Routers</a>
                <a href="#" class="nav-tab pb-2 text-sm font-medium">Switches</a>
                <a href="#" class="nav-tab pb-2 text-sm font-medium">Firewalls</a>
                <a href="#" class="nav-tab pb-2 text-sm font-medium">Interfaces</a>
                <a href="#" class="nav-tab pb-2 text-sm font-medium">Alerts</a>
            </div>
        </div>

        <!-- Dashboard Content -->
        <div class="flex-1 p-6">
            <!-- Summary Metrics -->
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
                <!-- Devices Online -->
                <div class="panel metric-card p-4">
                    <div class="flex justify-between items-start">
                        <div>
                            <h3 class="text-gray-400 text-xs uppercase tracking-wider">Devices Online</h3>
                            <p class="text-2xl font-bold text-white">42</p>
                        </div>
                        <div class="text-green-500 text-xl">
                            <i class="fas fa-server"></i>
                        </div>
                    </div>
                    <div class="mt-2 flex items-center">
                        <span class="status-indicator bg-green-500 mr-1"></span>
                        <span class="text-xs text-gray-400">All systems operational</span>
                    </div>
                </div>

                <!-- CPU Utilization -->
                <div class="panel metric-card p-4">
                    <div class="flex justify-between items-start">
                        <div>
                            <h3 class="text-gray-400 text-xs uppercase tracking-wider">Avg CPU %</h3>
                            <p class="text-2xl font-bold text-white"><span id="avg-cpu">32</span>%</p>
                        </div>
                        <div class="text-yellow-500 text-xl">
                            <i class="fas fa-microchip"></i>
                        </div>
                    </div>
                    <div class="mt-2 flex items-center">
                        <span class="status-indicator bg-yellow-500 mr-1"></span>
                        <span class="text-xs text-gray-400">2 devices > 70%</span>
                    </div>
                </div>

                <!-- Bandwidth Utilization -->
                <div class="panel metric-card p-4">
                    <div class="flex justify-between items-start">
                        <div>
                            <h3 class="text-gray-400 text-xs uppercase tracking-wider">Bandwidth Util</h3>
                            <p class="text-2xl font-bold text-white"><span id="avg-bandwidth">45</span>%</p>
                        </div>
                        <div class="text-blue-400 text-xl">
                            <i class="fas fa-network-wired"></i>
                        </div>
                    </div>
                    <div class="mt-2 flex items-center">
                        <span class="status-indicator bg-green-500 mr-1"></span>
                        <span class="text-xs text-gray-400">Peak: 78%</span>
                    </div>
                </div>

                <!-- Error Rate -->
                <div class="panel metric-card p-4">
                    <div class="flex justify-between items-start">
                        <div>
                            <h3 class="text-gray-400 text-xs uppercase tracking-wider">Error Rate</h3>
                            <p class="text-2xl font-bold text-white"><span id="error-rate">0.12</span>%</p>
                        </div>
                        <div class="text-red-400 text-xl">
                            <i class="fas fa-exclamation-triangle"></i>
                        </div>
                    </div>
                    <div class="mt-2 flex items-center">
                        <span class="status-indicator bg-yellow-500 mr-1"></span>
                        <span class="text-xs text-gray-400">3 interfaces > 1%</span>
                    </div>
                </div>
            </div>

            <!-- Main Graphs -->
            <div class="grid grid-cols-1 lg:grid-cols-2 gap-4 mb-6">
                <!-- Network Traffic -->
                <div class="panel">
                    <div class="p-3 border-b border-gray-800 flex justify-between items-center">
                        <h2 class="font-semibold text-white">Network Traffic (bps)</h2>
                        <div class="flex space-x-2">
                            <div class="dropdown relative">
                                <button class="text-gray-400 hover:text-white text-sm">
                                    <i class="fas fa-ellipsis-h"></i>
                                </button>
                                <div class="dropdown-menu mt-1 bg-gray-800 rounded-md shadow-lg py-1">
                                    <a href="#" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700">View in Metrics</a>
                                    <a href="#" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700">Edit</a>
                                    <a href="#" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700">Export</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="p-3">
                        <div class="flex items-center space-x-4 mb-2">
                            <div class="flex items-center">
                                <span class="w-3 h-3 rounded-full bg-blue-500 mr-1"></span>
                                <span class="text-xs">Inbound</span>
                            </div>
                            <div class="flex items-center">
                                <span class="w-3 h-3 rounded-full bg-purple-500 mr-1"></span>
                                <span class="text-xs">Outbound</span>
                            </div>
                        </div>
                        <div class="graph-container" id="traffic-graph"></div>
                        <div class="flex justify-between text-xs text-gray-400 mt-2">
                            <span>Min: 1.2 Gbps</span>
                            <span>Avg: 2.8 Gbps</span>
                            <span>Max: 4.5 Gbps</span>
                        </div>
                    </div>
                </div>

                <!-- Interface Errors -->
                <div class="panel">
                    <div class="p-3 border-b border-gray-800 flex justify-between items-center">
                        <h2 class="font-semibold text-white">Interface Errors</h2>
                        <div class="flex space-x-2">
                            <div class="dropdown relative">
                                <button class="text-gray-400 hover:text-white text-sm">
                                    <i class="fas fa-ellipsis-h"></i>
                                </button>
                                <div class="dropdown-menu mt-1 bg-gray-800 rounded-md shadow-lg py-1">
                                    <a href="#" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700">View in Metrics</a>
                                    <a href="#" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700">Edit</a>
                                    <a href="#" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700">Export</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="p-3">
                        <div class="flex items-center space-x-4 mb-2">
                            <div class="flex items-center">
                                <span class="w-3 h-3 rounded-full bg-red-400 mr-1"></span>
                                <span class="text-xs">Errors</span>
                            </div>
                            <div class="flex items-center">
                                <span class="w-3 h-3 rounded-full bg-yellow-500 mr-1"></span>
                                <span class="text-xs">Discards</span>
                            </div>
                        </div>
                        <div class="graph-container" id="errors-graph"></div>
                        <div class="flex justify-between text-xs text-gray-400 mt-2">
                            <span>Core Switch 1: 12 errors</span>
                            <span>Edge Router 3: 8 errors</span>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Second Row -->
            <div class="grid grid-cols-1 lg:grid-cols-3 gap-4 mb-6">
                <!-- Device CPU Load -->
                <div class="panel">
                    <div class="p-3 border-b border-gray-800 flex justify-between items-center">
                        <h2 class="font-semibold text-white">Device CPU Load</h2>
                        <div class="flex space-x-2">
                            <button class="text-gray-400 hover:text-white text-sm">
                                <i class="fas fa-ellipsis-h"></i>
                            </button>
                        </div>
                    </div>
                    <div class="p-3">
                        <div class="graph-container" id="cpu-graph"></div>
                        <div class="grid grid-cols-3 gap-2 mt-2">
                            <div class="text-center">
                                <div class="text-xs text-gray-400">Core Router 1</div>
                                <div class="font-bold text-sm"><span class="text-yellow-500">78%</span></div>
                            </div>
                            <div class="text-center">
                                <div class="text-xs text-gray-400">Firewall 2</div>
                                <div class="font-bold text-sm"><span class="text-green-500">42%</span></div>
                            </div>
                            <div class="text-center">
                                <div class="text-xs text-gray-400">Switch 5</div>
                                <div class="font-bold text-sm"><span class="text-red-500">85%</span></div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Memory Utilization -->
                <div class="panel">
                    <div class="p-3 border-b border-gray-800 flex justify-between items-center">
                        <h2 class="font-semibold text-white">Memory Utilization</h2>
                        <div class="flex space-x-2">
                            <button class="text-gray-400 hover:text-white text-sm">
                                <i class="fas fa-ellipsis-h"></i>
                            </button>
                        </div>
                    </div>
                    <div class="p-3">
                        <div class="graph-container" id="memory-graph"></div>
                        <div class="grid grid-cols-3 gap-2 mt-2">
                            <div class="text-center">
                                <div class="text-xs text-gray-400">Used</div>
                                <div class="font-bold text-sm">65%</div>
                            </div>
                            <div class="text-center">
                                <div class="text-xs text-gray-400">Free</div>
                                <div class="font-bold text-sm">35%</div>
                            </div>
                            <div class="text-center">
                                <div class="text-xs text-gray-400">Peak</div>
                                <div class="font-bold text-sm">82%</div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Top Interfaces -->
                <div class="panel">
                    <div class="p-3 border-b border-gray-800 flex justify-between items-center">
                        <h2 class="font-semibold text-white">Top Interfaces by Traffic</h2>
                        <div class="flex space-x-2">
                            <button class="text-gray-400 hover:text-white text-sm">
                                <i class="fas fa-ellipsis-h"></i>
                            </button>
                        </div>
                    </div>
                    <div class="p-3">
                        <div class="space-y-3">
                            <div>
                                <div class="flex justify-between text-xs mb-1">
                                    <span>eth0 - Core Switch 1</span>
                                    <span class="font-bold">4.2 Gbps</span>
                                </div>
                                <div class="w-full bg-gray-700 rounded-full h-1.5">
                                    <div class="bg-blue-500 h-1.5 rounded-full" style="width: 84%"></div>
                                </div>
                            </div>
                            <div>
                                <div class="flex justify-between text-xs mb-1">
                                    <span>Gig1/0/24 - Edge Router 2</span>
                                    <span class="font-bold">3.8 Gbps</span>
                                </div>
                                <div class="w-full bg-gray-700 rounded-full h-1.5">
                                    <div class="bg-blue-500 h-1.5 rounded-full" style="width: 76%"></div>
                                </div>
                            </div>
                            <div>
                                <div class="flex justify-between text-xs mb-1">
                                    <span Port-channel5 - Dist Switch</span>
                                    <span class="font-bold">3.1 Gbps</span>
                                </div>
                                <div class="w-full bg-gray-700 rounded-full h-1.5">
                                    <div class="bg-blue-500 h-1.5 rounded-full" style="width: 62%"></div>
                                </div>
                            </div>
                            <div>
                                <div class="flex justify-between text-xs mb-1">
                                    <span>VLAN100 - Firewall 1</span>
                                    <span class="font-bold">2.7 Gbps</span>
                                </div>
                                <div class="w-full bg-gray-700 rounded-full h-1.5">
                                    <div class="bg-blue-500 h-1.5 rounded-full" style="width: 54%"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Device Status Table -->
            <div class="panel mb-6">
                <div class="p-3 border-b border-gray-800 flex justify-between items-center">
                    <h2 class="font-semibold text-white">Network Device Status</h2>
                    <div class="flex space-x-2">
                        <button class="text-gray-400 hover:text-white text-sm">
                            <i class="fas fa-ellipsis-h"></i>
                        </button>
                    </div>
                </div>
                <div class="p-3 overflow-x-auto">
                    <table class="min-w-full divide-y divide-gray-800">
                        <thead>
                            <tr>
                                <th class="px-4 py-2 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Device</th>
                                <th class="px-4 py-2 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Type</th>
                                <th class="px-4 py-2 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Status</th>
                                <th class="px-4 py-2 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">CPU %</th>
                                <th class="px-4 py-2 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Memory %</th>
                                <th class="px极速赛车开
</html>