-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
547 lines (527 loc) · 26.1 KB
/
Copy pathadmin.html
File metadata and controls
547 lines (527 loc) · 26.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
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
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; script-src 'self' https://cdn.jsdelivr.net; img-src 'self' data:; connect-src 'self' https://cdn.jsdelivr.net https://*.vercel-insights.com; object-src 'none';"
/>
<meta name="robots" content="noindex, nofollow" />
<meta name="theme-color" content="#000000" />
<title>FUSE Admin | Analytics Dashboard</title>
<link rel="icon" type="image/svg+xml" href="assets/favicon.svg" />
<link rel="apple-touch-icon" href="assets/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<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=Bebas+Neue&family=Inter:wght@300;400;500;600;700&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/admin.css" />
<link rel="stylesheet" href="css/consent.css" />
<!-- Cookie Consent Manager -->
<script defer src="js/consent-manager.js"></script>
</head>
<body class="admin-page">
<!-- Skip link for accessibility -->
<a href="#main-content" class="skip-link">Skip to main content</a>
<main class="admin" id="main-content">
<header class="admin-header">
<div class="admin-header-left">
<a href="index.html" class="logo-link" aria-label="FUSE home">
<span class="logo-text">FUSE</span>
</a>
<span class="header-divider" aria-hidden="true"></span>
<div>
<span class="admin-eyebrow">Admin Console</span>
<h1 class="admin-title">Analytics Dashboard</h1>
</div>
</div>
<div class="admin-header-right">
<nav class="admin-nav" aria-label="Admin navigation">
<a class="admin-nav-link" href="dashboard.html">Dashboard</a>
<a class="admin-nav-link" href="/research-lab">Research Lab</a>
<a class="admin-nav-link" href="index.html">Home</a>
</nav>
<div class="admin-actions">
<button class="btn ghost" id="refreshBtn" type="button" disabled>
Refresh
</button>
<button class="btn ghost" id="signOutBtn" type="button" disabled>
Sign out
</button>
</div>
</div>
</header>
<section class="card" id="loginCard">
<h2>Admin Access</h2>
<p class="muted">Use your admin passkey to view analytics, signups, and AI Lab controls.</p>
<div class="passkey-login">
<button class="btn primary passkey-button" id="adminPasskeyLoginBtn" type="button">
Sign in with Passkey
</button>
<span class="passkey-meta" id="adminPasskeyMeta">Checking passkey setup...</span>
</div>
<details class="passkey-setup" id="adminPasskeySetupPanel">
<summary>Set up or recover admin passkey</summary>
<p class="muted">
Use the admin password once to register a passkey on this device or through your phone.
</p>
<form id="adminPasskeySetup" class="form">
<label for="adminUsername">Username</label>
<input
id="adminUsername"
name="adminUsername"
type="text"
autocomplete="username"
value="sergiopesch"
required
/>
<label for="adminPassword">Password</label>
<input
id="adminPassword"
name="adminPassword"
type="password"
autocomplete="current-password"
required
/>
<button class="btn ghost" id="adminPasskeySetupBtn" type="submit">
Create admin passkey
</button>
</form>
</details>
<p class="status" id="loginStatus" role="alert" aria-live="polite"></p>
</section>
<!-- Tab Navigation -->
<nav class="tabs hidden" id="tabNav">
<button class="tab active" data-tab="analytics" type="button">
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<path d="M18 20V10M12 20V4M6 20v-6" />
</svg>
Analytics
</button>
<button class="tab" data-tab="signups" type="button">
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" />
<circle cx="9" cy="7" r="4" />
<path d="M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
</svg>
Signups Data
</button>
<button class="tab" data-tab="lab" type="button">
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<path d="M10 2v7.31" />
<path d="M14 9.3V2" />
<path d="M8.5 2h7" />
<path d="M14 9.3a6.5 6.5 0 1 1-4 0" />
<path d="M7 16h10" />
</svg>
AI Lab Control
</button>
</nav>
<!-- Analytics Dashboard -->
<section class="card hidden" id="analyticsCard">
<!-- Key Metrics Row -->
<div class="metrics-grid">
<div class="metric-card highlight">
<div class="metric-icon">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" />
<circle cx="9" cy="7" r="4" />
<path d="M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
</svg>
</div>
<div class="metric-content">
<span class="metric-label">Total Signups</span>
<span class="metric-value" id="metricTotal">0</span>
<span class="metric-trend positive" id="metricTotalTrend">--</span>
</div>
</div>
<div class="metric-card">
<div class="metric-icon blue">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<rect x="3" y="4" width="18" height="18" rx="2" ry="2" />
<line x1="16" y1="2" x2="16" y2="6" />
<line x1="8" y1="2" x2="8" y2="6" />
<line x1="3" y1="10" x2="21" y2="10" />
</svg>
</div>
<div class="metric-content">
<span class="metric-label">Today</span>
<span class="metric-value" id="metricToday">0</span>
<span class="metric-trend" id="metricTodayTrend">--</span>
</div>
</div>
<div class="metric-card">
<div class="metric-icon purple">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<polyline points="23 6 13.5 15.5 8.5 10.5 1 18" />
<polyline points="17 6 23 6 23 12" />
</svg>
</div>
<div class="metric-content">
<span class="metric-label">This Week</span>
<span class="metric-value" id="metricWeek">0</span>
<span class="metric-trend" id="metricWeekTrend">--</span>
</div>
</div>
<div class="metric-card">
<div class="metric-icon green">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14" />
<polyline points="22 4 12 14.01 9 11.01" />
</svg>
</div>
<div class="metric-content">
<span class="metric-label">Consent Rate</span>
<span class="metric-value" id="metricConsent">0%</span>
<span class="metric-trend positive" id="metricConsentTrend">--</span>
</div>
</div>
</div>
<!-- Charts Row -->
<div class="charts-grid">
<div class="chart-card">
<div class="chart-header">
<h3 class="chart-title">Signup Trends</h3>
<div class="chart-controls">
<button class="chart-range-btn active" data-range="7">7D</button>
<button class="chart-range-btn" data-range="14">14D</button>
<button class="chart-range-btn" data-range="30">30D</button>
<button class="chart-range-btn" data-range="all">All</button>
</div>
</div>
<div class="chart-container">
<canvas id="trendChart"></canvas>
</div>
</div>
<div class="chart-card small">
<div class="chart-header">
<h3 class="chart-title">Interest Distribution</h3>
</div>
<div class="chart-container doughnut">
<canvas id="interestChart"></canvas>
</div>
<div class="chart-legend" id="interestLegend"></div>
</div>
</div>
<!-- Secondary Stats Row -->
<div class="stats-row">
<div class="stat-card">
<div class="stat-header">
<span class="stat-label">Daily Average</span>
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<line x1="12" y1="20" x2="12" y2="10" />
<line x1="18" y1="20" x2="18" y2="4" />
<line x1="6" y1="20" x2="6" y2="16" />
</svg>
</div>
<span class="stat-value" id="statDailyAvg">0</span>
<span class="stat-subtext">signups per day</span>
</div>
<div class="stat-card">
<div class="stat-header">
<span class="stat-label">Peak Day</span>
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<polygon
points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"
/>
</svg>
</div>
<span class="stat-value" id="statPeakDay">--</span>
<span class="stat-subtext" id="statPeakCount">0 signups</span>
</div>
<div class="stat-card">
<div class="stat-header">
<span class="stat-label">This Month</span>
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<rect x="3" y="4" width="18" height="18" rx="2" ry="2" />
<line x1="16" y1="2" x2="16" y2="6" />
<line x1="8" y1="2" x2="8" y2="6" />
<line x1="3" y1="10" x2="21" y2="10" />
</svg>
</div>
<span class="stat-value" id="statMonth">0</span>
<span class="stat-subtext" id="statMonthGrowth">vs last month</span>
</div>
<div class="stat-card">
<div class="stat-header">
<span class="stat-label">First Signup</span>
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<circle cx="12" cy="12" r="10" />
<polyline points="12 6 12 12 16 14" />
</svg>
</div>
<span class="stat-value" id="statFirstDate">--</span>
<span class="stat-subtext" id="statDaysActive">0 days active</span>
</div>
</div>
<!-- Hourly Activity Heatmap -->
<div class="activity-section">
<div class="chart-header">
<h3 class="chart-title">Signup Activity by Hour</h3>
<span class="chart-subtitle">When users are most active</span>
</div>
<div class="heatmap-container">
<div class="heatmap" id="hourlyHeatmap"></div>
<div class="heatmap-labels">
<span>12am</span>
<span>6am</span>
<span>12pm</span>
<span>6pm</span>
<span>11pm</span>
</div>
</div>
</div>
</section>
<!-- Research Lab Backend Controls -->
<section class="card hidden" id="labCard">
<div class="lab-admin-header">
<div>
<h2>Research Lab Backend Door</h2>
<p class="muted">
Toggle scheduled AI cycles or run a manual discovery pass.
</p>
</div>
<span class="lab-admin-pill" id="labAdminStatus">Loading</span>
</div>
<div class="lab-control-grid">
<article class="lab-control-panel">
<h3>Automation</h3>
<label class="switch-row">
<span>
Daily discovery
<small>Runs the cheap daily lab cycle.</small>
</span>
<input id="labDailyEnabled" type="checkbox" />
</label>
<label class="switch-row">
<span>
Weekly GPT-5.5 review
<small>Runs Monday development readiness review.</small>
</span>
<input id="labWeeklyEnabled" type="checkbox" />
</label>
<label class="switch-row">
<span>
OpenAI synthesis
<small>Falls back to deterministic briefs when off.</small>
</span>
<input id="labModelEnabled" type="checkbox" />
</label>
</article>
<article class="lab-control-panel">
<h3>Models</h3>
<label for="labDailyModel">Daily model</label>
<input id="labDailyModel" type="text" autocomplete="off" />
<label for="labWeeklyModel">Weekly model</label>
<input id="labWeeklyModel" type="text" autocomplete="off" />
<label for="labWeeklyReasoning">Weekly reasoning</label>
<select id="labWeeklyReasoning">
<option value="low">low</option>
<option value="medium">medium</option>
<option value="high">high</option>
<option value="xhigh">xhigh</option>
</select>
<button class="btn primary" id="saveLabControlsBtn" type="button">
Save controls
</button>
</article>
<article class="lab-control-panel">
<h3>Manual Runs</h3>
<div class="lab-action-stack">
<button class="btn ghost" id="runLabTickBtn" type="button">
Run one world tick
</button>
<button class="btn ghost" id="runDailyLabBtn" type="button">
Run daily cycle now
</button>
<button class="btn ghost" id="runWeeklyLabBtn" type="button">
Run weekly GPT-5.5 review now
</button>
</div>
</article>
</div>
<div class="lab-review-grid">
<article class="lab-review-card">
<span>Current world</span>
<strong id="labWorldSummary">--</strong>
<p id="labExperimentSummary">--</p>
</article>
<article class="lab-review-card">
<span>Daily discovery</span>
<strong id="labDailySummary">--</strong>
<p id="labDailyInsight">--</p>
</article>
<article class="lab-review-card">
<span>Weekly review</span>
<strong id="labWeeklySummary">--</strong>
<p id="labWeeklyDecision">--</p>
</article>
</div>
<p class="status" id="labAdminMessage" role="status" aria-live="polite"></p>
</section>
<!-- Signups Data Table -->
<section class="card hidden" id="dataCard">
<div class="summary">
<div>
<div class="label">Total loaded</div>
<div class="value" id="signupCount">0</div>
</div>
<div>
<div class="label">Last updated</div>
<div class="value" id="lastUpdated">--</div>
</div>
<div>
<div class="label">Showing</div>
<div class="value" id="showingCount">0</div>
</div>
<div>
<div class="label">Filter</div>
<div class="value" id="filterValue">All</div>
</div>
</div>
<div class="toolbar">
<div class="toolbar-group">
<label class="toolbar-label" for="emailFilter">Filter by email</label>
<input id="emailFilter" type="email" placeholder="flex@gainmail.com" />
<button class="btn ghost" id="applyFilterBtn" type="button" disabled>
Search
</button>
<button class="btn ghost" id="clearFilterBtn" type="button" disabled>
Clear
</button>
</div>
<div class="toolbar-group">
<label class="toolbar-label" for="interestFilter">Interest keyword</label>
<input id="interestFilter" type="text" placeholder="powerlifting" />
<label class="toolbar-label" for="fromDate">From</label>
<input id="fromDate" type="date" />
<label class="toolbar-label" for="toDate">To</label>
<input id="toDate" type="date" />
<button class="btn ghost" id="applyLocalFiltersBtn" type="button" disabled>
Apply
</button>
<button class="btn ghost" id="clearLocalFiltersBtn" type="button" disabled>
Reset
</button>
</div>
<div class="toolbar-group">
<button class="btn ghost" id="copyEmailsBtn" type="button" disabled>
Copy emails
</button>
<button class="btn ghost" id="exportCsvBtn" type="button" disabled>
Export CSV
</button>
</div>
</div>
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Full name</th>
<th>Email</th>
<th>Main interest</th>
<th>Consent</th>
<th>Consent date</th>
<th>Signup date</th>
</tr>
</thead>
<tbody id="signupRows"></tbody>
</table>
<div class="empty-state hidden" id="emptyState">No signups yet.</div>
</div>
<div class="table-actions">
<button class="btn ghost hidden" id="loadMoreBtn" type="button">
Load more
</button>
</div>
<p class="status" id="dataStatus" role="status" aria-live="polite"></p>
</section>
</main>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
<script defer src="js/admin.js"></script>
</body>
</html>