-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlive.html
More file actions
2686 lines (2546 loc) · 124 KB
/
live.html
File metadata and controls
2686 lines (2546 loc) · 124 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
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sentinel — Live Node Testing</title>
<link rel="stylesheet" href="/sentinel.css">
<script>document.documentElement.dataset.theme = localStorage.getItem('theme') || 'light';</script>
<style>
:root {
--text-primary: var(--text);
--text-secondary: var(--text-dim);
--glass-border: var(--border);
--accent-green: var(--green);
--accent-red: var(--red);
--accent-orange: var(--yellow);
}
body { min-height: 100vh; overflow-x: hidden; }
body.boot-pending * { transition: none !important; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
.glass-panel {
background: var(--glass-bg);
border: 1px solid var(--glass-border);
border-radius: 12px;
}
/* ─── Floating top-right (About + theme) ─── */
.top-right-controls {
position: fixed; top: 12px; right: 16px; z-index: 500;
display: flex; align-items: center; gap: 8px;
}
.top-icon-btn {
display: inline-flex; align-items: center; justify-content: center;
width: 36px; height: 36px; border-radius: 8px;
background: var(--bg-card); border: 1px solid var(--border);
color: var(--text); text-decoration: none;
}
.top-icon-btn:hover { border-color: var(--border-hover); color: var(--text); }
.theme-toggle-btn {
width: 36px; height: 36px; border-radius: 8px;
background: var(--bg-card); border: 1px solid var(--border);
color: var(--text); cursor: pointer;
display: inline-flex; align-items: center; justify-content: center;
}
/* ─── Page layout ─── */
main {
max-width: 1600px; margin: 0 auto;
padding: 28px 24px 80px;
}
/* Live-banner / status row (kept for status var references) */
.pulse-dot {
width: 8px; height: 8px; border-radius: 50%;
background: var(--text-muted);
}
.pulse-dot.running { background: var(--green); box-shadow: 0 0 0 0 rgba(0,200,120,0.5); animation: pulse 1.6s infinite; }
@keyframes pulse {
0% { box-shadow: 0 0 0 0 rgba(0,200,120,0.5); }
70% { box-shadow: 0 0 0 8px rgba(0,200,120,0); }
100% { box-shadow: 0 0 0 0 rgba(0,200,120,0); }
}
/* ─── Page header ─── */
.live-page-header {
display: flex; align-items: center; gap: 14px;
margin: 0 0 18px 0;
}
.live-page-header-left { display: flex; align-items: center; gap: 14px; flex: 1 1 auto; min-width: 0; }
.brand-logo { width: 26px; height: 26px; flex-shrink: 0; color: var(--accent); }
/* TEST RUN pill — sits next to the page title when a test-run audit is active */
.test-run-badge {
display: inline-block;
vertical-align: middle;
margin-left: 10px;
padding: 4px 10px;
border-radius: 999px;
background: var(--accent);
color: var(--bg-card-solid);
font-size: 10px;
font-weight: 800;
letter-spacing: 1.5px;
font-family: var(--font-display);
}
/* TEST RUN banner — full-width, static accent strip. Shown when a test-run
audit is active so the public can't mistake skipped rows for real
measurements. No animation — keeps the page calm. */
.test-run-banner {
display: none;
align-items: center;
justify-content: center;
gap: 10px;
padding: 12px 16px;
margin-bottom: 22px;
background: var(--accent);
color: var(--bg-card-solid);
font-family: var(--font-display);
font-weight: 800;
font-size: 13px;
letter-spacing: 2px;
text-transform: uppercase;
border-bottom: 2px solid var(--accent);
}
.test-run-banner.is-visible { display: flex; }
.live-page-header-right {
display: flex; align-items: center; gap: 0;
flex: 0 0 auto;
}
.live-header-stat {
display: flex; flex-direction: column; gap: 2px;
padding: 0 16px;
align-items: center; text-align: center;
}
.live-header-stat-label {
font-family: var(--font-display);
font-size: 9px; letter-spacing: 1.5px;
color: var(--text-muted); text-transform: uppercase;
font-weight: 600;
text-align: center;
}
.live-header-stat-value {
font-family: var(--font-display);
font-size: 14px; letter-spacing: 0.5px;
color: var(--text); font-weight: 700;
font-variant-numeric: tabular-nums;
text-align: center;
}
.live-header-divider {
width: 1px; height: 28px; background: var(--border);
align-self: center;
}
@media (max-width: 900px) {
.live-page-header-right { display: none; }
}
.live-page-title {
font-family: var(--font-display);
font-size: 22px; font-weight: 700;
letter-spacing: 2.5px; text-transform: uppercase;
color: var(--text); margin: 0; line-height: 1.1;
display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px;
}
#liveModeBadge { align-items: center; line-height: 1; margin-left: 0 !important; }
.live-page-sub {
font-family: var(--font-display);
font-size: 11px; letter-spacing: 1.2px;
color: var(--text-dim); text-transform: uppercase;
margin-top: 4px;
}
/* ─── Stat tiles (mirror admin dev panel) ─── */
.stats-grid {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 10px;
margin-bottom: 16px;
}
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 8px;
padding: 12px 14px;
display: flex; flex-direction: column; gap: 4px;
min-height: 64px;
align-items: center; justify-content: center;
text-align: center;
}
.stat-label {
font-family: var(--font-display);
font-size: 10px;
letter-spacing: 1.4px;
text-transform: uppercase;
color: var(--text-dim);
text-align: center;
}
.stat-value {
font-family: var(--font-display);
font-size: 22px;
font-weight: 700;
color: var(--text);
line-height: 1.05;
text-align: center;
}
.stat-value.pass { color: var(--green); }
.stat-value.fail { color: var(--red); }
.stat-value.warn { color: var(--yellow); }
.stat-sub {
font-family: var(--font-display);
font-size: 10px;
color: var(--text-muted);
letter-spacing: 0.6px;
text-align: center;
}
/* ─── Current Batch panel ─── */
#cbCard { margin-bottom: 16px; }
.cb-header-row {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 10px;
}
.cb-title {
font-family: var(--font-display);
font-size: 14px;
font-weight: 700;
letter-spacing: 1.5px;
color: var(--text);
text-transform: uppercase;
}
.cb-meta {
font-family: var(--font-display);
font-size: 11px;
color: var(--text-dim);
display: flex;
align-items: center;
gap: 8px;
}
.cb-progress-row {
display: flex;
align-items: center;
gap: 14px;
flex-wrap: wrap;
}
.cb-count {
font-family: var(--font-display);
font-size: 12px;
color: var(--text);
white-space: nowrap;
flex-shrink: 0;
}
.cb-progress-track {
flex: 1;
min-width: 80px;
height: 4px;
background: var(--border);
border-radius: 2px;
overflow: hidden;
}
.cb-progress-fill {
height: 100%;
width: 0%;
background: var(--accent);
border-radius: 2px;
transition: width 0.4s ease;
}
.cb-eta {
font-family: var(--font-display);
font-size: 11px;
color: var(--text-dim);
white-space: nowrap;
flex-shrink: 0;
}
.cb-snapshot-row {
display: flex;
align-items: center;
gap: 18px;
flex-wrap: wrap;
font-size: 11px;
font-family: var(--font-display);
}
.cb-snap-item { color: var(--text-dim); }
.cb-snap-pass { color: var(--green); font-weight: 700; }
.cb-snap-fail { color: var(--red); font-weight: 700; }
.cb-complete-msg {
font-family: var(--font-display);
font-size: 12px;
color: var(--text-dim);
padding: 8px 12px;
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
display: none;
}
/* ─── Data grid — identical to admin dev view ─── */
.data-grid {
display: grid;
grid-template-columns: 1fr 380px;
gap: 16px;
height: 640px;
}
.table-container { display: flex; flex-direction: column; overflow: hidden; height: 640px; max-height: 640px; }
.panel-header {
padding: 16px 20px;
border-bottom: 1px solid var(--glass-border);
display: flex;
justify-content: space-between;
align-items: center;
}
.panel-title {
font-family: var(--font-display);
font-size: 13px;
font-weight: 600;
letter-spacing: 1px;
color: var(--text);
text-transform: uppercase;
}
.table-wrap { overflow-y: auto; flex: 1 1 auto; min-height: 0; padding: 0 8px 8px 8px; margin-top: 8px; }
table { width: 100%; border-collapse: separate; border-spacing: 0 4px; table-layout: fixed; }
td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.td-num, th.th-num { font-variant-numeric: tabular-nums; text-align: right; }
td.td-moniker { max-width: 180px; }
td.td-error { max-width: 240px; }
/* Tighten the gap between Peers (col 6) and Speed (col 7) */
table thead th:nth-child(6),
table tbody td:nth-child(6) { padding-right: 2px; }
table thead th:nth-child(7),
table tbody td:nth-child(7) { padding-left: 2px; }
.pager .btn-paginate {
background: var(--bg-input);
color: var(--text);
border: 1px solid var(--border);
padding: 4px 10px;
border-radius: 4px;
font-size: 11px;
cursor: pointer;
}
.pager .btn-paginate:disabled { opacity: 0.4; cursor: not-allowed; }
.pager .btn-paginate:not(:disabled):hover { border-color: var(--border-hover); }
/* Opaque header band — covers BOTH the 4px row-gap above each th (page bg
bleed when border-spacing: 0 4px exposes empty stripe at the top) AND
the 4px row-gap below the header row that body rows scroll through. The
box-shadow draws a solid stripe both upward and downward in the same
color as --bg-card-solid; the bottom stripe is what hides scrolling rows
passing under the sticky header. */
thead { background: var(--bg-card-solid); }
thead tr { background: var(--bg-card-solid); }
th {
text-align: left;
padding: 8px 6px;
font-size: 10px;
text-transform: uppercase;
letter-spacing: 1px;
border-bottom: 1px solid var(--border);
color: var(--text-secondary);
position: sticky; top: 0;
background: var(--bg-card-solid) !important;
box-shadow:
0 -6px 0 0 var(--bg-card-solid),
0 6px 0 0 var(--bg-card-solid),
0 7px 0 0 var(--border);
z-index: 10;
}
td {
padding: 6px 6px;
font-size: 12px;
white-space: nowrap;
vertical-align: middle;
background: var(--bg-card);
}
tr td:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
tr td:last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
tr:hover td { background: var(--bg-card-solid); }
.badge {
padding: 3px 8px; border-radius: 4px;
font-size: 10px; font-weight: 700;
font-family: var(--font-display); letter-spacing: 0.5px;
}
.badge-pass { background: var(--green-dim); color: var(--text); border: 1px solid var(--border-hover); }
.badge-slow { background: var(--yellow-dim); color: var(--text); border: 1px solid var(--border-hover); }
.badge-fail { background: var(--red-dim); color: var(--text-dim); border: 1px solid var(--border); }
.badge-skip { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }
.badge-wg { background: var(--bg-input); color: var(--text-dim); padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.badge-v2 { background: var(--bg-input); color: var(--text-dim); padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.badge-dry { background: var(--bg-input); color: var(--text); padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: 700; border: 1px solid var(--border-hover); margin-left: 4px; letter-spacing: 0.5px; }
.row-copy-btn {
background: var(--bg-input); color: var(--text-dim);
border: 1px solid var(--border); border-radius: var(--radius-xs);
font-family: var(--font-mono); font-size: 11px;
padding: 2px 7px; cursor: pointer; line-height: 1;
transition: all 0.12s ease;
}
.row-copy-btn:hover { border-color: var(--text); color: var(--text); background: var(--bg-card); }
.row-copy-btn:disabled { opacity: 0.6; cursor: wait; }
/* ─── Log panel — fixed height, scroll inside ─── */
.log-container {
display: flex; flex-direction: column; overflow: hidden;
height: 640px; max-height: 640px;
align-self: start;
position: sticky; top: 12px;
}
.logs {
flex: 1 1 auto; min-height: 0;
overflow-y: auto; padding: 12px;
display: flex; flex-direction: column; gap: 4px;
font-family: var(--font-mono); font-size: 11px;
}
.log-entry {
padding: 5px 10px; background: var(--bg-input);
border-radius: 4px; border-left: 2px solid var(--text-dim);
color: var(--text); animation: slideIn 0.2s ease;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
display: flex; align-items: center; gap: 8px;
font-variant-numeric: tabular-nums;
flex: 0 0 auto;
}
.log-entry.log-ok { border-left-color: var(--green); }
.log-entry.log-err { border-left-color: var(--red); }
.log-entry.log-warn{ border-left-color: var(--yellow); }
.log-entry .log-time { color: var(--text-muted); flex-shrink: 0; }
.log-entry .log-tag {
font-family: var(--font-display);
font-size: 9px; font-weight: 700; letter-spacing: 1px;
padding: 1px 6px; border-radius: 3px;
background: var(--bg-card); border: 1px solid var(--border);
color: var(--text-dim);
flex-shrink: 0; min-width: 44px; text-align: center;
}
.log-entry .log-tag.tag-batch { color: var(--accent); border-color: var(--accent); }
.log-entry .log-tag.tag-iter { color: var(--text); border-color: var(--border-hover); }
.log-entry .log-tag.tag-node { color: var(--text-dim); }
.log-entry .log-tag.tag-fail { color: var(--red); border-color: var(--red); }
.log-entry .log-tag.tag-pass { color: var(--green); border-color: var(--green); }
.log-entry .log-tag.tag-warn { color: var(--yellow); border-color: var(--yellow); }
.log-entry .log-tag.tag-sys { color: var(--text-muted); }
.log-entry .log-tag.tag-dry { color: var(--yellow); border-color: var(--yellow); }
.log-entry .log-cc {
font-family: var(--font-display);
font-size: 9px; font-weight: 600; letter-spacing: 0.6px;
color: var(--text-dim); flex-shrink: 0; min-width: 22px;
}
.log-entry .log-moniker {
color: var(--text); font-weight: 500;
overflow: hidden; text-overflow: ellipsis;
max-width: 200px; flex-shrink: 1;
}
.log-entry .log-addr {
color: var(--text-muted); font-size: 10px; flex-shrink: 0;
}
.addr-copy {
cursor: pointer;
}
.addr-copy:hover {
color: var(--accent);
}
.log-entry .log-mbps {
color: var(--green); font-weight: 700;
flex-shrink: 0; min-width: 60px; text-align: right;
}
.log-entry .log-mbps.slow { color: var(--yellow); }
.log-entry .log-mbps.dead { color: var(--red); }
.log-entry .log-err-code {
color: var(--red); font-weight: 600;
flex-shrink: 0;
}
.log-entry .log-msg { color: var(--text); flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }
.log-entry .log-copy {
margin-left: auto; flex-shrink: 0;
background: transparent; border: 1px solid var(--border);
color: var(--text-dim); font-size: 10px; line-height: 1;
padding: 2px 6px; border-radius: 3px; cursor: pointer;
}
.log-entry .log-copy:hover { border-color: var(--text); color: var(--text); background: var(--bg-card); }
.log-filters {
display: inline-flex; gap: 2px;
border: 1px solid var(--border); border-radius: 5px;
overflow: hidden; font-size: 10px; letter-spacing: 0.5px;
font-family: var(--font-display);
}
.log-filter-btn {
padding: 3px 8px; color: var(--text-muted); font-weight: 600;
cursor: pointer; user-select: none;
}
.log-filter-btn.active { background: var(--bg-input); color: var(--text); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
/* ─── Toast ─── */
.toast {
position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
background: var(--bg-card-solid); color: var(--text);
padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border);
font-size: 12px; font-family: var(--font-display); letter-spacing: 0.5px;
z-index: 9000; opacity: 0; pointer-events: none;
transition: opacity 0.18s ease;
}
.toast.show { opacity: 1; }
/* ─── Testing Paused overlay ─── */
.paused-overlay {
position: fixed; inset: 0; z-index: 8000;
background: var(--bg);
display: none;
align-items: center; justify-content: center;
flex-direction: column;
text-align: center;
padding: 40px 24px;
}
.paused-overlay.show { display: flex; }
.paused-stack {
display: flex; flex-direction: column; align-items: center;
gap: 28px;
max-width: 640px;
}
.paused-logo-wrap {
position: relative;
width: 140px; height: 140px;
display: flex; align-items: center; justify-content: center;
}
.paused-logo-wrap::before {
content: '';
position: absolute; inset: -12px;
border-radius: 50%;
border: 1px solid var(--border);
opacity: 0.6;
}
.paused-logo-wrap::after {
content: '';
position: absolute; inset: -24px;
border-radius: 50%;
border: 1px solid var(--border);
opacity: 0.25;
}
.paused-logo {
width: 140px; height: 140px; border-radius: 50%;
object-fit: cover;
border: 1px solid var(--border);
background: var(--bg-card);
position: relative; z-index: 1;
}
.paused-pause-badge {
position: absolute; right: -6px; bottom: -6px; z-index: 2;
width: 46px; height: 46px; border-radius: 50%;
background: var(--yellow);
color: var(--bg);
display: flex; align-items: center; justify-content: center;
border: 3px solid var(--bg);
box-shadow: 0 0 0 0 rgba(255, 200, 0, 0.45);
animation: pulse 1.8s infinite;
}
.paused-pause-badge svg { width: 18px; height: 18px; display: block; }
.paused-title {
font-family: var(--font-display);
font-size: 44px; font-weight: 800;
letter-spacing: 4px; text-transform: uppercase;
color: var(--text);
margin: 0; line-height: 1.1;
}
.paused-body {
font-family: var(--font-display);
font-size: 17px; color: var(--text-dim);
max-width: 560px; line-height: 1.65; margin: 0;
letter-spacing: 0.3px;
}
.paused-sub {
font-family: var(--font-display);
font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
color: var(--text-muted);
margin: 0;
}
@media (max-width: 640px) {
.paused-title { font-size: 30px; letter-spacing: 2.5px; }
.paused-body { font-size: 14px; }
.paused-logo, .paused-logo-wrap { width: 110px; height: 110px; }
.paused-pause-badge { width: 38px; height: 38px; }
.paused-pause-badge svg { width: 14px; height: 14px; }
}
/* Mobile desktop gate */
.mobile-gate { display: none; }
.mobile-gate-inner { max-width: 420px; padding: 32px 24px; text-align: center; }
.mobile-gate-logo {
width: 96px; height: 96px; border-radius: 50%;
object-fit: cover;
border: 1px solid var(--border);
background: var(--bg-card);
margin: 0 auto 20px;
display: block;
}
.mobile-gate-title {
font-family: var(--font-display); font-size: 22px; font-weight: 700;
letter-spacing: 1px; text-transform: uppercase; color: var(--text);
margin: 0 0 12px;
}
.mobile-gate-body { color: var(--text-dim); font-size: 13px; line-height: 1.6; margin: 0 0 16px; }
.mobile-gate-url {
font-family: var(--font-mono); font-size: 12px; color: var(--text);
background: var(--bg-input); border: 1px solid var(--border);
border-radius: 6px; padding: 8px 12px; margin: 0 auto 14px; display: inline-block;
}
.mobile-gate-link {
font-size: 11px; color: var(--text-dim); text-decoration: underline;
}
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
.mobile-gate {
display: flex; position: fixed; inset: 0; z-index: 9999;
background: var(--bg); align-items: center; justify-content: center;
}
html, body { overflow: hidden !important; }
body > :not(.mobile-gate) { visibility: hidden; }
}
</style>
</head>
<body class="boot-pending">
<!-- Testing Paused overlay -->
<div class="paused-overlay" id="pausedOverlay" aria-hidden="true" role="status" aria-live="polite">
<div class="paused-stack">
<div class="paused-logo-wrap">
<img src="/logo.jpg" alt="Sentinel" class="paused-logo">
<span class="paused-pause-badge" aria-hidden="true">
<svg viewBox="0 0 24 24" fill="currentColor" focusable="false">
<rect x="6" y="4" width="4" height="16" rx="1.5"/>
<rect x="14" y="4" width="4" height="16" rx="1.5"/>
</svg>
</span>
</div>
<p class="paused-sub">Sentinel Node Tester</p>
<h1 class="paused-title">Testing Has Been Paused</h1>
<p class="paused-body">Live testing will resume automatically when a test is started</p>
</div>
</div>
<!-- Mobile desktop gate -->
<div class="mobile-gate" id="mobileGate" aria-hidden="true">
<div class="mobile-gate-inner">
<img src="/logo.jpg" alt="Sentinel" class="mobile-gate-logo">
<h1 class="mobile-gate-title">View on Desktop</h1>
<p class="mobile-gate-body">Sentinel Node Tester is desktop-only for now — the live view needs a wide screen. Open this page on a desktop browser.</p>
<div class="mobile-gate-url" id="mobileGateUrl">sentinel-p2p.com/live</div>
<a class="mobile-gate-link" href="https://sentinel.co">Back to sentinel.co</a>
</div>
</div>
<!-- Floating top-right -->
<div class="top-right-controls">
<button type="button" onclick="openAboutModal()" class="top-icon-btn" title="About" aria-label="About" style="background:transparent;border:1px solid var(--border);cursor:pointer;padding:0;color:inherit;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:8px">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>
</button>
<button id="btnTheme" class="theme-toggle-btn" onclick="toggleTheme()" title="Toggle theme" aria-label="Toggle theme">
<svg id="themeIconDark" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
<svg id="themeIconLight" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:none"><circle cx="12" cy="12" r="4"></circle><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"></path></svg>
</button>
</div>
<main>
<!-- TEST RUN banner — full-width strobe so the public can't miss that
this is a test-run audit (skipped rows, no real measurements). -->
<div id="testRunBanner" class="test-run-banner" role="alert" aria-live="polite">
<span>TEST RUN — SIMULATED AUDIT (NO REAL MEASUREMENTS)</span>
</div>
<!-- Page header -->
<div class="live-page-header">
<div class="live-page-header-left">
<svg width="26" height="26" viewBox="0 0 30 31" fill="none" xmlns="http://www.w3.org/2000/svg" class="brand-logo" aria-hidden="true">
<path d="M27.3966 1.4387C27.7459 1.4387 28.0281 1.72093 28.0281 2.07017V12.1372V12.7626C28.0362 14.0032 28.0464 15.5525 27.8291 17.1951C27.5773 19.1099 27.0778 20.6672 26.3103 21.9566C23.8068 26.1535 19.3093 29.2297 15.0879 29.6399C15.0676 29.6419 15.0473 29.6439 15.027 29.6439C15.0067 29.6439 14.9864 29.6439 14.9661 29.6399C10.7407 29.2256 6.24323 26.1515 3.74372 21.9566C2.97214 20.6672 2.47671 19.1078 2.22493 17.1951C2.0097 15.5525 2.01986 14.0053 2.03001 12.7626V12.1372L2.03204 2.07017C2.03204 1.72093 2.31427 1.4387 2.66351 1.4387H27.3966ZM27.3966 0.17981H2.66148C1.61985 0.17981 0.771119 1.02854 0.771119 2.07017V12.7565C0.758936 13.9606 0.746754 15.6154 0.974166 17.3576C1.25031 19.4469 1.80057 21.1606 2.65945 22.6002C3.97926 24.8134 5.82292 26.7667 7.99349 28.253C10.1844 29.7515 12.5458 30.6632 14.826 30.8886C14.891 30.8967 14.958 30.9008 15.025 30.9008C15.092 30.9008 15.157 30.8967 15.224 30.8886C17.5022 30.6632 19.8636 29.7536 22.0545 28.2551C24.225 26.7688 26.0707 24.8134 27.3926 22.6002C28.2535 21.1586 28.8037 19.4449 29.0779 17.3596C29.3053 15.6337 29.2951 14.0418 29.287 12.7606V12.1332V2.0722C29.287 1.02854 28.4383 0.18184 27.3966 0.18184V0.17981Z" fill="currentColor"/>
<path d="M25.6792 14.1846C25.864 14.3247 26.1279 14.1927 26.1279 13.9612L26.1218 12.6881V3.61598C26.1239 3.45963 25.998 3.33374 25.8416 3.33374H4.21715C4.0608 3.33374 3.93491 3.45963 3.93491 3.61598V9.1957C3.93491 9.43529 3.98974 9.67083 4.09735 9.88402C4.20496 10.0972 4.35928 10.284 4.55217 10.4262L20.8182 22.5907C20.9604 22.6963 20.9705 22.9013 20.8406 23.0232C20.5401 23.3074 20.2233 23.5734 19.8944 23.8252C19.7929 23.9024 19.6548 23.9024 19.5553 23.8272L4.38365 12.4587C4.19887 12.3206 3.93491 12.4505 3.93491 12.684C3.93491 14.6333 3.76232 18.2699 5.40091 21.0557C7.23036 24.1684 10.3715 26.6252 13.604 27.4212C14.071 27.5349 14.538 27.6161 15.005 27.6587C15.0233 27.6608 15.0416 27.6608 15.0578 27.6587C17.1736 27.4679 19.3259 26.5014 21.1736 25.0415C21.6365 24.6739 22.0812 24.278 22.5035 23.8536C23.336 23.0151 24.0629 22.077 24.6619 21.0597C25.2041 20.1399 25.5472 19.1267 25.7645 18.1135C25.8132 17.8942 25.8538 17.6729 25.8904 17.4495C25.9858 16.8688 25.7502 16.282 25.2812 15.9308L11.5086 5.63223C11.2933 5.46979 11.405 5.12664 11.6791 5.12664H13.5025C13.5634 5.12664 13.6223 5.14695 13.673 5.1835L25.6812 14.1866L25.6792 14.1866L25.6792 14.1846Z" fill="currentColor"/>
</svg>
<div class="pulse-dot" id="headerDot"></div>
<div>
<h1 class="live-page-title">
Sentinel dVPN Node Test
<span id="liveModeBadge" style="display:none;font-size:11px;font-weight:700;letter-spacing:1px;text-transform:uppercase;padding:4px 10px;border:1.5px solid var(--accent);color:var(--accent);border-radius:4px;margin-left:10px;vertical-align:middle">
<span id="liveModeBadgeLabel">—</span>
</span>
<span id="testRunBadge" class="test-run-badge" style="display:none">TEST RUN</span>
</h1>
<div class="live-page-sub" id="liveModeSub">Live public testing — Sentinel dVPN network</div>
</div>
</div>
<div class="live-page-header-right" aria-label="Network baseline stats">
<div class="live-header-stat">
<div class="live-header-stat-label">Server Baseline</div>
<div class="live-header-stat-value" id="hdrBaseline">—</div>
</div>
<div class="live-header-divider"></div>
<div class="live-header-stat">
<div class="live-header-stat-label">Network Median</div>
<div class="live-header-stat-value" id="hdrNetworkMedian">—</div>
</div>
</div>
</div>
<!-- Batch stat tiles (mirror admin dev panel) -->
<div class="stats-grid" id="liveStatsGrid">
<div class="stat-card">
<div class="stat-label">Tested</div>
<div class="stat-value" id="lsTested">0</div>
<div class="stat-sub" id="lsTestedSub">no data yet</div>
</div>
<div class="stat-card">
<div class="stat-label">Total Failed</div>
<div class="stat-value" id="lsTotalFailed">0</div>
<div class="stat-sub" id="lsTotalFailedPct">0% failure rate</div>
</div>
<div class="stat-card">
<div class="stat-label">Pass 10 Mbps SLA</div>
<div class="stat-value" id="lsPassedSLA">0</div>
<div class="stat-sub" id="lsPassedSLAPct">0% of connected</div>
</div>
<div class="stat-card">
<div class="stat-label">Dead Plan Nodes</div>
<div class="stat-value" id="lsDeadPlan">0</div>
<div class="stat-sub" id="lsDeadPlanPct">No plan failures</div>
</div>
<div class="stat-card">
<div class="stat-label">Not Online</div>
<div class="stat-value" id="lsNotOnline">0</div>
<div class="stat-sub" id="lsNotOnlineSub">0 nodes offline</div>
</div>
<div class="stat-card">
<div class="stat-label">Pass Rate</div>
<div class="stat-value" id="lsPassRate">0%</div>
<div class="stat-sub">connected / tested</div>
</div>
</div>
<!-- Broadcast off notice -->
<div id="broadcastOffNotice" style="display:none;padding:14px 20px;border:1px solid var(--border);background:var(--bg-card);border-radius:var(--radius-sm);font-family:var(--font-display);font-size:12px;font-weight:600;letter-spacing:0.5px;color:var(--text-dim);text-align:center;">
Live broadcast is off — showing last completed run
</div>
<!-- Current Batch panel -->
<div class="glass-panel" id="cbCard" style="padding:18px 22px;display:flex;flex-direction:column;gap:14px;">
<div class="cb-header-row">
<div style="display:flex;align-items:center;gap:10px;">
<span class="cb-title">Current Batch</span>
<div class="pulse-dot" id="cbDot"></div>
</div>
</div>
<div class="cb-progress-row">
<span class="cb-count" id="cbCount">0 / 0 nodes tested</span>
<div class="cb-progress-track">
<div class="cb-progress-fill" id="cbProgressFill"></div>
</div>
<span class="cb-eta" id="cbEta" style="font-size:11px;color:var(--text-muted);font-variant-numeric:tabular-nums;min-width:80px;text-align:right">ETA —</span>
</div>
<div class="cb-snapshot-row">
<span class="cb-snap-item">Batch size: <strong id="cbSnapshot">—</strong></span>
<span class="cb-snap-item">Passed: <strong class="cb-snap-pass" id="cbPassed">0</strong></span>
<span class="cb-snap-item">Failed: <strong class="cb-snap-fail" id="cbFailed">0</strong></span>
</div>
<div class="cb-complete-msg" id="cbCompleteMsg"></div>
</div>
<!-- Search bar — filters dVPN Node Connections by moniker, address, country, or city -->
<div class="glass-panel" id="liveSearchBar" style="padding:10px 14px;margin-bottom:16px;display:flex;align-items:center;gap:10px;">
<span style="font-size:11px;letter-spacing:1.2px;color:var(--text-muted);font-weight:600;">SEARCH</span>
<input
type="search"
id="liveSearchInput"
placeholder="Filter nodes by moniker, address, country, or city…"
autocomplete="off"
spellcheck="false"
style="flex:1;background:var(--bg-input);border:1px solid var(--border);border-radius:5px;color:var(--text);padding:7px 10px;font-size:12px;outline:none;"
/>
<button
type="button"
id="liveSearchClear"
onclick="clearLiveSearch()"
style="display:none;background:transparent;border:1px solid var(--border);border-radius:5px;color:var(--text-muted);padding:6px 10px;font-size:11px;letter-spacing:0.5px;cursor:pointer;"
>CLEAR</button>
</div>
<!-- Data grid — dVPN Node Connections + Live Log -->
<div class="data-grid">
<div class="glass-panel table-container">
<div class="panel-header">
<div class="panel-title">dVPN Node Connections</div>
<div style="display:flex;align-items:center;gap:6px">
<span id="filterBtns" style="display:inline-flex;gap:2px;border:1px solid var(--border);border-radius:5px;overflow:hidden;font-size:10px;letter-spacing:0.5px">
<span onclick="setFilter('all')" id="filterAll" style="padding:3px 8px;background:var(--bg-input);color:var(--text);font-weight:600;cursor:pointer">ALL</span>
<span onclick="setFilter('pass')" id="filterPass" style="padding:3px 8px;color:var(--text-muted);font-weight:600;cursor:pointer">PASS</span>
<span onclick="setFilter('fail')" id="filterFail" style="padding:3px 8px;color:var(--text-muted);font-weight:600;cursor:pointer">FAIL</span>
<span onclick="setFilter('slow')" id="filterSlow" style="padding:3px 8px;color:var(--text-muted);font-weight:600;cursor:pointer">SLOW</span>
<span onclick="setFilter('wg')" id="filterWg" style="padding:3px 8px;color:var(--text-muted);font-weight:600;cursor:pointer">WG</span>
<span onclick="setFilter('v2')" id="filterV2" style="padding:3px 8px;color:var(--text-muted);font-weight:600;cursor:pointer">V2</span>
</span>
<span style="font-size:11px;color:var(--text-secondary)" id="resultsCountLabel">0 Entries</span>
</div>
</div>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Transport</th>
<th>Moniker</th>
<th>Node</th>
<th>Country</th>
<th>City</th>
<th style="text-align:center">Peers</th>
<th style="text-align:right">Speed</th>
<th style="text-align:right">Baseline</th>
<th style="text-align:center">Result</th>
<th style="text-align:center">Log</th>
</tr>
</thead>
<tbody id="resultsBody"></tbody>
</table>
<div id="liveResultsPager" class="pager" style="display:none;align-items:center;justify-content:flex-end;gap:8px;padding:8px 12px;border-top:1px solid var(--border)">
<button class="btn-paginate" id="liveResultsPrev" type="button">← Prev</button>
<span id="liveResultsPageInfo" style="color:var(--text-dim);font-size:11px"></span>
<button class="btn-paginate" id="liveResultsNext" type="button">Next →</button>
</div>
</div>
</div>
<div class="glass-panel log-container">
<div class="panel-header">
<div class="panel-title">Live Log</div>
<div style="display:flex;align-items:center;gap:8px">
<span class="log-filters" id="logFilters">
<span class="log-filter-btn active" data-lf="all" onclick="setLogFilter('all')">ALL</span>
<span class="log-filter-btn" data-lf="node" onclick="setLogFilter('node')">NODE</span>
<span class="log-filter-btn" data-lf="fail" onclick="setLogFilter('fail')">FAIL</span>
<span class="log-filter-btn" data-lf="sys" onclick="setLogFilter('sys')">SYS</span>
</span>
<span style="font-size:11px;color:var(--text-dim)" id="logStatus">idle</span>
</div>
</div>
<div class="logs" id="logBody"></div>
</div>
</div>
</main>
<div class="toast" id="toast"></div>
<script>
'use strict';
// ─── Boot / theme ───
let _broadcastLive = false;
async function checkBroadcastState() {
try {
const r = await fetch('/api/broadcast', { cache: 'no-store' });
if (!r.ok) return;
const d = await r.json();
const wasLive = _broadcastLive;
_broadcastLive = !!d.broadcastLive;
const notice = document.getElementById('broadcastOffNotice');
if (_broadcastLive) {
if (notice) notice.style.display = 'none';
// Reconcile against current admin status; idle = still paused.
applyPauseFromState();
if (!wasLive) {
connectSSE();
seedLogsFromRest();
}
} else {
// Broadcast off: show the full pause overlay, not just the inline notice.
// Public visitors must see "Testing Has Been Paused" — last-completed
// run snapshot still loads behind the overlay for context.
if (notice) notice.style.display = 'none';
showPaused(true);
if (_sse) { try { _sse.close(); } catch (_) {} _sse = null; }
}
} catch {}
}
// Pull the persisted log backlog over REST. Used when SSE was already
// open before broadcast flipped on, or as a defensive seed on visibility
// changes — the SSE init only fires on the initial connection.
async function seedLogsFromRest() {
try {
const r = await fetch('/api/public/logs', { cache: 'no-store' });
if (!r.ok) return;
const j = await r.json();
if (!j || !Array.isArray(j.logs) || !j.logs.length) return;
const body = document.getElementById('logBody');
if (body && body.children.length === 0) {
for (const line of j.logs) appendLog(line);
}
} catch {}
}
document.addEventListener('DOMContentLoaded', async () => {
document.body.classList.remove('boot-pending');
const urlEl = document.getElementById('mobileGateUrl');
if (urlEl) urlEl.textContent = location.host + '/live';
applyThemeIcons();
// Paint cached snapshot first so a refresh shows data instantly,
// then resolve broadcast state and reconcile with server.
rehydrateFromCache();
const _liveResultsPrev = document.getElementById('liveResultsPrev');
const _liveResultsNext = document.getElementById('liveResultsNext');
if (_liveResultsPrev) _liveResultsPrev.addEventListener('click', () => liveGoPage(-1));
if (_liveResultsNext) _liveResultsNext.addEventListener('click', () => liveGoPage(1));
const _liveSearchInput = document.getElementById('liveSearchInput');
if (_liveSearchInput) _liveSearchInput.addEventListener('input', (e) => setLiveSearch(e.target.value));
renderTable();
renderLiveStats();
// Resolve broadcast state BEFORE loading the current batch — otherwise
// loadCurrentBatch races and may un-pause the overlay using the default
// (broadcastLive=false) before we know the real state.
await checkBroadcastState();
// Seed full live state + results via REST so refresh paints the same
// dashboard the operator sees, even before the SSE init message lands.
if (_broadcastLive) await seedLiveStateFromRest();
loadCurrentBatch();
loadHeaderStats();
applyPauseFromState();
setInterval(checkBroadcastState, 30000);
document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'visible') checkBroadcastState();
});
});
// Normalize a node's serviceType into the lowercase string the row
// renderer expects ('wireguard' | 'v2ray' | null). The sanitizer can hand
// us either a number (1=wireguard, 2=v2ray) or a string — both must
// produce a transport badge.
function normalizeServiceType(v) {
if (v == null) return null;
if (v === 1 || v === '1') return 'wireguard';
if (v === 2 || v === '2') return 'v2ray';
const s = String(v).toLowerCase();
if (s.includes('wire')) return 'wireguard';
if (s.includes('v2')) return 'v2ray';
return null;
}
// ─── Header network stats (baseline + chain-wide) ───
let _headerBaseline = null;
function setHeaderBaseline(mbps) {
const el = document.getElementById('hdrBaseline');
if (!el) return;
const n = Number(mbps);
if (!Number.isFinite(n) || n <= 0) { el.textContent = '—'; return; }
_headerBaseline = n;
el.textContent = n.toFixed(1) + ' Mbps';
el.style.color = n >= 30 ? '' : 'var(--red)';
}
// Mean of baselineHistory (last-10 direct-connection speedtest readings).
// Falls back to the latest single reading when no history is forwarded yet.
function computeBaselineAvg(state) {
const hist = Array.isArray(state?.baselineHistory) ? state.baselineHistory : [];
const samples = hist.map(h => Number(h?.mbps)).filter(n => Number.isFinite(n) && n > 0);
if (samples.length > 0) return samples.reduce((a, b) => a + b, 0) / samples.length;
const latest = Number(state?.baselineMbps);
return Number.isFinite(latest) && latest > 0 ? latest : null;
}
async function loadHeaderStats() {
// Paint from REST first so the header tiles have values on a cold load
// even before SSE init arrives.
try {
const r = await fetch('/api/public/test/status', { cache: 'no-store' });
if (r.ok) {
const j = await r.json();
if (j && j.baselineMbps != null) setHeaderBaseline(j.baselineMbps);
}
} catch {}
try {
const r = await fetch('/api/public/stats', { cache: 'no-store' });
if (r.ok) {
const j = await r.json();
const set = (id, v) => { const el = document.getElementById(id); if (el) el.textContent = v; };
if (j.totalNodes != null) set('hdrNetworkNodes', Number(j.totalNodes).toLocaleString());
if (j.medianMbps != null) set('hdrNetworkMedian', Number(j.medianMbps).toFixed(1) + ' Mbps');
if (j.passingPct != null) set('hdrNetworkPass', Number(j.passingPct).toFixed(0) + '%');
}
} catch {}
// Then layer live-batch values on top once _liveState / resultsArr exist.
applyHeaderStatsFromState();
}
// REST fallback so a refresh paints stats + table BEFORE SSE init lands.
async function seedLiveStateFromRest() {
try {
const r = await fetch('/api/public/live-state', { cache: 'no-store' });
if (!r.ok) return;
const j = await r.json();
if (!j || !j.broadcastLive) return;
if (j.state) mergeLiveState(j.state);
// Pin the active batch id BEFORE upserting rows so subsequent SSE
// events (batch:start in particular) don't see `_cb.batchId == null`
// alongside painted rows and treat the seeded data as stale.
if (j.activeBatchId != null) {
_cb.batchId = j.activeBatchId;
if (j.snapshotSize != null) _cb.snapshotSize = j.snapshotSize;
}
if (Array.isArray(j.results)) {
for (const r2 of j.results) {
if (!r2 || !r2.address) continue;
upsert({
address: r2.address,
moniker: r2.moniker || '',
country: r2.country || '',