-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
246 lines (238 loc) · 14.8 KB
/
index.html
File metadata and controls
246 lines (238 loc) · 14.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='5' r='4' fill='%23007FFF'/%3E%3Ccircle cx='48.1' cy='8.7' r='4' fill='%23007FFF'/%3E%3Ccircle cx='58.3' cy='19.9' r='4' fill='%23007FFF'/%3E%3Ccircle cx='59' cy='34' r='4' fill='%23007FFF'/%3E%3Ccircle cx='51.3' cy='47.1' r='4' fill='%23007FFF'/%3E%3Ccircle cx='38' cy='55.5' r='4' fill='%23007FFF'/%3E%3Ccircle cx='23' cy='57' r='4' fill='%23007FFF'/%3E%3Ccircle cx='11.7' cy='49.1' r='4' fill='%23007FFF'/%3E%3Ccircle cx='5' cy='36' r='4' fill='%23007FFF'/%3E%3Ccircle cx='5.7' cy='21.9' r='4' fill='%23007FFF'/%3E%3Ccircle cx='14.9' cy='10.7' r='4' fill='%23007FFF'/%3E%3C/svg%3E">
<title>Freenet Network</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/styles.css?v=20260222a">
<script>
// Apply saved theme before render to avoid flash of wrong theme.
// Wrapped in try/catch because localStorage throws in Safari private browsing.
// Icon convention: ☀️ = "switch to light", 🌙 = "switch to dark" (shows target mode).
// This script is intentionally a plain <script> (not a module) so it runs
// synchronously before render and so toggleTheme() is accessible via onclick.
(function() {
try {
if (localStorage.getItem('theme') === 'light') {
document.documentElement.setAttribute('data-theme', 'light');
}
} catch (e) { /* localStorage unavailable (private browsing) — default to dark */ }
})();
function toggleTheme() {
const isLight = document.documentElement.getAttribute('data-theme') === 'light';
const icon = document.getElementById('theme-icon');
if (isLight) {
// Switching to dark (default) — remove the key; no need to store default
document.documentElement.removeAttribute('data-theme');
if (icon) icon.textContent = '☀️';
try { localStorage.removeItem('theme'); } catch (e) {}
} else {
// Switching to light
document.documentElement.setAttribute('data-theme', 'light');
if (icon) icon.textContent = '🌙';
try { localStorage.setItem('theme', 'light'); } catch (e) {}
}
}
// Sync icon on load when light mode was restored from localStorage
document.addEventListener('DOMContentLoaded', function() {
const icon = document.getElementById('theme-icon');
if (icon && document.documentElement.getAttribute('data-theme') === 'light') {
icon.textContent = '🌙';
}
});
</script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.7/dist/chart.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns@3.0.0/dist/chartjs-adapter-date-fns.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-annotation@3.1.0/dist/chartjs-plugin-annotation.min.js"></script>
</head>
<body>
<div class="main-content">
<div class="container">
<header class="header">
<div class="header-brand">
<img src="https://freenet.org/freenet_logo.svg" alt="Freenet" class="header-logo">
<h1>FREENET</h1>
</div>
<div class="header-controls">
<div class="status-badge">
<span id="status-dot" class="status-dot"></span>
<span id="status-text">Connecting...</span>
</div>
<button class="theme-toggle" id="theme-toggle" title="Toggle dark/light mode" onclick="toggleTheme()">
<span class="theme-toggle-icon" id="theme-icon">☀️</span>
</button>
</div>
</header>
<div class="stats">
<div class="stat" title="Computers running Freenet that we can see">
<div class="stat-value" id="peer-count">-</div>
<div class="stat-label">Peers</div>
<div class="stat-hint">nodes on network</div>
</div>
<div class="stat" title="Direct links between peers">
<div class="stat-value" id="connection-count">-</div>
<div class="stat-label">Connections</div>
<div class="stat-hint">peer-to-peer links</div>
</div>
<div class="stat" title="Network operations observed">
<div class="stat-value" id="event-count">-</div>
<div class="stat-label">Events</div>
<div class="stat-hint">operations tracked</div>
</div>
<div class="stat" title="Current time being displayed">
<div class="stat-value" id="time-display">--:--</div>
<div class="stat-label">Viewing</div>
<div class="stat-hint">drag timeline to travel</div>
</div>
</div>
<div class="dashboard">
<div class="panel">
<div class="panel-header">
<span class="panel-title">Network Topology</span>
<span class="panel-time-label" id="topology-time-label">Live</span>
</div>
<div class="topology-legend-inline" id="ring-legend">
<span class="legend-item"><span class="legend-marker gateway"></span>Gateway</span>
<span class="legend-item"><span class="legend-marker peer"></span>Peer</span>
<span class="legend-item"><span class="legend-line connection"></span>Connection</span>
<span class="legend-item"><span style="color:#7ecfef; font-size:12px; margin-right:3px;">◎</span>Contract Location</span>
<span class="legend-item find-my-peer" id="find-my-peer-btn" style="display: none;" onclick="findMyPeer()"><span class="legend-marker you"></span><a href="#" onclick="event.preventDefault()">Find My Peer</a></span>
</div>
<div class="topology-legend-inline" id="tree-legend" style="display: none;">
<span class="legend-item"><span class="legend-marker tree-root"></span>Root (seeder)</span>
<span class="legend-item"><span class="legend-marker subscriber"></span>Subscriber</span>
<span class="legend-item"><span class="legend-marker gateway"></span>Gateway</span>
<span class="legend-item"><span class="legend-marker you"></span>You</span>
<span class="legend-item"><span class="legend-line tree-disconnected"></span>Disconnected</span>
</div>
<div class="ring-container" id="ring-container">
<div class="empty-state">
<div class="empty-state-icon">◉</div>
<div>Loading network state...</div>
</div>
</div>
<div class="tree-container" id="tree-container" style="display: none;">
</div>
<!-- Overlay charts (positioned relative to panel) -->
<div class="transfer-backdrop" id="transfer-backdrop"></div>
<div class="topology-overlay dist-overlay" id="dist-chart-container" title="Connection distance distribution">
<div class="overlay-header">
<span class="overlay-title"><span class="title-short">distance</span><span class="title-long">connection distance</span></span>
</div>
<div class="dist-chart-wrapper">
<div class="dist-axis-y">
<span>0</span>
<span>.5</span>
</div>
<div class="dist-chart" id="dist-chart"></div>
</div>
</div>
<div class="topology-overlay transfer-overlay" id="transfer-chart-container" title="Click to zoom">
<div class="overlay-header">
<span class="overlay-title"><span class="title-short">speeds</span><span class="title-long">transfer speeds</span></span>
</div>
<div class="overlay-chart" id="transfer-chart">
<canvas id="transfer-canvas"></canvas>
</div>
<span class="zoom-hint" id="zoom-hint">click to zoom</span>
</div>
<div class="transfer-tooltip" id="transfer-tooltip"></div>
</div>
<div class="panel">
<div class="panel-header">
<div class="panel-tabs">
<button class="panel-tab active" id="tab-contracts" onclick="switchRightTab('contracts')">Contracts <span class="tab-count" id="contract-tab-count">0</span></button>
<button class="panel-tab" id="tab-performance" onclick="switchRightTab('performance')">Performance</button>
<button class="panel-tab" id="tab-versions" onclick="switchRightTab('versions')">Versions</button>
</div>
</div>
<div id="contracts-panel-content">
<div class="filter-bar" id="filter-bar">
<span class="filter-bar-label">Filters:</span>
<span class="filter-no-active" id="no-filters">None active</span>
<div id="filter-chips"></div>
<button class="filter-clear-all" id="clear-all-btn" onclick="clearAllFilters()" style="display: none;">Clear all</button>
</div>
<div class="contracts-search">
<input type="text" class="contract-search-input" id="contract-search" placeholder="Search by contract ID prefix...">
</div>
<div class="contracts-list" id="contracts-list">
<div class="empty-state">
<div class="empty-state-icon">📦</div>
<div>No contracts with activity</div>
</div>
</div>
</div><!-- /contracts-panel-content -->
<div id="performance-panel-content" class="performance-panel" style="display: none;">
<div class="metrics-chart-container" id="metrics-chart-container">
<div class="empty-state">
<div class="empty-state-icon">📈</div>
<div>Loading performance data...</div>
</div>
</div>
</div>
<div id="versions-panel-content" class="performance-panel" style="display: none;">
<div class="metrics-chart-container" id="versions-chart-container">
<div class="empty-state">
<div class="empty-state-icon">📦</div>
<div>Loading version data...</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Timeline -->
<div class="timeline-container">
<div class="timeline-wrapper">
<div class="timeline-header">
<div class="timeline-info">
<span class="timeline-time" id="playhead-time">--:--:--</span>
<span class="timeline-date" id="playhead-date"></span>
</div>
</div>
<div class="timeline" id="timeline">
<div class="timeline-lane-labels">
<div class="timeline-lane-label" style="color:var(--color-connect)">CONN</div>
<div class="timeline-lane-label" style="color:var(--color-get)">GET</div>
<div class="timeline-lane-label" style="color:var(--color-put)">PUT</div>
<div class="timeline-lane-label" style="color:var(--color-subscribe)">SUB</div>
<div class="timeline-lane-label" style="color:var(--color-update)">UPD</div>
</div>
<div class="timeline-events" id="timeline-events">
<canvas id="timeline-canvas"></canvas>
</div>
</div>
<div id="timeline-tooltip" class="timeline-tooltip"></div>
<div class="timeline-labels">
<div class="timeline-legend">
<span class="legend-item"><span class="legend-dot" style="background:var(--color-connect)"></span>conn</span>
<span class="legend-item"><span class="legend-dot" style="background:var(--color-get)"></span>get</span>
<span class="legend-item"><span class="legend-dot" style="background:var(--color-put)"></span>put</span>
<span class="legend-item"><span class="legend-dot" style="background:var(--color-subscribe)"></span>sub</span>
<span class="legend-item"><span class="legend-dot" style="background:var(--color-update)"></span>upd</span>
<span style="color:var(--text-muted);font-size:0.85em;margin-left:6px">bright=completed</span>
</div>
</div>
<div class="tx-detail-container" id="tx-detail-container">
<div class="tx-detail-header">
<div class="tx-detail-title" id="tx-detail-title">
<span class="op-badge">GET</span>
<span>Transaction Details</span>
</div>
<button class="tx-detail-close" onclick="closeTransactionDetail()">×</button>
</div>
<div class="tx-detail-gantt" id="tx-detail-gantt">
<!-- Events rendered here -->
</div>
</div>
</div>
</div>
<script type="module" src="js/app.js?v=20260228a"></script>
</body>
</html>