808 lines
30 KiB
Python
808 lines
30 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Generate enhanced hacker-style UI for ESP32-C5 Toolkit
|
|
This script generates the HTML/CSS/JS for the embedded web interface
|
|
"""
|
|
|
|
html_template = '''<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>ESP32-C5 TOOLKIT</title>
|
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
|
|
<style>
|
|
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Share+Tech+Mono&display=swap');
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
:root {
|
|
--primary: #00ff41;
|
|
--secondary: #00d4ff;
|
|
--danger: #ff0040;
|
|
--bg-dark: #0a0a0a;
|
|
--bg-darker: #050505;
|
|
--bg-panel: #111111;
|
|
--border: #00ff41;
|
|
--text: #00ff41;
|
|
--text-dim: #00aa2a;
|
|
--glow: 0 0 10px rgba(0, 255, 65, 0.5);
|
|
}
|
|
body {
|
|
font-family: 'JetBrains Mono', 'Share Tech Mono', monospace;
|
|
background: var(--bg-darker);
|
|
color: var(--text);
|
|
overflow-x: hidden;
|
|
position: relative;
|
|
}
|
|
body::before {
|
|
content: '';
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background:
|
|
repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,255,65,0.03) 2px, rgba(0,255,65,0.03) 4px),
|
|
radial-gradient(circle at 20% 50%, rgba(0,255,65,0.05) 0%, transparent 50%),
|
|
radial-gradient(circle at 80% 50%, rgba(0,212,255,0.05) 0%, transparent 50%);
|
|
pointer-events: none;
|
|
z-index: 0;
|
|
}
|
|
.matrix-bg {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
opacity: 0.1;
|
|
z-index: 0;
|
|
pointer-events: none;
|
|
}
|
|
.container {
|
|
display: grid;
|
|
grid-template-columns: 280px 1fr;
|
|
min-height: 100vh;
|
|
position: relative;
|
|
z-index: 1;
|
|
}
|
|
.sidebar {
|
|
background: var(--bg-panel);
|
|
border-right: 2px solid var(--border);
|
|
box-shadow: var(--glow);
|
|
padding: 20px 0;
|
|
position: sticky;
|
|
top: 0;
|
|
height: 100vh;
|
|
overflow-y: auto;
|
|
}
|
|
.sidebar-header {
|
|
padding: 20px;
|
|
border-bottom: 2px solid var(--border);
|
|
margin-bottom: 20px;
|
|
}
|
|
.sidebar-header h1 {
|
|
font-size: 1.4rem;
|
|
letter-spacing: 3px;
|
|
text-transform: uppercase;
|
|
color: var(--primary);
|
|
text-shadow: var(--glow);
|
|
margin-bottom: 5px;
|
|
}
|
|
.sidebar-header .subtitle {
|
|
font-size: 0.7rem;
|
|
color: var(--text-dim);
|
|
letter-spacing: 2px;
|
|
}
|
|
.nav-menu {
|
|
list-style: none;
|
|
}
|
|
.nav-item {
|
|
padding: 15px 25px;
|
|
cursor: pointer;
|
|
transition: all 0.3s;
|
|
border-left: 3px solid transparent;
|
|
position: relative;
|
|
font-size: 0.9rem;
|
|
letter-spacing: 1px;
|
|
}
|
|
.nav-item::before {
|
|
content: '> ';
|
|
opacity: 0;
|
|
transition: opacity 0.3s;
|
|
color: var(--primary);
|
|
}
|
|
.nav-item:hover, .nav-item.active {
|
|
background: rgba(0, 255, 65, 0.1);
|
|
border-left-color: var(--primary);
|
|
transform: translateX(5px);
|
|
}
|
|
.nav-item.active::before, .nav-item:hover::before {
|
|
opacity: 1;
|
|
}
|
|
.content-area {
|
|
padding: 30px;
|
|
background: var(--bg-dark);
|
|
position: relative;
|
|
}
|
|
.page {
|
|
display: none;
|
|
animation: fadeIn 0.3s;
|
|
}
|
|
.page.active {
|
|
display: block;
|
|
}
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; transform: translateY(10px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
.page-header {
|
|
margin-bottom: 30px;
|
|
padding-bottom: 15px;
|
|
border-bottom: 2px solid var(--border);
|
|
}
|
|
.page-header h2 {
|
|
font-size: 1.8rem;
|
|
letter-spacing: 4px;
|
|
text-transform: uppercase;
|
|
color: var(--primary);
|
|
text-shadow: var(--glow);
|
|
}
|
|
.panel {
|
|
background: var(--bg-panel);
|
|
border: 1px solid var(--border);
|
|
border-radius: 0;
|
|
padding: 25px;
|
|
margin-bottom: 20px;
|
|
box-shadow: 0 0 20px rgba(0, 255, 65, 0.1);
|
|
}
|
|
.panel-header {
|
|
font-size: 1.1rem;
|
|
letter-spacing: 2px;
|
|
margin-bottom: 20px;
|
|
color: var(--secondary);
|
|
text-transform: uppercase;
|
|
border-bottom: 1px solid var(--border);
|
|
padding-bottom: 10px;
|
|
}
|
|
.btn {
|
|
background: transparent;
|
|
border: 2px solid var(--border);
|
|
color: var(--text);
|
|
padding: 12px 24px;
|
|
font-family: inherit;
|
|
font-size: 0.9rem;
|
|
letter-spacing: 2px;
|
|
text-transform: uppercase;
|
|
cursor: pointer;
|
|
transition: all 0.3s;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
.btn::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: -100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: var(--primary);
|
|
transition: left 0.3s;
|
|
z-index: -1;
|
|
}
|
|
.btn:hover::before {
|
|
left: 0;
|
|
}
|
|
.btn:hover {
|
|
color: var(--bg-dark);
|
|
box-shadow: var(--glow);
|
|
}
|
|
.btn:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
.btn-danger {
|
|
border-color: var(--danger);
|
|
color: var(--danger);
|
|
}
|
|
.btn-danger::before {
|
|
background: var(--danger);
|
|
}
|
|
.btn-danger:hover {
|
|
color: var(--bg-dark);
|
|
}
|
|
.terminal {
|
|
background: var(--bg-darker);
|
|
border: 1px solid var(--border);
|
|
padding: 20px;
|
|
font-family: 'JetBrains Mono', monospace;
|
|
font-size: 0.85rem;
|
|
color: var(--text);
|
|
min-height: 300px;
|
|
max-height: 500px;
|
|
overflow-y: auto;
|
|
line-height: 1.6;
|
|
}
|
|
.terminal-line {
|
|
margin-bottom: 5px;
|
|
}
|
|
.terminal-prompt {
|
|
color: var(--secondary);
|
|
}
|
|
.terminal-output {
|
|
color: var(--text);
|
|
}
|
|
.terminal-error {
|
|
color: var(--danger);
|
|
}
|
|
.graph-container {
|
|
background: var(--bg-panel);
|
|
border: 1px solid var(--border);
|
|
padding: 20px;
|
|
margin: 20px 0;
|
|
position: relative;
|
|
}
|
|
.graph-container canvas {
|
|
max-height: 400px;
|
|
}
|
|
.stats-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
gap: 20px;
|
|
margin: 20px 0;
|
|
}
|
|
.stat-card {
|
|
background: var(--bg-panel);
|
|
border: 1px solid var(--border);
|
|
padding: 20px;
|
|
text-align: center;
|
|
}
|
|
.stat-value {
|
|
font-size: 2rem;
|
|
color: var(--primary);
|
|
text-shadow: var(--glow);
|
|
margin: 10px 0;
|
|
}
|
|
.stat-label {
|
|
font-size: 0.8rem;
|
|
color: var(--text-dim);
|
|
text-transform: uppercase;
|
|
letter-spacing: 2px;
|
|
}
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin: 20px 0;
|
|
font-size: 0.85rem;
|
|
}
|
|
table th {
|
|
background: var(--bg-panel);
|
|
border: 1px solid var(--border);
|
|
padding: 12px;
|
|
text-align: left;
|
|
text-transform: uppercase;
|
|
letter-spacing: 1px;
|
|
color: var(--primary);
|
|
}
|
|
table td {
|
|
border: 1px solid var(--border);
|
|
padding: 10px 12px;
|
|
background: var(--bg-darker);
|
|
}
|
|
table tr:hover td {
|
|
background: rgba(0, 255, 65, 0.1);
|
|
}
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
.form-label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
color: var(--text);
|
|
text-transform: uppercase;
|
|
letter-spacing: 1px;
|
|
font-size: 0.85rem;
|
|
}
|
|
.form-control {
|
|
width: 100%;
|
|
background: var(--bg-darker);
|
|
border: 1px solid var(--border);
|
|
color: var(--text);
|
|
padding: 10px;
|
|
font-family: inherit;
|
|
font-size: 0.9rem;
|
|
}
|
|
.form-control:focus {
|
|
outline: none;
|
|
border-color: var(--primary);
|
|
box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
|
|
}
|
|
.status-indicator {
|
|
display: inline-block;
|
|
width: 10px;
|
|
height: 10px;
|
|
border-radius: 50%;
|
|
margin-right: 8px;
|
|
animation: pulse 2s infinite;
|
|
}
|
|
.status-indicator.active {
|
|
background: var(--primary);
|
|
box-shadow: 0 0 10px var(--primary);
|
|
}
|
|
.status-indicator.inactive {
|
|
background: var(--text-dim);
|
|
}
|
|
@keyframes pulse {
|
|
0%, 100% { opacity: 1; }
|
|
50% { opacity: 0.5; }
|
|
}
|
|
.warning-box {
|
|
background: rgba(255, 0, 64, 0.1);
|
|
border: 2px solid var(--danger);
|
|
padding: 15px;
|
|
margin: 20px 0;
|
|
color: var(--danger);
|
|
text-transform: uppercase;
|
|
letter-spacing: 1px;
|
|
font-size: 0.85rem;
|
|
}
|
|
.channel-map {
|
|
display: grid;
|
|
grid-template-columns: repeat(13, 1fr);
|
|
gap: 5px;
|
|
margin: 20px 0;
|
|
}
|
|
.channel-block {
|
|
background: var(--bg-panel);
|
|
border: 1px solid var(--border);
|
|
padding: 10px;
|
|
text-align: center;
|
|
font-size: 0.8rem;
|
|
position: relative;
|
|
}
|
|
.channel-block.active {
|
|
background: var(--primary);
|
|
color: var(--bg-dark);
|
|
box-shadow: var(--glow);
|
|
}
|
|
.channel-block.occupied {
|
|
border-color: var(--secondary);
|
|
}
|
|
.signal-bar {
|
|
height: 4px;
|
|
background: var(--bg-darker);
|
|
margin-top: 5px;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
.signal-bar-fill {
|
|
height: 100%;
|
|
background: linear-gradient(90deg, var(--danger), var(--primary));
|
|
transition: width 0.3s;
|
|
}
|
|
@media (max-width: 768px) {
|
|
.container {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.sidebar {
|
|
position: relative;
|
|
height: auto;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="sidebar">
|
|
<div class="sidebar-header">
|
|
<h1>ESP32-C5</h1>
|
|
<div class="subtitle">TOOLKIT v2.0</div>
|
|
</div>
|
|
<ul class="nav-menu" id="nav">
|
|
<li class="nav-item active" data-page="dashboard">DASHBOARD</li>
|
|
<li class="nav-item" data-page="wifi-scan">WIFI SCANNER</li>
|
|
<li class="nav-item" data-page="packet-sniff">PACKET SNIFFER</li>
|
|
<li class="nav-item" data-page="bt-scan">BLUETOOTH SCANNER</li>
|
|
<li class="nav-item" data-page="deauth">DEAUTH ENGINE</li>
|
|
<li class="nav-item" data-page="signal-analysis">SIGNAL ANALYSIS</li>
|
|
<li class="nav-item" data-page="channel-map">CHANNEL MAP</li>
|
|
<li class="nav-item" data-page="settings">SYSTEM CONFIG</li>
|
|
</ul>
|
|
</div>
|
|
<div class="content-area">
|
|
<!-- Dashboard -->
|
|
<div id="dashboard" class="page active">
|
|
<div class="page-header">
|
|
<h2>SYSTEM DASHBOARD</h2>
|
|
</div>
|
|
<div class="stats-grid">
|
|
<div class="stat-card">
|
|
<div class="stat-label">UPTIME</div>
|
|
<div class="stat-value" id="uptime">00:00:00</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-label">FREE HEAP</div>
|
|
<div class="stat-value" id="free-heap">0 KB</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-label">NETWORKS FOUND</div>
|
|
<div class="stat-value" id="networks-count">0</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-label">PACKETS CAPTURED</div>
|
|
<div class="stat-value" id="packets-count">0</div>
|
|
</div>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">SYSTEM INFORMATION</div>
|
|
<div id="system-info" class="terminal"></div>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">NETWORK ACTIVITY</div>
|
|
<div class="graph-container">
|
|
<canvas id="network-activity-chart"></canvas>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- WiFi Scanner -->
|
|
<div id="wifi-scan" class="page">
|
|
<div class="page-header">
|
|
<h2>WIFI NETWORK SCANNER</h2>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">SCAN CONTROLS</div>
|
|
<button class="btn" id="scan-btn">INITIATE SCAN</button>
|
|
<button class="btn" id="auto-scan-btn">AUTO SCAN</button>
|
|
<span class="status-indicator inactive" id="scan-status"></span>
|
|
<span id="scan-status-text">READY</span>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">SIGNAL STRENGTH DISTRIBUTION</div>
|
|
<div class="graph-container">
|
|
<canvas id="rssi-chart"></canvas>
|
|
</div>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">DETECTED NETWORKS</div>
|
|
<div id="scan-results">
|
|
<table id="networks-table">
|
|
<thead>
|
|
<tr>
|
|
<th>SSID</th>
|
|
<th>BSSID</th>
|
|
<th>BAND</th>
|
|
<th>CH</th>
|
|
<th>RSSI</th>
|
|
<th>SECURITY</th>
|
|
<th>SIGNAL</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Packet Sniffer -->
|
|
<div id="packet-sniff" class="page">
|
|
<div class="page-header">
|
|
<h2>PACKET SNIFFER</h2>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">CAPTURE CONFIGURATION</div>
|
|
<div class="form-group">
|
|
<label class="form-label">CHANNEL</label>
|
|
<select class="form-control" id="sniff-channel">
|
|
<option value="0">ALL CHANNELS (HOPPING)</option>
|
|
<option value="1">1</option>
|
|
<option value="2">2</option>
|
|
<option value="3">3</option>
|
|
<option value="4">4</option>
|
|
<option value="5">5</option>
|
|
<option value="6">6</option>
|
|
<option value="7">7</option>
|
|
<option value="8">8</option>
|
|
<option value="9">9</option>
|
|
<option value="10">10</option>
|
|
<option value="11">11</option>
|
|
<option value="12">12</option>
|
|
<option value="13">13</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">FILTER TYPE</label>
|
|
<select class="form-control" id="packet-filter">
|
|
<option value="all">ALL PACKETS</option>
|
|
<option value="management">MANAGEMENT FRAMES</option>
|
|
<option value="data">DATA FRAMES</option>
|
|
<option value="control">CONTROL FRAMES</option>
|
|
<option value="beacon">BEACON FRAMES</option>
|
|
<option value="probe">PROBE REQUESTS/RESPONSES</option>
|
|
</select>
|
|
</div>
|
|
<button class="btn" id="start-sniff">START CAPTURE</button>
|
|
<button class="btn" id="stop-sniff" disabled>STOP CAPTURE</button>
|
|
<button class="btn" id="clear-packets">CLEAR LOG</button>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">PACKET FLOW</div>
|
|
<div class="graph-container">
|
|
<canvas id="packet-flow-chart"></canvas>
|
|
</div>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">CAPTURED PACKETS</div>
|
|
<div class="terminal" id="packet-log"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Bluetooth Scanner -->
|
|
<div id="bt-scan" class="page">
|
|
<div class="page-header">
|
|
<h2>BLUETOOTH SCANNER</h2>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">SCAN CONTROLS</div>
|
|
<button class="btn" id="bt-scan-btn">START BT SCAN</button>
|
|
<button class="btn" id="bt-scan-stop-btn" disabled>STOP SCAN</button>
|
|
<span class="status-indicator inactive" id="bt-scan-status"></span>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">BLUETOOTH DEVICES</div>
|
|
<table id="bt-devices-table">
|
|
<thead>
|
|
<tr>
|
|
<th>NAME</th>
|
|
<th>ADDRESS</th>
|
|
<th>RSSI</th>
|
|
<th>TYPE</th>
|
|
<th>ACTIONS</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">BLUETOOTH JAMMING</div>
|
|
<div class="warning-box">
|
|
WARNING: USE ONLY ON YOUR OWN DEVICES. UNAUTHORIZED JAMMING IS ILLEGAL.
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">TARGET ADDRESS (OPTIONAL)</label>
|
|
<input type="text" class="form-control" id="bt-jam-target" placeholder="AA:BB:CC:DD:EE:FF">
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">DURATION (SECONDS)</label>
|
|
<input type="number" class="form-control" id="bt-jam-duration" value="30" min="10" max="300">
|
|
</div>
|
|
<button class="btn btn-danger" id="bt-jam-start">START JAMMING</button>
|
|
<button class="btn btn-danger" id="bt-jam-stop" disabled>STOP JAMMING</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Deauth Engine -->
|
|
<div id="deauth" class="page">
|
|
<div class="page-header">
|
|
<h2>DEAUTH ENGINE</h2>
|
|
</div>
|
|
<div class="warning-box">
|
|
WARNING: USE ONLY ON NETWORKS YOU OWN. UNAUTHORIZED USE IS ILLEGAL.
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">TARGET SELECTION</div>
|
|
<button class="btn" id="deauth-scan-btn">SCAN NETWORKS</button>
|
|
<div id="deauth-targets"></div>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">ATTACK CONFIGURATION</div>
|
|
<div class="form-group">
|
|
<label class="form-label">DURATION (SECONDS)</label>
|
|
<input type="number" class="form-control" id="deauth-duration" value="30" min="10" max="600">
|
|
</div>
|
|
<button class="btn btn-danger" id="deauth-start-btn">START ATTACK</button>
|
|
<button class="btn btn-danger" id="deauth-stop-btn" disabled>STOP ATTACK</button>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">ATTACK STATISTICS</div>
|
|
<div class="stats-grid">
|
|
<div class="stat-card">
|
|
<div class="stat-label">TOTAL PACKETS</div>
|
|
<div class="stat-value" id="deauth-total">0</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-label">2.4GHZ PACKETS</div>
|
|
<div class="stat-value" id="deauth-24">0</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-label">5GHZ PACKETS</div>
|
|
<div class="stat-value" id="deauth-5">0</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-label">ELAPSED TIME</div>
|
|
<div class="stat-value" id="deauth-time">0s</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Signal Analysis -->
|
|
<div id="signal-analysis" class="page">
|
|
<div class="page-header">
|
|
<h2>SIGNAL ANALYSIS</h2>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">SIGNAL STRENGTH OVER TIME</div>
|
|
<div class="graph-container">
|
|
<canvas id="signal-time-chart"></canvas>
|
|
</div>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">CHANNEL UTILIZATION</div>
|
|
<div class="graph-container">
|
|
<canvas id="channel-util-chart"></canvas>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Channel Map -->
|
|
<div id="channel-map" class="page">
|
|
<div class="page-header">
|
|
<h2>CHANNEL MAPPING</h2>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">2.4GHZ BAND</div>
|
|
<div class="channel-map" id="channel-map-24"></div>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">5GHZ BAND</div>
|
|
<div class="channel-map" id="channel-map-5"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Settings -->
|
|
<div id="settings" class="page">
|
|
<div class="page-header">
|
|
<h2>SYSTEM CONFIGURATION</h2>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">DEVICE SETTINGS</div>
|
|
<div class="form-group">
|
|
<label class="form-label">ANTENNA SELECTION</label>
|
|
<select class="form-control" id="antenna-select">
|
|
<option value="internal">INTERNAL</option>
|
|
<option value="external">EXTERNAL</option>
|
|
</select>
|
|
</div>
|
|
<button class="btn" id="save-settings">SAVE SETTINGS</button>
|
|
</div>
|
|
<div class="panel">
|
|
<div class="panel-header">SYSTEM CONTROL</div>
|
|
<button class="btn btn-danger" id="reboot-device">REBOOT DEVICE</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// Chart.js configurations and data
|
|
const charts = {};
|
|
let networkActivityData = { labels: [], datasets: [{ label: 'Networks', data: [], borderColor: '#00ff41', backgroundColor: 'rgba(0,255,65,0.1)' }] };
|
|
let rssiData = { labels: [], datasets: [{ label: 'RSSI Distribution', data: [], backgroundColor: '#00ff41' }] };
|
|
let packetFlowData = { labels: [], datasets: [{ label: 'Packets/sec', data: [], borderColor: '#00d4ff' }] };
|
|
let signalTimeData = { labels: [], datasets: [] };
|
|
let channelUtilData = { labels: [], datasets: [{ label: 'Utilization %', data: [], backgroundColor: '#00ff41' }] };
|
|
|
|
// Initialize charts
|
|
function initCharts() {
|
|
charts.networkActivity = new Chart(document.getElementById('network-activity-chart'), {
|
|
type: 'line',
|
|
data: networkActivityData,
|
|
options: {
|
|
responsive: true,
|
|
maintainAspectRatio: false,
|
|
plugins: {
|
|
legend: { labels: { color: '#00ff41' } }
|
|
},
|
|
scales: {
|
|
x: { ticks: { color: '#00ff41' }, grid: { color: 'rgba(0,255,65,0.1)' } },
|
|
y: { ticks: { color: '#00ff41' }, grid: { color: 'rgba(0,255,65,0.1)' } }
|
|
}
|
|
}
|
|
});
|
|
|
|
charts.rssi = new Chart(document.getElementById('rssi-chart'), {
|
|
type: 'bar',
|
|
data: rssiData,
|
|
options: {
|
|
responsive: true,
|
|
maintainAspectRatio: false,
|
|
plugins: {
|
|
legend: { labels: { color: '#00ff41' } }
|
|
},
|
|
scales: {
|
|
x: { ticks: { color: '#00ff41' }, grid: { color: 'rgba(0,255,65,0.1)' } },
|
|
y: { ticks: { color: '#00ff41' }, grid: { color: 'rgba(0,255,65,0.1)' } }
|
|
}
|
|
}
|
|
});
|
|
|
|
charts.packetFlow = new Chart(document.getElementById('packet-flow-chart'), {
|
|
type: 'line',
|
|
data: packetFlowData,
|
|
options: {
|
|
responsive: true,
|
|
maintainAspectRatio: false,
|
|
plugins: {
|
|
legend: { labels: { color: '#00d4ff' } }
|
|
},
|
|
scales: {
|
|
x: { ticks: { color: '#00d4ff' }, grid: { color: 'rgba(0,212,255,0.1)' } },
|
|
y: { ticks: { color: '#00d4ff' }, grid: { color: 'rgba(0,212,255,0.1)' } }
|
|
}
|
|
}
|
|
});
|
|
|
|
charts.signalTime = new Chart(document.getElementById('signal-time-chart'), {
|
|
type: 'line',
|
|
data: signalTimeData,
|
|
options: {
|
|
responsive: true,
|
|
maintainAspectRatio: false,
|
|
plugins: {
|
|
legend: { labels: { color: '#00ff41' } }
|
|
},
|
|
scales: {
|
|
x: { ticks: { color: '#00ff41' }, grid: { color: 'rgba(0,255,65,0.1)' } },
|
|
y: { ticks: { color: '#00ff41' }, grid: { color: 'rgba(0,255,65,0.1)' } }
|
|
}
|
|
}
|
|
});
|
|
|
|
charts.channelUtil = new Chart(document.getElementById('channel-util-chart'), {
|
|
type: 'bar',
|
|
data: channelUtilData,
|
|
options: {
|
|
responsive: true,
|
|
maintainAspectRatio: false,
|
|
plugins: {
|
|
legend: { labels: { color: '#00ff41' } }
|
|
},
|
|
scales: {
|
|
x: { ticks: { color: '#00ff41' }, grid: { color: 'rgba(0,255,65,0.1)' } },
|
|
y: { ticks: { color: '#00ff41' }, grid: { color: 'rgba(0,255,65,0.1)' }, max: 100 }
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
// Navigation
|
|
document.querySelectorAll('.nav-item').forEach(item => {
|
|
item.addEventListener('click', () => {
|
|
document.querySelectorAll('.nav-item').forEach(i => i.classList.remove('active'));
|
|
item.classList.add('active');
|
|
document.querySelectorAll('.page').forEach(p => p.classList.remove('active'));
|
|
document.getElementById(item.getAttribute('data-page')).classList.add('active');
|
|
});
|
|
});
|
|
|
|
// Initialize on load
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
initCharts();
|
|
loadSystemInfo();
|
|
updateDashboard();
|
|
setInterval(updateDashboard, 1000);
|
|
});
|
|
|
|
// API functions and event handlers would go here...
|
|
// (This is a template - full implementation continues)
|
|
</script>
|
|
</body>
|
|
</html>'''
|
|
|
|
# Write the generated HTML
|
|
with open('enhanced_ui.html', 'w') as f:
|
|
f.write(html_template)
|
|
|
|
print("Enhanced UI generated successfully!")
|
|
print("File: enhanced_ui.html")
|
|
print("Size: {} bytes".format(len(html_template)))
|