peerpigeon 0.1.1 โ 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -1365
- package/cli.js +1382 -0
- package/dist/peerpigeon-browser.js +12290 -0
- package/dist/peerpigeon-browser.js.map +7 -0
- package/docs/API_DOCUMENTATION.md +1945 -0
- package/docs/BOOTSTRAP_HUBS.md +319 -0
- package/docs/CLI_README.md +371 -0
- package/docs/DOCUMENTATION_REORGANIZATION.md +172 -0
- package/docs/HUB_QUICK_REF.md +107 -0
- package/docs/HUB_SCRIPTS.md +331 -0
- package/docs/HUB_SYSTEM.md +552 -0
- package/docs/MIGRATION_COMPLETE.md +93 -0
- package/docs/NETWORK_NAMESPACES.md +212 -0
- package/docs/README.md +107 -0
- package/docs/SELECTIVE_STREAMING_GUIDE.md +427 -0
- package/docs/TEST_CLEANUP_COMPLETE.md +80 -0
- package/examples/bootstrap-hub-example.js +292 -0
- package/examples/browser/README.md +278 -0
- package/examples/browser/app.js +2426 -49
- package/examples/browser/index.html +481 -630
- package/examples/browser/minimal/README.md +55 -0
- package/examples/browser/minimal/index.html +75 -0
- package/examples/browser/minimal/minimal.js +234 -0
- package/examples/browser/styles.css +687 -1425
- package/examples/browser/test-bundle.html +35 -0
- package/examples/browser-2/index.html +30 -0
- package/examples/browser-2/package.json +21 -0
- package/examples/browser-2/src/App-simple.vue +21 -0
- package/examples/browser-2/src/App.vue +420 -0
- package/examples/browser-2/src/components/CryptoView.vue +1661 -0
- package/examples/browser-2/src/components/DHTView.vue +1281 -0
- package/examples/browser-2/src/components/DebugView.vue +1773 -0
- package/examples/browser-2/src/components/MediaView.vue +1048 -0
- package/examples/browser-2/src/components/MessagingView.vue +775 -0
- package/examples/browser-2/src/components/NetworkView.vue +930 -0
- package/examples/browser-2/src/components/StorageView.vue +1376 -0
- package/examples/browser-2/src/main.js +5 -0
- package/examples/browser-2/src/stores/peerpigeon.js +895 -0
- package/examples/browser-2/vite.config.js +6 -0
- package/examples/hub-example.js +186 -0
- package/examples/multi-hub-test.js +186 -0
- package/examples/node/README.md +2 -2
- package/examples/selective-streaming-demo.html +698 -0
- package/examples/standard-events-demo.js +126 -0
- package/package.json +33 -16
- package/server/index.js +1032 -98
- package/server/start.js +49 -0
- package/src/ConnectionManager.js +239 -225
- package/src/CryptoManager.js +147 -18
- package/src/DebugLogger.js +0 -7
- package/src/DistributedStorageManager.js +224 -205
- package/src/EnvironmentDetector.js +109 -2
- package/src/EventEmitter.js +79 -1
- package/src/EvictionManager.js +10 -9
- package/src/GossipManager.js +163 -11
- package/src/PeerConnection.js +333 -310
- package/src/PeerPigeonMesh.js +577 -135
- package/src/SignalingClient.js +14 -243
- package/src/SignalingHandler.js +31 -10
- package/src/StorageManager.js +0 -39
- package/src/WebDHT-Simple.js +389 -0
- package/src/WebDHT.js +363 -1165
- package/src/browser-entry.js +40 -0
- package/examples/browser/assets/images/favicon.png +0 -0
- package/examples/browser/assets/images/pigeon.png +0 -0
- package/examples/browser/crypto-test.html +0 -427
- package/examples/browser/ui-old.js +0 -1926
- package/examples/browser/ui.js +0 -3391
- package/websocket-server/README.md +0 -247
- package/websocket-server/server.js +0 -391
|
@@ -3,750 +3,601 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>PeerPigeon -
|
|
6
|
+
<title>PeerPigeon - Complete API Testing Suite</title>
|
|
7
7
|
<link rel="stylesheet" href="styles.css">
|
|
8
|
-
<link rel="icon" type="image/png" sizes="32x32" href="assets/images/favicon.png">
|
|
9
|
-
<link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon.png">
|
|
10
|
-
<link rel="apple-touch-icon" href="assets/images/favicon.png">
|
|
11
|
-
<link rel="shortcut icon" href="assets/images/favicon.png">
|
|
12
|
-
<!-- Load unsea crypto library from CDN for browser environment -->
|
|
13
|
-
<script src="https://cdn.jsdelivr.net/npm/unsea@1.3.0/dist/sea.min.js"></script>
|
|
8
|
+
<link rel="icon" type="image/png" sizes="32x32" href="../browser/assets/images/favicon.png">
|
|
14
9
|
</head>
|
|
15
10
|
<body>
|
|
16
11
|
<div class="container">
|
|
17
12
|
<header>
|
|
18
|
-
<h1
|
|
19
|
-
<p>
|
|
20
|
-
<div class="
|
|
21
|
-
<strong>
|
|
22
|
-
<
|
|
13
|
+
<h1>๐ฆ PeerPigeon - Complete API Testing Suite</h1>
|
|
14
|
+
<p>Comprehensive browser-based tool for testing all PeerPigeon features</p>
|
|
15
|
+
<div class="peer-info">
|
|
16
|
+
<span><strong>Peer ID:</strong> <code id="peer-id">Initializing...</code></span>
|
|
17
|
+
<span><strong>Status:</strong> <span id="status" class="status disconnected">Disconnected</span></span>
|
|
23
18
|
</div>
|
|
24
19
|
</header>
|
|
25
20
|
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
<nav class="feature-tabs">
|
|
22
|
+
<button class="tab-btn active" data-tab="connection">Connection</button>
|
|
23
|
+
<button class="tab-btn" data-tab="messaging">Messaging</button>
|
|
24
|
+
<button class="tab-btn" data-tab="media">Media</button>
|
|
25
|
+
<button class="tab-btn" data-tab="dht">WebDHT & Storage</button>
|
|
26
|
+
<button class="tab-btn" data-tab="crypto">Encryption</button>
|
|
27
|
+
<button class="tab-btn" data-tab="network">Network Info</button>
|
|
28
|
+
<button class="tab-btn" data-tab="testing">API Testing</button>
|
|
29
|
+
</nav>
|
|
30
|
+
|
|
31
|
+
<!-- Global Message History - Visible across all tabs -->
|
|
32
|
+
<section class="global-message-history">
|
|
33
|
+
<div class="card">
|
|
34
|
+
<h3>๐ฌ Message History</h3>
|
|
35
|
+
<div class="message-filters">
|
|
36
|
+
<select id="message-filter">
|
|
37
|
+
<option value="all">All Messages</option>
|
|
38
|
+
<option value="sent">Sent Messages</option>
|
|
39
|
+
<option value="received">Received Messages</option>
|
|
40
|
+
<option value="broadcast">Broadcast Messages</option>
|
|
41
|
+
<option value="direct">Direct Messages</option>
|
|
42
|
+
<option value="group">Group Messages</option>
|
|
43
|
+
</select>
|
|
44
|
+
<button id="export-messages-btn" class="btn tertiary">๐ฅ Export History</button>
|
|
32
45
|
</div>
|
|
33
|
-
<div class="
|
|
34
|
-
<
|
|
35
|
-
<span id="status" class="status disconnected">Disconnected</span>
|
|
46
|
+
<div id="message-history" class="message-history">
|
|
47
|
+
<p class="empty-state">No messages yet</p>
|
|
36
48
|
</div>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<div class="connection-controls">
|
|
40
|
-
<h2>Connection</h2>
|
|
41
49
|
<div class="button-group">
|
|
42
|
-
<button id="
|
|
43
|
-
<button id="
|
|
44
|
-
<button id="cleanup-btn" class="btn tertiary" disabled>Clean Signaling Data</button>
|
|
45
|
-
<button id="health-check-btn" class="btn quaternary" disabled>Health Check</button>
|
|
46
|
-
<button id="refresh-btn" class="btn quaternary">๐ Refresh Page</button>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<div class="system-messages-container">
|
|
50
|
-
<div id="system-messages" class="system-messages"></div>
|
|
50
|
+
<button id="clear-messages-btn" class="btn tertiary">Clear History</button>
|
|
51
|
+
<button id="refresh-messages-btn" class="btn tertiary">Refresh</button>
|
|
51
52
|
</div>
|
|
52
53
|
</div>
|
|
54
|
+
</section>
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
<main>
|
|
57
|
+
<!-- Connection Management Tab -->
|
|
58
|
+
<section id="connection-tab" class="tab-content active">
|
|
59
|
+
<h2>๐ Connection Management</h2>
|
|
60
|
+
|
|
61
|
+
<div class="card">
|
|
62
|
+
<h3>๐ Network & Signaling Server</h3>
|
|
63
|
+
<div class="input-group">
|
|
64
|
+
<label for="network-name">Network Name:</label>
|
|
65
|
+
<input type="text" id="network-name" value="global" placeholder="global (e.g., 'gaming', 'work', 'family')">
|
|
66
|
+
<small>Create isolated networks or use 'global' for default mesh</small>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="input-group">
|
|
69
|
+
<label for="signaling-url">Server URL:</label>
|
|
70
|
+
<input type="text" id="signaling-url" value="ws://localhost:3000" placeholder="ws://localhost:3000">
|
|
71
|
+
</div>
|
|
72
|
+
<div class="checkbox-group">
|
|
73
|
+
<label><input type="checkbox" id="allow-global-fallback" checked> Allow Global Fallback</label>
|
|
74
|
+
<small>Automatically fallback to global network when current network is empty</small>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="button-group">
|
|
77
|
+
<button id="connect-btn" class="btn primary">Connect</button>
|
|
78
|
+
<button id="disconnect-btn" class="btn secondary" disabled>Disconnect</button>
|
|
79
|
+
<button id="cleanup-btn" class="btn tertiary">Cleanup Stale Data</button>
|
|
80
|
+
</div>
|
|
81
|
+
<div id="network-status" class="network-status" style="display: none;">
|
|
82
|
+
<div class="status-info">
|
|
83
|
+
<span><strong>Current Network:</strong> <span id="current-network">global</span></span>
|
|
84
|
+
<span id="fallback-indicator" style="display: none;" class="fallback-badge">Fallback Mode</span>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="status-info" id="original-network-info" style="display: none;">
|
|
87
|
+
<span><strong>Original Network:</strong> <span id="original-network"></span></span>
|
|
88
|
+
</div>
|
|
66
89
|
</div>
|
|
67
90
|
</div>
|
|
68
|
-
</div>
|
|
69
91
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</button>
|
|
76
|
-
|
|
92
|
+
<div class="card">
|
|
93
|
+
<h3>๐ฏ Quick Network Switch</h3>
|
|
94
|
+
<p class="description">Quickly switch between common networks (only when disconnected)</p>
|
|
95
|
+
<div class="quick-networks">
|
|
96
|
+
<button class="btn tertiary network-btn" data-network="global">Global</button>
|
|
97
|
+
<button class="btn tertiary network-btn" data-network="gaming">Gaming</button>
|
|
98
|
+
<button class="btn tertiary network-btn" data-network="work">Work</button>
|
|
99
|
+
<button class="btn tertiary network-btn" data-network="family">Family</button>
|
|
100
|
+
<button class="btn tertiary network-btn" data-network="test">Test</button>
|
|
101
|
+
</div>
|
|
77
102
|
</div>
|
|
78
|
-
<div id="media-content" class="collapsible-content" style="display: none;">
|
|
79
|
-
<div class="media-controls">
|
|
80
|
-
<div class="input-group">
|
|
81
|
-
<label>Media Types:</label>
|
|
82
|
-
<div class="checkbox-group">
|
|
83
|
-
<label class="checkbox-label">
|
|
84
|
-
<input type="checkbox" id="enable-video">
|
|
85
|
-
<span class="checkmark"></span>
|
|
86
|
-
Enable Video
|
|
87
|
-
</label>
|
|
88
|
-
<label class="checkbox-label">
|
|
89
|
-
<input type="checkbox" id="enable-audio">
|
|
90
|
-
<span class="checkmark"></span>
|
|
91
|
-
Enable Audio
|
|
92
|
-
</label>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
103
|
|
|
104
|
+
<div class="card">
|
|
105
|
+
<h3>Mesh Configuration</h3>
|
|
106
|
+
<div class="config-grid">
|
|
96
107
|
<div class="input-group">
|
|
97
|
-
<label for="
|
|
98
|
-
<
|
|
99
|
-
<option value="">Select camera...</option>
|
|
100
|
-
</select>
|
|
108
|
+
<label for="max-peers">Max Peers:</label>
|
|
109
|
+
<input type="number" id="max-peers" value="3" min="1" max="10">
|
|
101
110
|
</div>
|
|
102
|
-
|
|
103
111
|
<div class="input-group">
|
|
104
|
-
<label for="
|
|
105
|
-
<
|
|
106
|
-
<option value="">Select microphone...</option>
|
|
107
|
-
</select>
|
|
112
|
+
<label for="min-peers">Min Peers:</label>
|
|
113
|
+
<input type="number" id="min-peers" value="2" min="1" max="10">
|
|
108
114
|
</div>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
<
|
|
112
|
-
<
|
|
113
|
-
<
|
|
114
|
-
<button id="toggle-audio-btn" class="btn tertiary" disabled>Toggle Audio</button>
|
|
115
|
-
<button id="test-audio-btn" class="btn warning">๐ Test Audio</button>
|
|
115
|
+
<div class="checkbox-group">
|
|
116
|
+
<label><input type="checkbox" id="auto-connect" checked> Auto Connect</label>
|
|
117
|
+
<label><input type="checkbox" id="auto-discovery" checked> Auto Discovery</label>
|
|
118
|
+
<label><input type="checkbox" id="eviction-strategy" checked> Eviction Strategy</label>
|
|
119
|
+
<label><input type="checkbox" id="xor-routing" checked> XOR Routing</label>
|
|
116
120
|
</div>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<
|
|
120
|
-
<
|
|
121
|
-
<p class="video-placeholder">No video stream</p>
|
|
122
|
-
</div>
|
|
121
|
+
<div class="checkbox-group">
|
|
122
|
+
<label><input type="checkbox" id="enable-crypto" checked> Enable Crypto</label>
|
|
123
|
+
<label><input type="checkbox" id="enable-webdht" checked> Enable WebDHT</label>
|
|
124
|
+
<label><input type="checkbox" id="enable-distributed-storage" checked> Enable Distributed Storage</label>
|
|
123
125
|
</div>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
<
|
|
127
|
-
<
|
|
128
|
-
<p class="video-placeholder">No remote video streams</p>
|
|
129
|
-
</div>
|
|
126
|
+
<div class="checkbox-group">
|
|
127
|
+
<label><input type="checkbox" id="enable-gossip"> Disable Gossip Protocol</label>
|
|
128
|
+
<label><input type="checkbox" id="enable-hole-punching"> Disable Hole Punching</label>
|
|
129
|
+
<label><input type="checkbox" id="enable-backup-connections"> Disable Backup Connections</label>
|
|
130
130
|
</div>
|
|
131
131
|
</div>
|
|
132
|
+
<button id="apply-config-btn" class="btn tertiary">Apply Configuration</button>
|
|
133
|
+
<button id="get-current-config-btn" class="btn tertiary">Show Current Config</button>
|
|
132
134
|
</div>
|
|
133
|
-
</div>
|
|
134
135
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
<
|
|
138
|
-
<
|
|
139
|
-
โถ Discovered Peers
|
|
140
|
-
</button>
|
|
141
|
-
<span id="discovered-peers-count" class="count-badge">0</span>
|
|
142
|
-
</h2>
|
|
143
|
-
</div>
|
|
144
|
-
<div id="discovered-peers-content" class="collapsible-content" style="display: none;">
|
|
145
|
-
<div id="discovered-peers-list" class="discovered-peers-list">
|
|
146
|
-
<p class="empty-state">No peers discovered</p>
|
|
136
|
+
<div class="card">
|
|
137
|
+
<h3>Connected Peers (<span id="peer-count">0</span>)</h3>
|
|
138
|
+
<div id="peers-list" class="peers-list">
|
|
139
|
+
<p class="empty-state">No peers connected</p>
|
|
147
140
|
</div>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
<div class="section-header">
|
|
153
|
-
<h2>
|
|
154
|
-
<button id="manual-connection-toggle" class="toggle-btn" aria-expanded="false">
|
|
155
|
-
โถ Manual Connection
|
|
156
|
-
</button>
|
|
157
|
-
</h2>
|
|
158
|
-
</div>
|
|
159
|
-
<div id="manual-connection-content" class="collapsible-content" style="display: none;">
|
|
160
|
-
<div class="input-group">
|
|
161
|
-
<label for="target-peer">Target Peer ID (40-character SHA-1 hash):</label>
|
|
162
|
-
<div class="input-group horizontal">
|
|
163
|
-
<input type="text" id="target-peer"
|
|
164
|
-
placeholder="Enter 40-character SHA-1 hash"
|
|
165
|
-
maxlength="40"
|
|
166
|
-
pattern="[a-fA-F0-9]{40}">
|
|
167
|
-
<button id="connect-peer-btn" class="btn secondary">Connect to Peer</button>
|
|
168
|
-
</div>
|
|
169
|
-
<small class="input-help">
|
|
170
|
-
Manually connect to a specific peer ID
|
|
171
|
-
</small>
|
|
141
|
+
<div class="peer-actions">
|
|
142
|
+
<input type="text" id="manual-peer-id" placeholder="Enter peer ID to connect">
|
|
143
|
+
<button id="connect-peer-btn" class="btn tertiary">Connect to Peer</button>
|
|
144
|
+
<button id="force-connect-all-btn" class="btn tertiary">Force Connect All</button>
|
|
172
145
|
</div>
|
|
173
146
|
</div>
|
|
174
|
-
</
|
|
175
|
-
|
|
176
|
-
<div class="settings" aria-expanded="false">
|
|
177
|
-
<div class="section-header">
|
|
178
|
-
<h2>
|
|
179
|
-
<button id="settings-toggle" class="toggle-btn" aria-expanded="false">
|
|
180
|
-
โถ Settings
|
|
181
|
-
</button>
|
|
182
|
-
</h2>
|
|
183
|
-
</div>
|
|
184
|
-
<div id="settings-content" class="collapsible-content" style="display: none;">
|
|
185
|
-
<div class="input-group">
|
|
186
|
-
<label for="signaling-url">Signaling Server URL:</label>
|
|
187
|
-
<input type="url" id="signaling-url"
|
|
188
|
-
placeholder="ws://localhost:3000">
|
|
189
|
-
<small class="input-help">
|
|
190
|
-
Auto-populated from ?api, ?url, or ?signaling query parameters. Enter base API Gateway URL (without /signaling path).
|
|
191
|
-
</small>
|
|
192
|
-
</div>
|
|
193
|
-
<div class="input-group">
|
|
194
|
-
<label for="min-peers">Minimum Peers:</label>
|
|
195
|
-
<input type="number" id="min-peers"
|
|
196
|
-
min="0" max="49" value="2"
|
|
197
|
-
placeholder="Minimum peer connections to maintain">
|
|
198
|
-
<small class="input-help">
|
|
199
|
-
Minimum peer connections to maintain (0-49, default: 2)
|
|
200
|
-
</small>
|
|
201
|
-
</div>
|
|
202
|
-
<div class="input-group">
|
|
203
|
-
<label for="max-peers">Maximum Peers:</label>
|
|
204
|
-
<input type="number" id="max-peers"
|
|
205
|
-
min="1" max="50" value="10"
|
|
206
|
-
placeholder="Maximum number of peer connections">
|
|
207
|
-
<small class="input-help">
|
|
208
|
-
Limit concurrent peer connections (1-50, default: 10)
|
|
209
|
-
</small>
|
|
210
|
-
</div>
|
|
211
|
-
<div class="auto-discovery-control">
|
|
212
|
-
<label class="checkbox-label">
|
|
213
|
-
<input type="checkbox" id="xor-routing-toggle" checked>
|
|
214
|
-
<span class="checkmark"></span>
|
|
215
|
-
Enable XOR-based routing
|
|
216
|
-
</label>
|
|
217
|
-
<small class="input-help">
|
|
218
|
-
Use XOR distance for peer selection and routing optimization
|
|
219
|
-
</small>
|
|
220
|
-
</div>
|
|
221
|
-
<div class="auto-discovery-control">
|
|
222
|
-
<label class="checkbox-label">
|
|
223
|
-
<input type="checkbox" id="auto-discovery-toggle" checked>
|
|
224
|
-
<span class="checkmark"></span>
|
|
225
|
-
Enable automatic peer discovery
|
|
226
|
-
</label>
|
|
227
|
-
<small class="input-help">
|
|
228
|
-
Automatically discover and connect to nearby peers
|
|
229
|
-
</small>
|
|
230
|
-
</div>
|
|
231
|
-
<div class="auto-discovery-control">
|
|
232
|
-
<label class="checkbox-label">
|
|
233
|
-
<input type="checkbox" id="eviction-strategy-toggle" checked>
|
|
234
|
-
<span class="checkmark"></span>
|
|
235
|
-
Enable smart eviction strategy
|
|
236
|
-
</label>
|
|
237
|
-
<small class="input-help">
|
|
238
|
-
Automatically manage peer connections when at capacity
|
|
239
|
-
</small>
|
|
240
|
-
</div>
|
|
241
|
-
<div class="auto-discovery-control">
|
|
242
|
-
<label class="checkbox-label">
|
|
243
|
-
<input type="checkbox" id="webdht-toggle" checked disabled>
|
|
244
|
-
<span class="checkmark"></span>
|
|
245
|
-
Enable WebDHT (Distributed Hash Table)
|
|
246
|
-
</label>
|
|
247
|
-
<small class="input-help">
|
|
248
|
-
WebDHT status (configured at startup, restart required to change)
|
|
249
|
-
</small>
|
|
250
|
-
</div>
|
|
251
|
-
</div>
|
|
252
|
-
</div>
|
|
147
|
+
</section>
|
|
253
148
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
</
|
|
261
|
-
|
|
262
|
-
<div id="dht-content" class="collapsible-content" style="display: none;">
|
|
263
|
-
<div class="dht-actions">
|
|
264
|
-
<h3>Store Data</h3>
|
|
265
|
-
<div class="input-group">
|
|
266
|
-
<label for="dht-key">Key:</label>
|
|
267
|
-
<input type="text" id="dht-key" placeholder="Enter key (e.g., 'user:123', 'config:theme')">
|
|
268
|
-
</div>
|
|
149
|
+
<!-- Messaging Tab -->
|
|
150
|
+
<section id="messaging-tab" class="tab-content">
|
|
151
|
+
<h2>๐ฌ Messaging & Communication</h2>
|
|
152
|
+
|
|
153
|
+
<div class="card">
|
|
154
|
+
<h3>๐ข Broadcast Messages</h3>
|
|
155
|
+
<p class="description">Send messages to all connected peers in the mesh</p>
|
|
156
|
+
<div class="message-input">
|
|
269
157
|
<div class="input-group">
|
|
270
|
-
<label for="
|
|
271
|
-
<textarea id="
|
|
158
|
+
<label for="broadcast-message">Broadcast Message:</label>
|
|
159
|
+
<textarea id="broadcast-message" placeholder="Enter your broadcast message..." rows="3"></textarea>
|
|
272
160
|
</div>
|
|
273
|
-
<div class="
|
|
274
|
-
<label
|
|
275
|
-
|
|
276
|
-
<span class="checkmark"></span>
|
|
277
|
-
Enable expiration (TTL)
|
|
278
|
-
</label>
|
|
279
|
-
<small class="input-help">
|
|
280
|
-
Check to set an expiration time, unchecked = records persist forever
|
|
281
|
-
</small>
|
|
282
|
-
</div>
|
|
283
|
-
<div class="input-group" id="dht-ttl-group" style="display: none;">
|
|
284
|
-
<label for="dht-ttl">TTL (seconds):</label>
|
|
285
|
-
<input type="number" id="dht-ttl" placeholder="Time to live" min="1" max="2592000" value="3600">
|
|
286
|
-
<small class="input-help">
|
|
287
|
-
Time until record expires (e.g., 3600 = 1 hour, 86400 = 1 day)
|
|
288
|
-
</small>
|
|
161
|
+
<div class="message-options">
|
|
162
|
+
<label><input type="checkbox" id="encrypt-broadcast" checked> Encrypt Message</label>
|
|
163
|
+
<label><input type="checkbox" id="high-priority-broadcast"> High Priority</label>
|
|
289
164
|
</div>
|
|
290
165
|
<div class="button-group">
|
|
291
|
-
<button id="
|
|
292
|
-
<button id="
|
|
166
|
+
<button id="send-broadcast-btn" class="btn primary">๐ข Send Broadcast</button>
|
|
167
|
+
<button id="send-anonymous-btn" class="btn secondary">๐ญ Send Anonymous</button>
|
|
293
168
|
</div>
|
|
294
169
|
</div>
|
|
170
|
+
</div>
|
|
295
171
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
172
|
+
<div class="card">
|
|
173
|
+
<h3>๐ง Direct Messages</h3>
|
|
174
|
+
<p class="description">Send private messages to specific peers</p>
|
|
175
|
+
<div class="message-input">
|
|
176
|
+
<div class="input-group">
|
|
177
|
+
<label for="target-peer">Target Peer:</label>
|
|
178
|
+
<select id="target-peer-select">
|
|
179
|
+
<option value="">Select a connected peer...</option>
|
|
180
|
+
</select>
|
|
181
|
+
<input type="text" id="target-peer" placeholder="Or enter peer ID manually">
|
|
301
182
|
</div>
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
<h3>Subscribe to Changes</h3>
|
|
306
|
-
<div class="input-group horizontal">
|
|
307
|
-
<input type="text" id="dht-subscribe-key" placeholder="Key to watch for changes">
|
|
308
|
-
<div class="button-group">
|
|
309
|
-
<button id="dht-subscribe-btn" class="btn tertiary">Subscribe</button>
|
|
310
|
-
<button id="dht-clear-subscriptions-btn" class="btn quaternary">Clear All</button>
|
|
311
|
-
</div>
|
|
183
|
+
<div class="input-group">
|
|
184
|
+
<label for="direct-message">Private Message:</label>
|
|
185
|
+
<textarea id="direct-message" placeholder="Enter your direct message..." rows="3"></textarea>
|
|
312
186
|
</div>
|
|
313
|
-
<div
|
|
314
|
-
<
|
|
315
|
-
<
|
|
316
|
-
|
|
317
|
-
|
|
187
|
+
<div class="message-options">
|
|
188
|
+
<label><input type="checkbox" id="encrypt-direct" checked> Encrypt Message</label>
|
|
189
|
+
<label><input type="checkbox" id="request-receipt"> Request Read Receipt</label>
|
|
190
|
+
<label><input type="checkbox" id="ephemeral-message"> Ephemeral (Auto-delete)</label>
|
|
191
|
+
</div>
|
|
192
|
+
<div class="button-group">
|
|
193
|
+
<button id="send-direct-btn" class="btn primary">๐ง Send Direct Message</button>
|
|
194
|
+
<button id="send-file-btn" class="btn secondary">๐ Send File</button>
|
|
318
195
|
</div>
|
|
319
|
-
</div>
|
|
320
|
-
|
|
321
|
-
<div class="dht-results">
|
|
322
|
-
<h3>DHT Operations Log</h3>
|
|
323
|
-
<div id="dht-log" class="dht-log"></div>
|
|
324
196
|
</div>
|
|
325
197
|
</div>
|
|
326
|
-
</div>
|
|
327
198
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
<
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
</div>
|
|
336
|
-
<div id="crypto-content" class="collapsible-content" style="display: none;">
|
|
337
|
-
<!-- Crypto Status -->
|
|
338
|
-
<div class="crypto-status">
|
|
339
|
-
<h3>Crypto Status</h3>
|
|
340
|
-
<div class="info-group">
|
|
341
|
-
<label>Encryption:</label>
|
|
342
|
-
<span id="crypto-status" class="status">Disabled</span>
|
|
199
|
+
<div class="card">
|
|
200
|
+
<h3>๐ฌ Group Chat</h3>
|
|
201
|
+
<p class="description">Create and manage group conversations</p>
|
|
202
|
+
<div class="group-controls">
|
|
203
|
+
<div class="input-group">
|
|
204
|
+
<label for="group-name">Group Name:</label>
|
|
205
|
+
<input type="text" id="group-name" placeholder="Enter group name">
|
|
343
206
|
</div>
|
|
344
|
-
<div class="
|
|
345
|
-
<label>
|
|
346
|
-
<
|
|
207
|
+
<div class="input-group">
|
|
208
|
+
<label for="group-members">Members (comma-separated peer IDs):</label>
|
|
209
|
+
<textarea id="group-members" placeholder="peer1,peer2,peer3..." rows="2"></textarea>
|
|
347
210
|
</div>
|
|
348
|
-
<div class="
|
|
349
|
-
<
|
|
350
|
-
<
|
|
211
|
+
<div class="button-group">
|
|
212
|
+
<button id="create-group-btn" class="btn primary">Create Group</button>
|
|
213
|
+
<button id="join-group-btn" class="btn secondary">Join Group</button>
|
|
214
|
+
<button id="leave-group-btn" class="btn tertiary">Leave Group</button>
|
|
215
|
+
</div>
|
|
216
|
+
<div class="input-group">
|
|
217
|
+
<label for="group-message">Group Message:</label>
|
|
218
|
+
<textarea id="group-message" placeholder="Enter group message..." rows="3"></textarea>
|
|
219
|
+
<button id="send-group-btn" class="btn primary">Send to Group</button>
|
|
351
220
|
</div>
|
|
352
221
|
</div>
|
|
222
|
+
</div>
|
|
223
|
+
</section>
|
|
353
224
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
225
|
+
<!-- Media Tab -->
|
|
226
|
+
<section id="media-tab" class="tab-content">
|
|
227
|
+
<h2>๐ฅ Media Management</h2>
|
|
228
|
+
|
|
229
|
+
<div class="card">
|
|
230
|
+
<h3>Local Media</h3>
|
|
231
|
+
<div class="media-controls">
|
|
232
|
+
<div class="checkbox-group">
|
|
233
|
+
<label><input type="checkbox" id="enable-video"> Enable Video</label>
|
|
234
|
+
<label><input type="checkbox" id="enable-audio"> Enable Audio</label>
|
|
361
235
|
</div>
|
|
362
|
-
|
|
363
|
-
<div class="crypto-user-auth">
|
|
364
|
-
<h4>User Authentication (Optional)</h4>
|
|
236
|
+
<div class="device-selectors">
|
|
365
237
|
<div class="input-group">
|
|
366
|
-
<label for="
|
|
367
|
-
<
|
|
238
|
+
<label for="camera-select">Camera:</label>
|
|
239
|
+
<select id="camera-select">
|
|
240
|
+
<option value="">Select camera...</option>
|
|
241
|
+
</select>
|
|
368
242
|
</div>
|
|
369
243
|
<div class="input-group">
|
|
370
|
-
<label for="
|
|
371
|
-
<
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
<button id="crypto-login-btn" class="btn secondary">Login/Create Account</button>
|
|
244
|
+
<label for="microphone-select">Microphone:</label>
|
|
245
|
+
<select id="microphone-select">
|
|
246
|
+
<option value="">Select microphone...</option>
|
|
247
|
+
</select>
|
|
375
248
|
</div>
|
|
376
249
|
</div>
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
<h3>Encrypted Messaging</h3>
|
|
382
|
-
<div class="input-group">
|
|
383
|
-
<label class="checkbox-label">
|
|
384
|
-
<input type="checkbox" id="crypto-auto-encrypt">
|
|
385
|
-
<span class="checkmark"></span>
|
|
386
|
-
Auto-encrypt outgoing messages
|
|
387
|
-
</label>
|
|
250
|
+
<div class="button-group">
|
|
251
|
+
<button id="start-media-btn" class="btn primary">Start Media</button>
|
|
252
|
+
<button id="stop-media-btn" class="btn secondary" disabled>Stop Media</button>
|
|
253
|
+
<button id="enumerate-devices-btn" class="btn tertiary">Refresh Devices</button>
|
|
388
254
|
</div>
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
<
|
|
392
|
-
<div class="input-group horizontal">
|
|
393
|
-
<input type="text" id="crypto-test-message" placeholder="Test message to encrypt">
|
|
394
|
-
<input type="text" id="crypto-test-peer" placeholder="Target peer ID" maxlength="40">
|
|
395
|
-
<button id="crypto-send-encrypted-btn" class="btn primary">Send Encrypted</button>
|
|
396
|
-
</div>
|
|
255
|
+
<div class="media-toggle">
|
|
256
|
+
<button id="toggle-video-btn" class="btn tertiary" disabled>Toggle Video</button>
|
|
257
|
+
<button id="toggle-audio-btn" class="btn tertiary" disabled>Toggle Audio</button>
|
|
397
258
|
</div>
|
|
398
259
|
</div>
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
<h3>Group Encryption</h3>
|
|
403
|
-
<div class="input-group horizontal">
|
|
404
|
-
<input type="text" id="crypto-group-id" placeholder="Group ID (e.g., 'chat-room-1')">
|
|
405
|
-
<button id="crypto-create-group-btn" class="btn secondary">Create Group Key</button>
|
|
406
|
-
</div>
|
|
407
|
-
|
|
408
|
-
<div class="crypto-group-messaging">
|
|
409
|
-
<div class="input-group horizontal">
|
|
410
|
-
<input type="text" id="crypto-group-message" placeholder="Group message">
|
|
411
|
-
<select id="crypto-group-select">
|
|
412
|
-
<option value="">Select group...</option>
|
|
413
|
-
</select>
|
|
414
|
-
<button id="crypto-send-group-btn" class="btn primary">Send to Group</button>
|
|
415
|
-
</div>
|
|
416
|
-
</div>
|
|
417
|
-
|
|
418
|
-
<div id="crypto-groups-list" class="crypto-groups-list">
|
|
419
|
-
<h4>Active Groups:</h4>
|
|
420
|
-
<div class="empty-state">No groups created</div>
|
|
421
|
-
</div>
|
|
260
|
+
<div class="media-preview">
|
|
261
|
+
<video id="local-video" autoplay muted playsinline style="display: none;"></video>
|
|
262
|
+
<div id="media-status" class="media-status">No active media stream</div>
|
|
422
263
|
</div>
|
|
264
|
+
</div>
|
|
423
265
|
|
|
424
|
-
|
|
425
|
-
<
|
|
426
|
-
|
|
427
|
-
<
|
|
428
|
-
<div class="stat-item">
|
|
429
|
-
<label>Messages Encrypted:</label>
|
|
430
|
-
<span id="crypto-stats-encrypted">0</span>
|
|
431
|
-
</div>
|
|
432
|
-
<div class="stat-item">
|
|
433
|
-
<label>Messages Decrypted:</label>
|
|
434
|
-
<span id="crypto-stats-decrypted">0</span>
|
|
435
|
-
</div>
|
|
436
|
-
<div class="stat-item">
|
|
437
|
-
<label>Encryption Time (avg):</label>
|
|
438
|
-
<span id="crypto-stats-encrypt-time">0ms</span>
|
|
439
|
-
</div>
|
|
440
|
-
<div class="stat-item">
|
|
441
|
-
<label>Decryption Time (avg):</label>
|
|
442
|
-
<span id="crypto-stats-decrypt-time">0ms</span>
|
|
443
|
-
</div>
|
|
444
|
-
<div class="stat-item">
|
|
445
|
-
<label>Key Exchanges:</label>
|
|
446
|
-
<span id="crypto-stats-key-exchanges">0</span>
|
|
447
|
-
</div>
|
|
448
|
-
</div>
|
|
266
|
+
<div class="card">
|
|
267
|
+
<h3>Remote Streams</h3>
|
|
268
|
+
<div id="remote-streams" class="remote-streams">
|
|
269
|
+
<p class="empty-state">No remote streams</p>
|
|
449
270
|
</div>
|
|
271
|
+
</div>
|
|
450
272
|
|
|
451
|
-
|
|
452
|
-
<
|
|
453
|
-
|
|
454
|
-
<div id="
|
|
455
|
-
|
|
456
|
-
</div>
|
|
273
|
+
<div class="card">
|
|
274
|
+
<h3>Media Information</h3>
|
|
275
|
+
<div id="media-info" class="info-display">
|
|
276
|
+
<div>Local Stream: <span id="local-stream-status">None</span></div>
|
|
277
|
+
<div>Video Enabled: <span id="video-enabled-status">No</span></div>
|
|
278
|
+
<div>Audio Enabled: <span id="audio-enabled-status">No</span></div>
|
|
279
|
+
<div>Active Camera: <span id="active-camera">None</span></div>
|
|
280
|
+
<div>Active Microphone: <span id="active-microphone">None</span></div>
|
|
457
281
|
</div>
|
|
282
|
+
</div>
|
|
283
|
+
</section>
|
|
458
284
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
285
|
+
<!-- WebDHT & Storage Tab -->
|
|
286
|
+
<section id="dht-tab" class="tab-content">
|
|
287
|
+
<h2>๐๏ธ WebDHT (Low-Level DHT)</h2>
|
|
288
|
+
<p class="description">Low-level distributed hash table for raw key-value storage without encryption or access control</p>
|
|
289
|
+
|
|
290
|
+
<div class="card">
|
|
291
|
+
<h3>Store Raw Data</h3>
|
|
292
|
+
<div class="dht-form">
|
|
293
|
+
<div class="input-group">
|
|
294
|
+
<label for="dht-key">Key:</label>
|
|
295
|
+
<input type="text" id="dht-key" placeholder="Enter raw storage key">
|
|
466
296
|
</div>
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
</
|
|
478
|
-
<div class="button-group">
|
|
479
|
-
<button id="crypto-import-confirm-btn" class="btn primary">Import Key</button>
|
|
480
|
-
<button id="crypto-import-cancel-btn" class="btn secondary">Cancel</button>
|
|
481
|
-
</div>
|
|
297
|
+
<div class="input-group">
|
|
298
|
+
<label for="dht-value">Value (JSON):</label>
|
|
299
|
+
<textarea id="dht-value" placeholder='{"example": "data"}' rows="3"></textarea>
|
|
300
|
+
</div>
|
|
301
|
+
<div class="input-group">
|
|
302
|
+
<label for="dht-ttl">TTL (ms, optional):</label>
|
|
303
|
+
<input type="number" id="dht-ttl" placeholder="Time to live in milliseconds">
|
|
304
|
+
</div>
|
|
305
|
+
<div class="button-group">
|
|
306
|
+
<button id="dht-put-btn" class="btn primary">Store Data</button>
|
|
307
|
+
<button id="dht-update-btn" class="btn secondary">Update Data</button>
|
|
482
308
|
</div>
|
|
483
309
|
</div>
|
|
484
310
|
</div>
|
|
485
|
-
</div>
|
|
486
311
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
<
|
|
490
|
-
<
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
312
|
+
<div class="card">
|
|
313
|
+
<h3>Retrieve Data</h3>
|
|
314
|
+
<div class="input-group">
|
|
315
|
+
<label for="dht-get-key">Key:</label>
|
|
316
|
+
<input type="text" id="dht-get-key" placeholder="Enter key to retrieve">
|
|
317
|
+
</div>
|
|
318
|
+
<div class="button-group">
|
|
319
|
+
<button id="dht-get-btn" class="btn primary">Get Data</button>
|
|
320
|
+
<button id="dht-delete-btn" class="btn danger">Delete Key</button>
|
|
321
|
+
</div>
|
|
322
|
+
<div id="dht-result" class="result-display"></div>
|
|
494
323
|
</div>
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
<
|
|
498
|
-
|
|
499
|
-
<
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
<
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
<
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
324
|
+
|
|
325
|
+
<div class="card">
|
|
326
|
+
<h3>Subscriptions</h3>
|
|
327
|
+
<div class="input-group">
|
|
328
|
+
<label for="dht-subscribe-key">Key to Subscribe:</label>
|
|
329
|
+
<input type="text" id="dht-subscribe-key" placeholder="Enter key to monitor">
|
|
330
|
+
</div>
|
|
331
|
+
<div class="button-group">
|
|
332
|
+
<button id="dht-subscribe-btn" class="btn primary">Subscribe</button>
|
|
333
|
+
<button id="dht-unsubscribe-btn" class="btn secondary">Unsubscribe</button>
|
|
334
|
+
</div>
|
|
335
|
+
<div id="dht-subscriptions" class="subscriptions-list">
|
|
336
|
+
<p class="empty-state">No active subscriptions</p>
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
339
|
+
|
|
340
|
+
<div class="card">
|
|
341
|
+
<h3>DHT Activity Log</h3>
|
|
342
|
+
<div id="dht-log" class="activity-log">
|
|
343
|
+
<p class="empty-state">No DHT activity yet</p>
|
|
511
344
|
</div>
|
|
345
|
+
<button id="clear-dht-log-btn" class="btn tertiary">Clear Log</button>
|
|
346
|
+
</div>
|
|
512
347
|
|
|
513
|
-
|
|
348
|
+
<div class="card">
|
|
349
|
+
<h3>๐๏ธ Distributed Storage (High-Level)</h3>
|
|
350
|
+
<p class="description">High-level storage with encryption, access control, and storage spaces - built on top of WebDHT</p>
|
|
351
|
+
|
|
514
352
|
<div class="storage-controls">
|
|
515
|
-
<h3>Storage Controls</h3>
|
|
516
353
|
<div class="button-group">
|
|
517
354
|
<button id="storage-enable-btn" class="btn primary">Enable Storage</button>
|
|
518
|
-
<button id="storage-disable-btn" class="btn
|
|
519
|
-
<button id="storage-
|
|
520
|
-
</div>
|
|
521
|
-
</div>
|
|
522
|
-
|
|
523
|
-
<!-- Store Data -->
|
|
524
|
-
<div class="storage-operations">
|
|
525
|
-
<h3>Store Data</h3>
|
|
526
|
-
<div class="input-group">
|
|
527
|
-
<label for="storage-key">Key:</label>
|
|
528
|
-
<input type="text" id="storage-key" placeholder="Storage key">
|
|
529
|
-
</div>
|
|
530
|
-
<div class="input-group">
|
|
531
|
-
<label for="storage-value">Value:</label>
|
|
532
|
-
<textarea id="storage-value" placeholder="Data to store (JSON or text)" rows="3"></textarea>
|
|
355
|
+
<button id="storage-disable-btn" class="btn secondary">Disable Storage</button>
|
|
356
|
+
<button id="storage-status-btn" class="btn tertiary">Get Status</button>
|
|
533
357
|
</div>
|
|
534
358
|
|
|
535
|
-
|
|
536
|
-
<div class="storage-options">
|
|
537
|
-
<h4>Storage Options</h4>
|
|
538
|
-
<div class="input-group">
|
|
539
|
-
<label class="checkbox-label">
|
|
540
|
-
<input type="checkbox" id="storage-encrypt" checked>
|
|
541
|
-
<span class="checkmark"></span>
|
|
542
|
-
Encrypt data
|
|
543
|
-
</label>
|
|
544
|
-
</div>
|
|
359
|
+
<div class="storage-form">
|
|
545
360
|
<div class="input-group">
|
|
546
|
-
<label
|
|
547
|
-
|
|
548
|
-
<span class="checkmark"></span>
|
|
549
|
-
Public access (readable by anyone)
|
|
550
|
-
</label>
|
|
361
|
+
<label for="storage-key">Storage Key:</label>
|
|
362
|
+
<input type="text" id="storage-key" placeholder="Enter unique storage key">
|
|
551
363
|
</div>
|
|
552
364
|
<div class="input-group">
|
|
553
|
-
<label
|
|
554
|
-
|
|
555
|
-
<span class="checkmark"></span>
|
|
556
|
-
Immutable (cannot be updated)
|
|
557
|
-
</label>
|
|
365
|
+
<label for="storage-data">Data (JSON):</label>
|
|
366
|
+
<textarea id="storage-data" placeholder='{"persistent": "data"}' rows="3"></textarea>
|
|
558
367
|
</div>
|
|
559
368
|
<div class="input-group">
|
|
560
|
-
<label
|
|
561
|
-
|
|
562
|
-
<
|
|
563
|
-
|
|
564
|
-
|
|
369
|
+
<label for="storage-space">Storage Space:</label>
|
|
370
|
+
<select id="storage-space">
|
|
371
|
+
<option value="private">Private (encrypted, owner-only)</option>
|
|
372
|
+
<option value="public">Public (unencrypted, readable by all)</option>
|
|
373
|
+
<option value="frozen">Frozen (immutable, readable by all)</option>
|
|
374
|
+
</select>
|
|
565
375
|
</div>
|
|
566
|
-
<div class="
|
|
567
|
-
<
|
|
568
|
-
<
|
|
376
|
+
<div class="button-group">
|
|
377
|
+
<button id="storage-put-btn" class="btn primary">Store Data</button>
|
|
378
|
+
<button id="storage-get-btn" class="btn secondary">Retrieve Data</button>
|
|
379
|
+
<button id="storage-delete-btn" class="btn danger">Delete Data</button>
|
|
569
380
|
</div>
|
|
570
381
|
</div>
|
|
571
382
|
|
|
572
|
-
<div class="
|
|
573
|
-
<
|
|
574
|
-
|
|
383
|
+
<div class="storage-management">
|
|
384
|
+
<div class="button-group">
|
|
385
|
+
<button id="storage-list-btn" class="btn tertiary">List All Keys</button>
|
|
386
|
+
<button id="storage-stats-btn" class="btn tertiary">Storage Stats</button>
|
|
387
|
+
<button id="storage-clear-btn" class="btn danger">Clear All Storage</button>
|
|
388
|
+
</div>
|
|
575
389
|
</div>
|
|
576
390
|
</div>
|
|
391
|
+
|
|
392
|
+
<div id="storage-result" class="result-display"></div>
|
|
393
|
+
|
|
394
|
+
<div class="card">
|
|
395
|
+
<h4>Storage Activity Log</h4>
|
|
396
|
+
<div id="storage-log" class="activity-log">
|
|
397
|
+
<p class="empty-state">No storage activity yet</p>
|
|
398
|
+
</div>
|
|
399
|
+
<button id="clear-storage-log-btn" class="btn tertiary">Clear Storage Log</button>
|
|
400
|
+
</div>
|
|
401
|
+
</div>
|
|
402
|
+
</section>
|
|
577
403
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
</div>
|
|
404
|
+
<!-- Encryption Tab -->
|
|
405
|
+
<section id="crypto-tab" class="tab-content">
|
|
406
|
+
<h2>๐ Encryption & Security</h2>
|
|
407
|
+
|
|
408
|
+
<div class="card">
|
|
409
|
+
<h3>Crypto Status</h3>
|
|
410
|
+
<div id="crypto-status" class="info-display">
|
|
411
|
+
<div>Crypto Enabled: <span id="crypto-enabled-status">Unknown</span></div>
|
|
412
|
+
<div>Public Key: <span id="public-key-display">Not available</span></div>
|
|
413
|
+
<div>Key Exchanges: <span id="key-exchanges-count">0</span></div>
|
|
586
414
|
</div>
|
|
415
|
+
<div class="button-group">
|
|
416
|
+
<button id="refresh-crypto-status-btn" class="btn tertiary">Refresh Status</button>
|
|
417
|
+
<button id="force-crypto-init-btn" class="btn secondary">Force Crypto Init</button>
|
|
418
|
+
<button id="exchange-keys-btn" class="btn primary">Exchange Keys</button>
|
|
419
|
+
</div>
|
|
420
|
+
</div>
|
|
587
421
|
|
|
588
|
-
|
|
589
|
-
<
|
|
590
|
-
|
|
591
|
-
<
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
<option value="admin">Admin</option>
|
|
598
|
-
</select>
|
|
599
|
-
<button id="storage-grant-access-btn" class="btn tertiary">Grant Access</button>
|
|
600
|
-
</div>
|
|
601
|
-
<div class="input-group horizontal">
|
|
602
|
-
<input type="text" id="storage-revoke-key" placeholder="Key for access revocation">
|
|
603
|
-
<input type="text" id="storage-revoke-peer" placeholder="Peer ID to revoke access">
|
|
604
|
-
<button id="storage-revoke-access-btn" class="btn quaternary">Revoke Access</button>
|
|
605
|
-
</div>
|
|
422
|
+
<div class="card">
|
|
423
|
+
<h3>Encrypted Messaging</h3>
|
|
424
|
+
<div class="input-group">
|
|
425
|
+
<label for="encrypted-message">Message:</label>
|
|
426
|
+
<textarea id="encrypted-message" placeholder="Enter message to encrypt and broadcast..." rows="3"></textarea>
|
|
427
|
+
</div>
|
|
428
|
+
<div class="input-group">
|
|
429
|
+
<label for="group-id">Group ID (optional):</label>
|
|
430
|
+
<input type="text" id="group-id" placeholder="Enter group encryption key ID">
|
|
606
431
|
</div>
|
|
432
|
+
<button id="send-encrypted-btn" class="btn primary">Send Encrypted Broadcast</button>
|
|
433
|
+
</div>
|
|
607
434
|
|
|
608
|
-
|
|
609
|
-
<
|
|
610
|
-
|
|
611
|
-
<
|
|
612
|
-
|
|
613
|
-
<button id="storage-list-btn" class="btn tertiary">List Keys</button>
|
|
614
|
-
<button id="storage-bulk-delete-btn" class="btn warning">Bulk Delete</button>
|
|
615
|
-
</div>
|
|
435
|
+
<div class="card">
|
|
436
|
+
<h3>Key Exchange</h3>
|
|
437
|
+
<div class="input-group">
|
|
438
|
+
<label for="key-exchange-peer">Peer ID:</label>
|
|
439
|
+
<input type="text" id="key-exchange-peer" placeholder="Enter peer ID for key exchange">
|
|
616
440
|
</div>
|
|
441
|
+
<button id="exchange-keys-btn" class="btn primary">Exchange Keys</button>
|
|
442
|
+
</div>
|
|
617
443
|
|
|
618
|
-
|
|
619
|
-
<
|
|
620
|
-
|
|
621
|
-
<
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
</select>
|
|
628
|
-
<button id="storage-search-btn" class="btn tertiary">Search</button>
|
|
629
|
-
</div>
|
|
444
|
+
<div class="card">
|
|
445
|
+
<h3>Manual Key Management</h3>
|
|
446
|
+
<div class="input-group">
|
|
447
|
+
<label for="manual-peer-id">Peer ID:</label>
|
|
448
|
+
<input type="text" id="manual-peer-id" placeholder="Enter peer ID">
|
|
449
|
+
</div>
|
|
450
|
+
<div class="input-group">
|
|
451
|
+
<label for="manual-public-key">Public Key:</label>
|
|
452
|
+
<textarea id="manual-public-key" placeholder="Enter peer's public key..." rows="3"></textarea>
|
|
630
453
|
</div>
|
|
454
|
+
<button id="add-peer-key-btn" class="btn primary">Add Peer Key</button>
|
|
455
|
+
</div>
|
|
631
456
|
|
|
632
|
-
|
|
633
|
-
<
|
|
634
|
-
|
|
635
|
-
<
|
|
636
|
-
|
|
637
|
-
|
|
457
|
+
<div class="card">
|
|
458
|
+
<h3>Encryption Activity Log</h3>
|
|
459
|
+
<div id="crypto-log" class="activity-log">
|
|
460
|
+
<p class="empty-state">No encryption activity yet</p>
|
|
461
|
+
</div>
|
|
462
|
+
<button id="clear-crypto-log-btn" class="btn tertiary">Clear Log</button>
|
|
463
|
+
</div>
|
|
464
|
+
</section>
|
|
465
|
+
|
|
466
|
+
<!-- Network Information Tab -->
|
|
467
|
+
<section id="network-tab" class="tab-content">
|
|
468
|
+
<h2>๐ Network Information & Monitoring</h2>
|
|
469
|
+
|
|
470
|
+
<div class="card">
|
|
471
|
+
<h3>Network Status</h3>
|
|
472
|
+
<div id="network-status" class="status-grid">
|
|
473
|
+
<div class="status-item">
|
|
474
|
+
<label>Connected:</label>
|
|
475
|
+
<span id="network-connected">No</span>
|
|
476
|
+
</div>
|
|
477
|
+
<div class="status-item">
|
|
478
|
+
<label>Connected Peers:</label>
|
|
479
|
+
<span id="network-peer-count">0</span>
|
|
480
|
+
</div>
|
|
481
|
+
<div class="status-item">
|
|
482
|
+
<label>Discovered Peers:</label>
|
|
483
|
+
<span id="network-discovered-count">0</span>
|
|
484
|
+
</div>
|
|
485
|
+
<div class="status-item">
|
|
486
|
+
<label>Signaling URL:</label>
|
|
487
|
+
<span id="network-signaling-url">None</span>
|
|
488
|
+
</div>
|
|
489
|
+
<div class="status-item">
|
|
490
|
+
<label>Uptime:</label>
|
|
491
|
+
<span id="network-uptime">0s</span>
|
|
492
|
+
</div>
|
|
493
|
+
<div class="status-item">
|
|
494
|
+
<label>Can Accept More:</label>
|
|
495
|
+
<span id="network-can-accept">Unknown</span>
|
|
638
496
|
</div>
|
|
639
|
-
<input type="file" id="storage-restore-file" accept=".json" style="display: none;">
|
|
640
497
|
</div>
|
|
498
|
+
<button id="refresh-status-btn" class="btn tertiary">Refresh Status</button>
|
|
499
|
+
</div>
|
|
641
500
|
|
|
642
|
-
|
|
643
|
-
<
|
|
644
|
-
|
|
645
|
-
<
|
|
501
|
+
<div class="card">
|
|
502
|
+
<h3>Peer State Summary</h3>
|
|
503
|
+
<div id="peer-state-summary" class="peer-states">
|
|
504
|
+
<p class="empty-state">No peer state information available</p>
|
|
646
505
|
</div>
|
|
506
|
+
<button id="get-peer-states-btn" class="btn tertiary">Get Peer States</button>
|
|
507
|
+
</div>
|
|
647
508
|
|
|
648
|
-
|
|
649
|
-
<
|
|
650
|
-
|
|
651
|
-
<
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
</div>
|
|
660
|
-
<div class="input-group">
|
|
661
|
-
<label for="lexical-data">Data (JSON):</label>
|
|
662
|
-
<textarea id="lexical-data" rows="3" placeholder='{"name": "Alice", "age": 30}'></textarea>
|
|
663
|
-
</div>
|
|
664
|
-
<div class="input-group">
|
|
665
|
-
<label for="lexical-property">Property to get:</label>
|
|
666
|
-
<input type="text" id="lexical-property" placeholder="name" value="name">
|
|
667
|
-
</div>
|
|
668
|
-
|
|
669
|
-
<div class="button-group">
|
|
670
|
-
<button id="lexical-put-btn" class="btn primary">Put Data</button>
|
|
671
|
-
<button id="lexical-get-btn" class="btn secondary">Get Property</button>
|
|
672
|
-
<button id="lexical-val-btn" class="btn secondary">Get Full Object</button>
|
|
673
|
-
<button id="lexical-update-btn" class="btn tertiary">Update</button>
|
|
674
|
-
<button id="lexical-delete-btn" class="btn warning">Delete</button>
|
|
675
|
-
</div>
|
|
676
|
-
</div>
|
|
509
|
+
<div class="card">
|
|
510
|
+
<h3>Connection Monitoring</h3>
|
|
511
|
+
<div class="button-group">
|
|
512
|
+
<button id="start-monitoring-btn" class="btn primary">Start Monitoring</button>
|
|
513
|
+
<button id="stop-monitoring-btn" class="btn secondary" disabled>Stop Monitoring</button>
|
|
514
|
+
<button id="debug-connectivity-btn" class="btn tertiary">Debug Connectivity</button>
|
|
515
|
+
</div>
|
|
516
|
+
<div id="connection-stats" class="stats-display">
|
|
517
|
+
<p class="empty-state">No monitoring data available</p>
|
|
518
|
+
</div>
|
|
519
|
+
</div>
|
|
677
520
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
<div class="input-group">
|
|
686
|
-
<label for="lexical-set-data">Set Data (JSON object):</label>
|
|
687
|
-
<textarea id="lexical-set-data" rows="2" placeholder='{"bob": {"name": "Bob"}, "charlie": {"name": "Charlie"}}'></textarea>
|
|
688
|
-
</div>
|
|
689
|
-
|
|
690
|
-
<div class="button-group">
|
|
691
|
-
<button id="lexical-set-btn" class="btn primary">Set Data</button>
|
|
692
|
-
<button id="lexical-map-btn" class="btn secondary">Map & Log</button>
|
|
693
|
-
</div>
|
|
694
|
-
</div>
|
|
521
|
+
<div class="card">
|
|
522
|
+
<h3>Discovered Peers</h3>
|
|
523
|
+
<div id="discovered-peers" class="discovered-peers-list">
|
|
524
|
+
<p class="empty-state">No peers discovered</p>
|
|
525
|
+
</div>
|
|
526
|
+
</div>
|
|
527
|
+
</section>
|
|
695
528
|
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
529
|
+
<!-- API Testing Tab -->
|
|
530
|
+
<section id="testing-tab" class="tab-content">
|
|
531
|
+
<h2>๐งช API Testing & Utilities</h2>
|
|
532
|
+
|
|
533
|
+
<div class="card">
|
|
534
|
+
<h3>Utility Functions</h3>
|
|
535
|
+
<div class="button-group">
|
|
536
|
+
<button id="validate-peer-id-btn" class="btn primary">Validate Peer ID</button>
|
|
537
|
+
<button id="force-connect-all-api-btn" class="btn secondary">Force Connect All Peers</button>
|
|
538
|
+
<button id="cleanup-stale-btn" class="btn tertiary">Cleanup Stale Data</button>
|
|
539
|
+
</div>
|
|
540
|
+
<div class="input-group">
|
|
541
|
+
<label for="test-peer-id">Peer ID to Validate:</label>
|
|
542
|
+
<input type="text" id="test-peer-id" placeholder="Enter 40-character hex peer ID">
|
|
543
|
+
</div>
|
|
544
|
+
<div id="utility-results" class="result-display"></div>
|
|
545
|
+
</div>
|
|
713
546
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
547
|
+
<div class="card">
|
|
548
|
+
<h3>Performance Testing</h3>
|
|
549
|
+
<div class="input-group">
|
|
550
|
+
<label for="test-message-count">Number of Messages:</label>
|
|
551
|
+
<input type="number" id="test-message-count" value="10" min="1" max="100">
|
|
552
|
+
</div>
|
|
553
|
+
<div class="input-group">
|
|
554
|
+
<label for="test-message-size">Message Size (chars):</label>
|
|
555
|
+
<input type="number" id="test-message-size" value="100" min="1" max="10000">
|
|
556
|
+
</div>
|
|
557
|
+
<div class="button-group">
|
|
558
|
+
<button id="performance-test-btn" class="btn primary">Run Performance Test</button>
|
|
559
|
+
<button id="stress-test-btn" class="btn danger">Run Stress Test</button>
|
|
560
|
+
</div>
|
|
561
|
+
<div id="performance-results" class="result-display"></div>
|
|
562
|
+
</div>
|
|
728
563
|
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
564
|
+
<div class="card">
|
|
565
|
+
<h3>Test Results & Logs</h3>
|
|
566
|
+
<div id="test-log" class="test-log">
|
|
567
|
+
<p class="empty-state">No test results yet</p>
|
|
568
|
+
</div>
|
|
569
|
+
<div class="button-group">
|
|
570
|
+
<button id="export-logs-btn" class="btn tertiary">Export Logs</button>
|
|
571
|
+
<button id="clear-test-log-btn" class="btn tertiary">Clear Test Log</button>
|
|
734
572
|
</div>
|
|
735
573
|
</div>
|
|
736
|
-
</div>
|
|
737
574
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
575
|
+
<div class="card">
|
|
576
|
+
<h3>Error Testing</h3>
|
|
577
|
+
<div class="button-group">
|
|
578
|
+
<button id="test-invalid-peer-btn" class="btn danger">Test Invalid Peer Connection</button>
|
|
579
|
+
<button id="test-malformed-message-btn" class="btn danger">Test Malformed Message</button>
|
|
580
|
+
<button id="test-dht-limits-btn" class="btn danger">Test DHT Limits</button>
|
|
581
|
+
</div>
|
|
582
|
+
<div id="error-test-results" class="result-display"></div>
|
|
583
|
+
</div>
|
|
584
|
+
</section>
|
|
585
|
+
</main>
|
|
586
|
+
|
|
587
|
+
<footer>
|
|
588
|
+
<div class="system-log">
|
|
589
|
+
<h3>System Log</h3>
|
|
590
|
+
<div id="system-log" class="log-display">
|
|
591
|
+
<p class="empty-state">System log will appear here...</p>
|
|
744
592
|
</div>
|
|
745
|
-
<
|
|
746
|
-
<div id="messages-log" class="messages-log"></div>
|
|
593
|
+
<button id="clear-log-btn" class="btn tertiary">Clear Log</button>
|
|
747
594
|
</div>
|
|
595
|
+
</footer>
|
|
748
596
|
</div>
|
|
749
597
|
|
|
750
|
-
|
|
598
|
+
<!-- Load PeerPigeon library -->
|
|
599
|
+
<script src="../../dist/peerpigeon-browser.js"></script>
|
|
600
|
+
<!-- Load our application -->
|
|
601
|
+
<script src="app.js"></script>
|
|
751
602
|
</body>
|
|
752
603
|
</html>
|