-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
957 lines (932 loc) · 68.4 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>wireleap</title>
<link href="./build/index.css" rel="stylesheet">
<script defer src="./vendor/alpinejs.min.js"></script>
<script src="./index.js"></script>
<link id="favicon" rel="shortcut icon" href="">
</head>
<body>
<div x-data="alpineInstance()" x-init="initialize()">
<div class="flex h-screen">
<!-- panel:info -->
<div x-cloak class="relative z-10" role="dialog" aria-modal="true">
<div class="fixed inset-y-0 left-0 flex border-r border-gray-400"
x-show="currentPanel=='info'"
x-transition:enter="transform transition ease-in-out duration-500"
x-transition:enter-start="-translate-x-full"
x-transition:enter-end="translate-x-0"
x-transition:leave="transform transition ease-in-out duration-500"
x-transition:leave-start="translate-x-0"
x-transition:leave-end="-translate-x-full">
<div class="flex-col min-w-[500px] bg-gray-700 overflow-y-auto scroll-container">
<div class="flex items-center justify-between p-4 bg-gray-600">
<button @click="currentPanel=''" class="text-white focus:outline-none rounded-full -m-2 p-1 hover:bg-white hover:bg-opacity-25 transition duration-300">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
</svg>
</button>
<span class="text-md text-gray-300">Info</span>
<div></div>
</div>
<p class="text-gray-300 text-sm uppercase mt-12 mx-4">Network</p>
<div class="m-4 divide-y divide-gray-600">
<template x-if="cache.contract">
<div class="space-y-3 pt-5 w-full text-sm">
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Operator</span>
<span class="text-gray-50" x-text="cache.contract.metadata.operator || 'Not specified'"></span>
</div>
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Name</span>
<span class="text-gray-50" x-text="cache.contract.metadata.name || 'Not specified'"></span>
</div>
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Website</span>
<a class="text-gray-50 border-b border-dotted border-gray-500 hover:border-gray-300" :href="cache.contract.metadata.operator_url">Link</a>
</div>
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Privacy policy</span>
<a class="text-gray-50 border-b border-dotted border-gray-500 hover:border-gray-300" :href="cache.contract.metadata.privacy_policy">Link</a>
</div>
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Terms of service</span>
<a class="text-gray-50 border-b border-dotted border-gray-500 hover:border-gray-300" :href="cache.contract.metadata.terms_of_service">Link</a>
</div>
</div>
</template>
<template x-if="!cache.contract">
<div class="space-y-3 pt-5 w-full text-sm">
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Not configured</span>
</div>
</div>
</template>
</div>
<p class="text-gray-300 text-sm uppercase mt-12 mx-4">Client runtime</p>
<div class="m-4 divide-y divide-gray-600">
<template x-if="cache.runtime">
<div class="space-y-3 pt-5 w-full text-sm">
<div x-show="cache.status.upgrade.required" class="bg-red-200 text-red-700 rounded-md">
<p class="w-full bg-red-500 text-red-100 rounded-t-md p-2">Upgrade is required</p>
<template x-if="!cache.runtime.upgrade.supported">
<div class="font-mono whitespace-nowrap py-3 pl-2">
<p>Inline upgrades are not enabled in your build.</p>
</div>
</template>
<template x-if="cache.runtime.upgrade.supported && cache.forwarders_tun && cache.forwarders_socks">
<div class="font-mono whitespace-nowrap py-3 pl-2">
<p x-text="'cd '+ cache.status.home"></p>
<p x-show="cache.forwarders_tun.state == 'active'" x-text="'.' + osSlash() + 'wireleap tun stop'"></p>
<p x-show="cache.forwarders_tun.binary.ok">sudo rm wireleap_tun</p>
<p x-show="cache.forwarders_socks.state == 'active'" x-text="'.' + osSlash() + 'wireleap socks stop'"></p>
<p x-text="'.' + osSlash() + 'wireleap stop'"></p>
<p x-text="'.' + osSlash() + 'wireleap upgrade'"></p>
<p x-text="'.' + osSlash() + 'wireleap start'"></p>
<p x-show="cache.forwarders_tun.binary.ok">sudo chown 0:0 wireleap_tun</p>
<p x-show="cache.forwarders_tun.binary.ok">sudo chmod u+s wireleap_tun</p>
</div>
</template>
</div>
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">API</span>
<span class="text-gray-50" x-text="cache.runtime.versions.api"></span>
</div>
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Software</span>
<span class="text-gray-50" x-text="cache.runtime.versions.software"></span>
</div>
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Relay protocol</span>
<span class="text-gray-50" x-text="cache.runtime.versions['client-relay']"></span>
</div>
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Contract protocol</span>
<span class="text-gray-50" x-text="cache.runtime.versions['client-contract']"></span>
</div>
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Directory protocol</span>
<span class="text-gray-50" x-text="cache.runtime.versions['client-dir']"></span>
</div>
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Platform</span>
<span class="text-gray-50" x-text="cache.runtime.platform.os + '/' + cache.runtime.platform.arch"></span>
</div>
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Build time</span>
<span class="text-gray-50" x-text="epochToDate(cache.runtime.build.time)"></span>
</div>
</div>
</template>
<template x-if="!cache.runtime">
<div class="space-y-3 pt-5 w-full text-sm">
<div class="flex items-center justify-between">
<span class="font-medium text-gray-300">Unknown</span>
</div>
</div>
</template>
</div>
</div>
</div>
</div>
<!-- panel:circuit -->
<div x-cloak class="relative z-10" role="dialog" aria-modal="true">
<div class="fixed inset-y-0 left-0 flex border-r border-gray-400"
x-show="currentPanel=='circuit'"
x-transition:enter="transform transition ease-in-out duration-500"
x-transition:enter-start="-translate-x-full"
x-transition:enter-end="translate-x-0"
x-transition:leave="transform transition ease-in-out duration-500"
x-transition:leave-start="translate-x-0"
x-transition:leave-end="-translate-x-full">
<div class="h-screen flex flex-col min-w-[500px] bg-gray-700 overflow-y-hidden scroll-container">
<div class="flex items-center justify-between p-4 bg-gray-600">
<button @click="currentPanel=''" class="text-white focus:outline-none rounded-full -m-2 p-1 hover:bg-white hover:bg-opacity-25 transition duration-300">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
</svg>
</button>
<span class="text-md text-gray-300" x-text="waiting.length > 0 ? waiting.at(-1) : 'Circuit'"></span>
<button @click="refresh()" title="refresh" class="text-white focus:outline-none rounded-full -my-2 -mx-1 p-1 hover:bg-white hover:bg-opacity-25 transition duration-300">
<svg xmlns="http://www.w3.org/2000/svg" :class="[ waiting.length > 0 ? 'animate-spin' : '' ]" class="h-5 w-5" viewBox="0 0 1024 1024" fill="currentColor">
<path d="M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z" />
</svg>
</button>
</div>
<template x-if="cache.config">
<template x-if="cache.status">
<div class="h-screen flex flex-col"
x-data="{hops: cache.config.broker.circuit.hops, active_circuit: cache.status.broker.active_circuit, whitelist: Array.from(cache.config.broker.circuit.whitelist), whitelist_enabled: cache.config.broker.circuit.whitelist.length > 0}">
<!-- panel:circuit:buttons -->
<div class="px-4 mt-5 flex w-full items-center justify-between text-sm">
<button @click="apiPostJson('/api/reload')" :disabled="cache.status.broker.active_circuit.length == 0" type="button" class="disabled:text-gray-400 mb-1 text-gray-50 hover:text-gray-200 font-medium">reset circuit</button>
<button x-cloak x-show="isWhitelistValid(whitelist, hops)" @click="apiPostJson('/api/config', {'broker': {'circuit': {'hops': hops, 'whitelist': whitelist}}}); whitelist_enabled = whitelist.length > 0;" :disabled="hops == cache.config.broker.circuit.hops && arraysEqual(whitelist, cache.config.broker.circuit.whitelist)" type="button" class="disabled:text-gray-400 mb-1 text-gray-50 hover:text-gray-200 font-medium">apply changes</button>
<button x-cloak x-show="!isWhitelistValid(whitelist, hops)" disabled class="mb-1 font-medium text-red-400">whitelist not valid</button>
</div>
<!-- panel:circuit:hops:selection -->
<div class="px-4 mt-5 flex rounded-md shadow-sm text-sm">
<button @click="hops -= 1" :disabled="hops == 1" type="button" class="disabled:text-gray-200 -ml-px relative inline-flex items-center space-x-2 px-4 py-2 border border-gray-400 bg-gray-500 text-gray-50 hover:bg-gray-400 text-sm font-medium rounded-l-md focus:outline-none">-</button>
<div class="bg-gray-600 text-gray-50 block w-full border-t border-b border-gray-400 flex items-center justify-center text-center space-x-1">
<span x-text="hops"></span>
<span x-text="hops > 1 ? ' hops' : ' hop'"></span>
</div>
<button @click="hops += 1" :disabled="hops == maxHops()" type="button" class="disabled:text-gray-200 -ml-px relative inline-flex items-center space-x-2 px-4 py-2 border border-gray-400 bg-gray-500 text-gray-50 hover:bg-gray-400 text-sm font-medium rounded-r-md focus:outline-none">+</button>
</div>
<!-- panel:circuit:hops:circuit -->
<div x-show="cache.status.broker.active_circuit.length > 0 && hops == cache.config.broker.circuit.hops">
<div class="relative mx-4 mt-5 flex items-center justify-around max-w-full">
<div class="absolute inset-0 flex items-center" aria-hidden="true">
<div class="bg-green-400 h-0.5 w-full"></div>
</div>
<template x-for="i in hops">
<div class="border-green-400 group relative w-8 h-8 flex items-center justify-center bg-gray-700 border-2 rounded-full"></div>
</template>
</div>
<div class="relative mx-4 mt-5 flex text-center items-center justify-around max-w-full">
<template x-for="relay in cache.status.broker.active_circuit">
<div class="text-green-400 flex-1 w-10 text-xs truncate" :title="relay" x-text="relay.split(':')[1].replace('//','')"></div>
</template>
</div>
</div>
<div x-show="cache.status.broker.active_circuit.length == 0 || hops != cache.config.broker.circuit.hops">
<div class="relative mx-4 mt-5 flex items-center justify-around max-w-full">
<div class="absolute inset-0 flex items-center" aria-hidden="true">
<div class="bg-gray-400 h-0.5 w-full"></div>
</div>
<template x-for="i in hops">
<div class="border-gray-400 group relative w-8 h-8 flex items-center justify-center bg-gray-700 border-2 rounded-full"></div>
</template>
</div>
<div class="relative mx-4 mt-5 flex text-center items-center justify-around max-w-full">
<template x-for="(i, index) in hops">
<div class="text-gray-400 flex-1 w-10 text-xs truncate" x-text="i == hops ? 'backing' : (i == 1 && hops > 1) ? 'fronting' : 'entropic'"></div>
</template>
</div>
</div>
<!-- panel:circuit:whitelist:toggle -->
<div class="mt-10">
<div @click="whitelist_enabled = !whitelist_enabled; whitelist_enabled ? whitelist=Array.from(cache.config.broker.circuit.whitelist) : whitelist.splice(0, whitelist.length)"
class="px-4 cursor-pointer flex justify-between items-center py-3 hover:bg-gray-600 hover:bg-opacity-75 transition duration-300">
<span class="flex-grow flex flex-col">
<span class="text-sm font-medium text-gray-300">Whitelist</span>
<span class="text-sm text-gray-50">Enable for customized relay selection</span>
</span>
<button type="button"
:class="whitelist_enabled ? 'bg-green-500' : 'bg-gray-400'"
class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" role="switch" aria-checked="false">
<span aria-hidden="true" :class="whitelist_enabled ? 'translate-x-5' : 'translate-x-0'" class="pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"></span>
</button>
</div>
</div>
<!-- panel:circuit:whitelist:filter -->
<div class="mx-4 mt-2">
<input class="w-full px-2 py-2 text-gray-100 bg-gray-600 border border-gray-400 focus:border-blue-300 ring-blue-300 focus:ring-1 focus:outline-none rounded-md"
type="text" placeholder="filter..." x-model="filter" x-ref="filter"
@keyup.slash.window="$nextTick(() => $refs.filter.focus());"
@keyup.escape.window="filter = ''; $nextTick(() => $refs.filter.blur());"/>
</div>
<!-- panel:circuit:whitelist:list -->
<template x-if="cache.relays">
<div class="flex-grow hover:overflow-y-auto scroll-container mr-2 pb-24">
<template x-for="role in ['fronting', 'entropic', 'backing']" :key="role">
<div class="space-y-3">
<h3 class="flex mx-4 py-1 mt-3 border-b border-gray-500 text-gray-300 text-sm justify-between">
<span x-show="!whitelist_enabled" x-text="role + ' (' + filterBy(cache.relays, 'role', role).length + ')'"></span>
<span x-show="whitelist_enabled" x-text="role + ' (' + whitelistRoleCount(whitelist, role) + '/' + filterBy(cache.relays, 'role', role).length + ')'"></span>
<span x-show="whitelist_enabled && !isWhitelistRoleValid(whitelist, hops, role)" class="text-red-400" x-text="'at least ' + (role == 'entropic' ? hops - 2 : 1) + ' required'"></span>
</h3>
<ul x-show="role == 'backing' ? true : (role == 'fronting' && hops > 1) ? true : (role == 'entropic' && hops > 2) ? true : false" role="list" :class="whitelist_enabled ? 'text-gray-300' : 'text-gray-400'" class="px-4 mt-1 text-xs">
<template x-for="relay in filterBy(filterRelays(), 'role', role)" :key="relay.address">
<li class="group flex items-center justify-between hover:bg-gray-600 cursor-pointer rounded-sm">
<div class="flex items-center justify-between space-x-3">
<input :id="relay.address" :disabled="!whitelist_enabled" type="checkbox" :value="relay.address" x-model="whitelist">
<label :for="relay.address" class="py-2 font-mono cursor-pointer truncate" x-html="filterHighlight(relay.address)"></label>
</div>
<!--
<span x-text="relay.versions.software"></span>
-->
</li>
</template>
</ul>
</div>
</template>
</div>
</template>
</div>
</template>
</template>
</div>
</div>
</div>
<!-- panel:accesskeys -->
<div x-cloak class="relative z-10" role="dialog" aria-modal="true">
<div class="fixed inset-y-0 left-0 flex border-r border-gray-400"
x-show="currentPanel=='accesskeys'"
x-transition:enter="transform transition ease-in-out duration-500"
x-transition:enter-start="-translate-x-full"
x-transition:enter-end="translate-x-0"
x-transition:leave="transform transition ease-in-out duration-500"
x-transition:leave-start="translate-x-0"
x-transition:leave-end="-translate-x-full">
<div class="flex-col min-w-[500px] bg-gray-700 overflow-y-auto scroll-container">
<div class="flex items-center justify-between p-4 bg-gray-600">
<button @click="currentPanel=''" class="text-white focus:outline-none rounded-full -m-2 p-1 hover:bg-white hover:bg-opacity-25 transition duration-300">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
</svg>
</button>
<span class="text-md text-gray-300" x-text="waiting.length > 0 ? waiting.at(-1) : 'Access keys'"></span>
<button @click="refresh()" title="refresh" class="text-white focus:outline-none rounded-full -my-2 -mx-1 p-1 hover:bg-white hover:bg-opacity-25 transition duration-300">
<svg xmlns="http://www.w3.org/2000/svg" :class="[ waiting.length > 0 ? 'animate-spin' : '' ]" class="h-5 w-5" viewBox="0 0 1024 1024" fill="currentColor">
<path d="M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z" />
</svg>
</button>
</div>
<div class="mt-10 px-4 flex rounded-md shadow-sm text-sm" x-data="{url: 'https://libre.wireleap.com/accesskeys'}">
<input type="url" spellcheck="false" x-model="url" class="bg-gray-600 text-gray-50 focus:ring-1 focus:outline-none block w-full rounded-none rounded-l-md pl-2 border border-gray-400">
<button @click="apiPostJson('/api/accesskeys/import', {'url': url})" :disabled="!url" type="button" class="disabled:text-gray-200 -ml-px relative inline-flex items-center space-x-2 px-4 py-2 border border-gray-400 bg-gray-500 text-gray-50 hover:bg-gray-400 text-sm font-medium rounded-r-md focus:outline-none">Import</button>
</div>
<div class="mt-10">
<template x-if="cache.config">
<div @click="apiPostJson('/api/config', {'broker': {'accesskey': {'use_on_demand': !cache.config.broker.accesskey.use_on_demand}}})"
class="cursor-pointer flex justify-between items-center px-4 py-3 hover:bg-gray-600 hover:bg-opacity-75 transition duration-300">
<span class="flex-grow flex flex-col">
<span class="text-sm font-medium text-gray-300">On demand</span>
<span class="text-sm text-gray-50">Enable automatic accesskey activation</span>
</span>
<button type="button"
:class="cache.config.broker.accesskey.use_on_demand ? 'bg-green-500' : 'bg-gray-400'"
class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" role="switch" aria-checked="false">
<span aria-hidden="true" :class="cache.config.broker.accesskey.use_on_demand ? 'translate-x-5' : 'translate-x-0'" class="pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"></span>
</button>
</div>
</template>
</div>
<template x-if="cache.config">
<template x-if="cache.accesskeys">
<div class="">
<p class="text-gray-300 text-sm uppercase mt-12 mx-4">Keys</p>
<template x-for="accesskey in filterBy(cache.accesskeys, 'state', 'active')">
<div class="border-t border-gray-600 m-4 pt-4">
<div class="flex justify-between items-center">
<span class="mr-5 w-2.5 h-2.5 flex-shrink-0 bg-green-600 rounded-full" aria-hidden="true"></span>
<span class="flex-grow flex flex-col">
<span class="text-sm font-medium text-gray-300">Active</span>
<span class="text-sm text-gray-50">
<span>Valid for the next</span>
<span class="border-b border-dotted border-gray-400" :title="timeLeft(accesskey.duration) + ' access, expires on ' + epochToDate(accesskey.expiration)" x-text="epochToTimeLeft(accesskey.expiration)"></span>
</span>
</span>
</div>
</div>
</template>
<template x-for="(accesskey, index) in filterBy(cache.accesskeys, 'state', 'inactive')">
<div class="border-t border-gray-600 m-4 pt-4">
<div class="flex justify-between items-center">
<span class="mr-5 w-2.5 h-2.5 flex-shrink-0 bg-yellow-600 rounded-full" aria-hidden="true"></span>
<span class="flex-grow flex flex-col">
<span class="text-sm font-medium text-gray-300">Pending</span>
<span class="text-sm text-gray-50">
<span>Activate by</span>
<span class="border-b border-dotted border-gray-400" :title="timeLeft(accesskey.duration) + ' access, must be activated in ' + epochToTimeLeft(accesskey.expiration)" x-text="epochToDate(accesskey.expiration)"></span>
</span>
</span>
<template x-if="!cache.config.broker.accesskey.use_on_demand">
<button @click="apiPostJson('/api/accesskeys/activate')" :disabled="index != 0 || filterBy(cache.accesskeys, 'state', 'active').length > 0" class="disabled:border-gray-500 disabled:text-gray-500 disabled:bg-gray-700 disabled:hover:bg-gray-600 border border-gray-400 bg-gray-500 text-gray-50 hover:bg-gray-400 rounded shadow-sm text-xs px-2 pt-1.5 pb-1 items-center justify-center">Activate</button>
</template>
</div>
</div>
</template>
<template x-for="accesskey in filterBy(cache.accesskeys, 'state', 'expired')">
<div class="border-t border-gray-600 m-4 pt-4">
<div class="flex justify-between items-center">
<span class="mr-5 w-2.5 h-2.5 flex-shrink-0 bg-red-500 rounded-full" aria-hidden="true"></span>
<span class="flex-grow flex flex-col">
<span class="text-sm font-medium text-gray-300">Expired</span>
<span class="text-sm text-gray-50">
<span>Expired at</span>
<span class="border-b border-dotted border-gray-400" :title="timeLeft(accesskey.duration) + ' access'" x-text="epochToDate(accesskey.expiration)"></span>
</span>
</span>
</div>
</div>
</template>
</div>
</template>
</template>
</div>
</div>
</div>
<main class="flex-col min-w-[500px] bg-gray-700 overflow-y-auto scroll-container">
<!-- navbar -->
<div :class="running() ? 'bg-green-500' : 'bg-gray-600'" class="flex items-center justify-between p-4" x-model="running">
<button @click="currentPanel='info'" class="inline-block relative text-white focus:outline-none rounded-full -m-2 p-1 hover:bg-white hover:bg-opacity-25 transition duration-300">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
</svg>
<template x-if="cache.status">
<span x-show="cache.status.upgrade.required" class="absolute flex top-0 right-0 h-3 w-3">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"></span>
<span class="relative inline-flex rounded-full h-3 w-3 bg-red-500"></span>
</span>
</template>
</button>
<span class="text-md text-white" x-text="waiting.length > 0 ? waiting.at(-1) : 'wireleap'"></span>
<button @click="refresh()" title="refresh" class="text-white focus:outline-none rounded-full -my-2 -mx-1 p-1 hover:bg-white hover:bg-opacity-25 transition duration-300">
<svg xmlns="http://www.w3.org/2000/svg" :class="[ waiting.length > 0 ? 'animate-spin' : '' ]" class="h-5 w-5" viewBox="0 0 1024 1024" fill="currentColor">
<path d="M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z" />
</svg>
</button>
</div>
<!-- main:version -->
<template x-if="cache.version">
<div x-cloak x-transition x-data="{showError: cache.version.version != apiVersion}" x-show="showError" class="m-3 py-3 pl-1 rounded-sm bg-red-200 relative">
<div class="absolute top-0 right-0 pt-2 pr-2">
<button @click="showError=false" type="button" class="inline-flex bg-red-200 rounded-md p-1.5 text-red-500 hover:bg-red-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-red-50 focus:ring-red-600">
<span class="sr-only">Dismiss</span>
<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</button>
</div>
<div class="text-xs ml-3 pt-1 text-red-800">
<p>Client API version mismatch, this UI might not work as expected.</p>
</div>
</div>
</template>
<!-- main:forwarders -->
<p class="text-gray-300 text-sm uppercase mt-12 mx-4">Forwarders</p>
<div class="m-4 divide-y divide-gray-600">
<!-- main:forwarders:socks -->
<template x-if="cache.forwarders_socks">
<div x-data="{showErrors: false}" class="py-2">
<template x-if="cache.forwarders_socks.binary.ok">
<div @click="cache.forwarders_socks.state == 'active' ? apiPostJson('/api/forwarders/socks/stop') : apiPostJson('/api/forwarders/socks/start')"
class="cursor-pointer flex justify-between items-center px-4 py-3 hover:bg-gray-600 hover:bg-opacity-75 transition duration-300 rounded">
<span class="flex-grow flex flex-col">
<span class="text-sm font-medium text-gray-300">SOCKSv5 forwarder</span>
<span class="text-sm text-gray-50">Tunnel specific traffic (manually or via exec scripts)</span>
</span>
<button type="button"
:class="cache.forwarders_socks.state == 'active' ? 'bg-green-500' : 'bg-gray-400'"
class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" role="switch" aria-checked="false">
<span aria-hidden="true" :class="cache.forwarders_socks.state == 'active' ? 'translate-x-5' : 'translate-x-0'" class="pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"></span>
</button>
</div>
</template>
<template x-if="!cache.forwarders_socks.binary.ok">
<div @click="showErrors=!showErrors"
class="cursor-pointer flex justify-between items-center px-4 py-3 hover:bg-gray-600 hover:bg-opacity-75 transition duration-300 rounded">
<span class="flex-grow flex flex-col">
<span class="text-sm font-medium text-gray-300">SOCKSv5 forwarder</span>
<span class="text-sm text-gray-50">Tunnel specific traffic (manually or via exec scripts)</span>
</span>
<button type="button"
class="bg-gray-400 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" role="switch" aria-checked="false">
<span aria-hidden="true" class="translate-x-0 pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"></span>
</button>
</div>
</template>
<div x-cloak x-transition x-show="showErrors" class="m-3 py-3 pl-1 rounded-sm bg-red-200 relative">
<div class="absolute top-0 right-0 pt-2 pr-2">
<button @click="showErrors=!showErrors" type="button" class="inline-flex bg-red-200 rounded-md p-1.5 text-red-500 hover:bg-red-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-red-50 focus:ring-red-600">
<span class="sr-only">Dismiss</span>
<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</button>
</div>
<div class="text-sm ml-3">
<template x-if="!cache.forwarders_socks.binary.state.exists">
<div class="text-red-800">
<p class="w-full pb-1">SOCKS binary does not exist</p>
</div>
</template>
<template x-if="cache.forwarders_socks.binary.state.exists">
<div class="text-red-800">
<p class="w-full pb-1">SOCKS permissions are not configured</p>
<div class="font-mono whitespace-nowrap rounded-md mt-2 py-2">
<p x-text="'cd '+ cache.status.home"></p>
<template x-if="!cache.forwarders_socks.binary.state.chmod_x">
<p>chmod +x wireleap_socks</p>
</template>
</div>
</div>
</template>
</div>
</div>
</div>
</template>
<!-- main:forwarders:tun -->
<template x-if="cache.forwarders_tun">
<div x-data="{showErrors: false}" class="py-2">
<template x-if="cache.forwarders_tun.binary.ok">
<div @click="cache.forwarders_tun.state == 'active' ? apiPostJson('/api/forwarders/tun/stop') : apiPostJson('/api/forwarders/tun/start')"
class="cursor-pointer flex justify-between items-center px-4 py-3 hover:bg-gray-600 hover:bg-opacity-75 transition duration-300 rounded">
<span class="flex-grow flex flex-col">
<span class="text-sm font-medium text-gray-300">TUN forwarder</span>
<span class="text-sm text-gray-50">Tunnel all traffic on the system</span>
</span>
<button type="button"
:class="cache.forwarders_tun.state == 'active' ? 'bg-green-500' : 'bg-gray-400'"
class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" role="switch" aria-checked="false">
<span aria-hidden="true" :class="cache.forwarders_tun.state == 'active' ? 'translate-x-5' : 'translate-x-0'" class="pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"></span>
</button>
</div>
</template>
<template x-if="!cache.forwarders_tun.binary.ok">
<div @click="showErrors=!showErrors"
class="cursor-pointer flex justify-between items-center px-4 py-3 hover:bg-gray-600 hover:bg-opacity-75 transition duration-300 rounded">
<span class="flex-grow flex flex-col">
<span class="text-sm font-medium text-gray-300">TUN forwarder</span>
<span class="text-sm text-gray-50">Tunnel all traffic on the system</span>
</span>
<button type="button"
class="bg-gray-400 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" role="switch" aria-checked="false">
<span aria-hidden="true" class="translate-x-0 pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"></span>
</button>
</div>
</template>
<div x-cloak x-transition x-show="showErrors" class="m-3 py-3 pl-1 rounded-sm bg-red-200 relative">
<div class="absolute top-0 right-0 pt-2 pr-2">
<button @click="showErrors=!showErrors" type="button" class="inline-flex bg-red-200 rounded-md p-1.5 text-red-500 hover:bg-red-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-red-50 focus:ring-red-600">
<span class="sr-only">Dismiss</span>
<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</button>
</div>
<div class="text-sm ml-3">
<template x-if="!cache.forwarders_tun.binary.state.exists">
<div class="text-red-800">
<p class="w-full pb-1">TUN binary does not exist</p>
</div>
</template>
<template x-if="cache.forwarders_tun.binary.state.exists">
<div class="text-red-800">
<p class="w-full pb-1">TUN permissions are not configured</p>
<div class="font-mono whitespace-nowrap rounded-md mt-2 py-2">
<p x-text="'cd '+ cache.status.home"></p>
<template x-if="!cache.forwarders_tun.binary.state.chmod_x">
<p>chmod +x wireleap_tun</p>
</template>
<template x-if="!cache.forwarders_tun.binary.state.chown_0">
<p>sudo chown 0:0 wireleap_tun</p>
</template>
<template x-if="!cache.forwarders_tun.binary.state.chmod_us">
<p>sudo chmod u+s wireleap_tun</p>
</template>
</div>
</div>
</template>
</div>
</div>
</div>
</template>
</div>
<!-- main:circuit -->
<p class="text-gray-300 text-sm uppercase mt-12 mx-4">Circuit</p>
<div class="m-4 divide-y divide-gray-600">
<template x-if="cache.config">
<div class="py-2">
<div @click="currentPanel='circuit'" class="cursor-pointer flex justify-between items-center px-4 py-3 hover:bg-gray-600 hover:bg-opacity-75 transition duration-300 rounded">
<div class="flex flex-col">
<span class="text-gray-300 text-sm">
<span x-text="cache.config.broker.circuit.hops"></span>
<span x-text="cache.config.broker.circuit.hops > 1 ? 'hops' : 'hop'"></span>,
<span x-text="cache.config.broker.circuit.whitelist.length > 0 ? 'selected' : 'any'"></span>
relays
</span>
<span class="text-sm text-gray-50">
<template x-if="cache.status.broker.active_circuit.length == 0">
<span>No active circuit</span>
</template>
<template x-if="cache.status.broker.active_circuit.length > 0">
<span>Exiting via
<span class="border-b border-dotted border-gray-300" x-text="cache.status.broker.active_circuit.at(-1).split(':')[1].replace('//','')"></span>
</span>
</template>
</span>
</div>
<div class="h-4 w-4 text-gray-300">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
</svg>
</div>
</div>
</div>
</template>
</div>
<!-- main:accesskeys -->
<p class="text-gray-300 text-sm uppercase mt-12 mx-4">Access Keys</p>
<div class="m-4 divide-y divide-gray-600">
<template x-if="cache.config">
<div class="py-2">
<div @click="currentPanel='accesskeys'" class="cursor-pointer flex justify-between items-center px-4 py-3 hover:bg-gray-600 hover:bg-opacity-75 transition duration-300 rounded">
<div class="flex flex-col">
<span class="text-gray-300 text-sm">Activate
<span x-show="cache.config.broker.accesskey.use_on_demand">on demand</span>
<span x-show="!cache.config.broker.accesskey.use_on_demand">manually</span>
</span>
<template x-if="cache.accesskeys">
<template x-for="accesskey in filterBy(cache.accesskeys, 'state', 'active')">
<span class="text-sm text-gray-50">Active key valid for the next
<span class="border-b border-dotted border-gray-300" x-text="epochToTimeLeft(accesskey.expiration)"></span>
</span>
</template>
</template>
<template x-if="cache.accesskeys">
<template x-if="filterBy(cache.accesskeys, 'state', 'active').length == 0">
<span class="text-sm text-gray-50">No access keys are active</span>
</template>
</template>
<template x-if="!cache.accesskeys">
<span class="text-sm text-gray-50">No access keys are active</span>
</template>
</div>
<div class="h-4 w-4 text-gray-300">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
</svg>
</div>
</div>
</div>
</template>
</div>
</main>
<!-- tabs -->
<div class="flex-col w-full bg-gray-50 overflow-y-auto scroll-container border-l border-gray-200 px-5"
@hashchange.window="currentTab = location.hash.replace('#','')">
<div class="border-b border-gray-200">
<nav class="-mb-px flex space-x-8 -ml-8" aria-label="Tabs">
<template x-for="tab in ['usage', 'logs', 'debug']">
<a :href="'#'+tab" x-text="tab" :class="currentTab == tab ? 'border-indigo-500 text-indigo-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm capitalize"></a>
</template>
</nav>
</div>
<div x-cloak x-transition x-show="alertError" class="my-5 rounded-md bg-red-50 p-3">
<div class="flex items-center">
<div class="ml-3">
<p class="text-xs text-red-800" x-text="alertError"></p>
</div>
<div class="ml-auto pl-3">
<div class="-mx-1.5 -my-1.5">
<button @click="alertError=''" type="button" class="inline-flex bg-red-50 rounded-md p-1.5 text-red-500 hover:bg-red-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-red-50 focus:ring-red-600">
<span class="sr-only">Dismiss</span>
<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</button>
</div>
</div>
</div>
</div>
<!-- tab:usage -->
<div x-cloak x-show="currentTab == 'usage'">
<div class="space-y-5 mt-3">
<div>
<p class="text-xs text-gray-900 font-medium uppercase pt-4">Getting started</p>
<div class="space-y-3 mt-3 p-3 bg-white border border-gray-300 rounded-md">
<nav class="" aria-label="Progress">
<ol role="list" class="space-y-4 lg:flex lg:space-y-0 lg:space-x-8">
<li @click="currentPanel='accesskeys'" class="lg:flex-1 cursor-pointer">
<div :class="cache.contract ? 'border-indigo-600 hover:border-indigo-800' : 'border-gray-200 hover:border-gray-300'" class="group pl-4 py-2 flex flex-col border-l-4 lg:pl-0 lg:pt-4 lg:pb-0 lg:border-l-0 lg:border-t-4">
<span :class="cache.contract ? 'text-indigo-600 group-hover:text-indigo-800' : 'text-gray-500 group-hover:text-gray-700'" class="text-xs font-semibold tracking-wide uppercase">Step 1</span>
<span class="text-sm font-medium">Import an access key</span>
</div>
</li>
<li @click="currentPanel=''" class="lg:flex-1 cursor-pointer">
<div :class="running() ? 'border-indigo-600 hover:border-indigo-800' : 'border-gray-200 hover:border-gray-300'" class="group pl-4 py-2 flex flex-col border-l-4 lg:pl-0 lg:pt-4 lg:pb-0 lg:border-l-0 lg:border-t-4">
<span :class="running() ? 'text-indigo-600 group-hover:text-indigo-800' : 'text-gray-500 group-hover:text-gray-700'" class="text-xs font-semibold tracking-wide uppercase">Step 2</span>
<span class="text-sm font-medium">Enable a traffic forwarder</span>
</div>
</li>
<li class="lg:flex-1">
<template x-if="cache.status">
<div :class="cache.status.broker.active_circuit.length > 0 ? 'border-indigo-600 hover:border-indigo-800' : 'border-gray-200 hover:border-gray-300'" class="group pl-4 py-2 flex flex-col border-l-4 lg:pl-0 lg:pt-4 lg:pb-0 lg:border-l-0 lg:border-t-4">
<span :class="cache.status.broker.active_circuit.length > 0 ? 'text-indigo-600 group-hover:text-indigo-800' : 'text-gray-500 group-hover:text-gray-700'" class="text-xs font-semibold tracking-wide uppercase">Step 3</span>
<span class="text-sm font-medium">Route traffic</span>
</div>
</template>
</li>
</ol>
</nav>
</div>
</div>
<template x-if="cache.forwarders_tun">
<div>
<div x-transition x-show="cache.forwarders_tun.state == 'active'">
<p class="text-xs text-gray-900 font-medium uppercase pt-4">Routing all traffic</p>
<div class="space-y-3 mt-3 p-3 bg-white border border-gray-300 rounded-md">
<p class="text-gray-600 text-sm">All traffic on the system is being routed via TUN</p>
</div>
</div>
<template x-if="cache.forwarders_socks">
<div x-transition x-show="cache.forwarders_tun.state != 'active' && cache.forwarders_socks.state == 'active'">
<p class="text-xs text-gray-900 font-medium uppercase pt-4">Routing specific traffic</p>
<div x-data="{'selected': 'google-chrome'}" class="space-y-3 mt-3 p-3 pt-0 bg-white border border-gray-300 rounded-md">
<div class="flex flex-wrap">
<template x-for="app in ['google-chrome', 'chromium-browser', 'firefox', 'brave-browser', 'curl', 'custom', 'intercept']">
<div @click="selected=app" :class="selected == app ? 'text-gray-600 border-gray-400' : 'text-gray-400 border-gray-200'" :title="app" class="flex mr-4 mt-4 items-center justify-center h-20 w-20 cursor-pointer text-xs rounded-xl p-4 border-2 hover:text-gray-600 hover:border-gray-400">
<template x-if="app == 'google-chrome'">
<svg class="h-10 w-10" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M879 309H500c-46 1-90 17-125 47-34 30-57 72-63 117L172 231c80-99 201-156 328-156 160 0 307 91 379 234M339 602c35 55 96 88 161 89 24-1 48-5 71-14L431 919c-99-16-190-67-255-144S75 601 75 500c0-83 24-164 70-233 64 111 128 225 194 335m267-208c28 28 44 66 44 106s-16 78-44 106-66 44-106 44-78-16-106-44-44-66-44-106 16-78 44-106 66-44 106-44 78 16 106 44m291-44c18 48 28 99 28 150 0 113-45 221-124 301-80 79-188 124-301 124-8 0-16 0-24-1l192-335c15-28 22-58 23-89-1-59-28-114-74-150h280"/></svg>
</template>
<template x-if="app == 'chromium-browser'">
<svg class="h-9 w-9" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M500 0C224 0 0 224 0 500s224 500 500 500 500-224 500-500S776 0 500 0m379 309H500c-46 1-90 17-125 47-34 30-57 72-63 117L172 231c80-99 201-156 328-156 160 0 307 91 379 234M339 602c35 55 96 88 161 89 24-1 48-5 71-14L431 919c-99-16-190-67-255-144S75 601 75 500c0-83 24-164 70-233 64 111 128 225 194 335m267-208c28 28 44 66 44 106s-16 78-44 106-66 44-106 44-78-16-106-44-44-66-44-106 16-78 44-106 66-44 106-44 78 16 106 44m291-44c18 48 28 99 28 150 0 113-45 221-124 301-80 79-188 124-301 124-8 0-16 0-24-1l192-335c15-28 22-58 23-89-1-59-28-114-74-150h280"/></svg>
</template>
<template x-if="app == 'firefox'">
<svg class="h-9 w-9" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M500 0C224 0 0 224 0 500s224 500 500 500 500-224 500-500S776 0 500 0m0 25c262 0 475 213 475 475S762 975 500 975 25 762 25 500 238 25 500 25m237 145c4-17 10-31 19-41 0 31 84 121 123 233 11 30 17 60 19 88 8-12 14-18 14-18 40 205-98 479-401 481-94 1-148-23-225-65v-1c-102-62-143-143-161-182-31-68-36-127-34-176-5 15-9 30-12 45 2-73 15-120 28-149-10 13-18 28-25 44 16-57 32-92 47-115 3-6 11-17 22-30-9-55 21-99 57-142 0 27 17 61 39 84 27-6 59-5 95 8 27-28 71-44 114-34-29 12-44 39-64 73v1c3 10 13 34 39 36 60 6 67 11 67 18v6c-4 25-17 36-49 47-13 6-29 14-39 20-3 2-6 4-8 7v1c2 15 12 37-7 54-9-14-29-21-45-10-46 56 80 99 142 90 62-8 69 15 77 30 8 17-1 30-16 25-21-7-44 17-64 24-26 14-66 19-105 10-6-1-13-3-20-6 11 17 30 35 60 55 129 61 267-24 282-174 14-150-152-181-123-348 12-42 33-75 60-110 0 20 21 52 94 121"/></svg>
</template>
<template x-if="app == 'brave-browser'">
<svg class="h-8 w-8" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="m15.68 0 2.096 2.38s1.84-.512 2.709.358c.868.87 1.584 1.638 1.584 1.638l-.562 1.381.715 2.047s-2.104 7.98-2.35 8.955c-.486 1.919-.818 2.66-2.198 3.633a186.42 186.42 0 0 1-4.293 2.916c-.409.256-.92.692-1.38.692-.46 0-.97-.436-1.38-.692a185.796 185.796 0 0 1-4.293-2.916c-1.38-.973-1.712-1.714-2.197-3.633-.247-.975-2.351-8.955-2.351-8.955l.715-2.047-.562-1.381s.716-.768 1.585-1.638c.868-.87 2.708-.358 2.708-.358L8.321 0h7.36zm-3.679 14.936c-.14 0-1.038.317-1.758.69-.72.373-1.242.637-1.409.742-.167.104-.065.301.087.409.152.107 2.194 1.69 2.393 1.866.198.175.489.464.687.464.198 0 .49-.29.688-.464.198-.175 2.24-1.759 2.392-1.866.152-.108.254-.305.087-.41-.167-.104-.689-.368-1.41-.741-.72-.373-1.617-.69-1.757-.69zm0-11.278s-.409.001-1.022.206-1.278.46-1.584.46c-.307 0-2.581-.434-2.581-.434S4.119 7.152 4.119 7.849c0 .697.339.881.68 1.243l2.02 2.149c.192.203.59.511.356 1.066-.235.555-.58 1.26-.196 1.977.384.716 1.042 1.194 1.464 1.115.421-.08 1.412-.598 1.776-.834.364-.237 1.518-1.19 1.518-1.554 0-.365-1.193-1.02-1.413-1.168-.22-.15-1.226-.725-1.247-.95-.02-.227-.012-.293.284-.851.297-.559.831-1.304.742-1.8-.089-.495-.95-.753-1.565-.986-.615-.232-1.799-.671-1.947-.74-.148-.068-.11-.133.339-.175.448-.043 1.719-.212 2.292-.052.573.16 1.552.403 1.632.532.079.13.149.134.067.579-.081.445-.5 2.581-.541 2.96-.04.38-.12.63.288.724.409.094 1.097.256 1.333.256s.924-.162 1.333-.256c.408-.093.329-.344.288-.723-.04-.38-.46-2.516-.541-2.961-.082-.445-.012-.45.067-.579.08-.129 1.059-.372 1.632-.532.573-.16 1.845.009 2.292.052.449.042.487.107.339.175-.148.069-1.332.508-1.947.74-.615.233-1.476.49-1.565.986-.09.496.445 1.241.742 1.8.297.558.304.624.284.85-.02.226-1.026.802-1.247.95-.22.15-1.413.804-1.413 1.169 0 .364 1.154 1.317 1.518 1.554.364.236 1.355.755 1.776.834.422.079 1.08-.4 1.464-1.115.384-.716.039-1.422-.195-1.977-.235-.555.163-.863.355-1.066l2.02-2.149c.341-.362.68-.546.68-1.243 0-.697-2.695-3.96-2.695-3.96s-2.274.436-2.58.436c-.307 0-.972-.256-1.585-.461-.613-.205-1.022-.206-1.022-.206z"/></svg>
</template>
<template x-if="app == 'curl'">
<span class="text-md font-mono">curl://</span>
</template>
<template x-if="app == 'custom'">
<span class="font-extrabold">custom</span>
</template>
<template x-if="app == 'intercept'">
<span class="font-extrabold">intercept</span>
</template>
</div>
</template>
</div>
<template x-if="cache.config && cache.status && cache.runtime">
<div class="text-sm">
<template x-if="selected != 'custom' && selected != 'intercept'">
<div class="text-gray-600 font-mono py-2">
<p x-text="'cd ' + cache.status.home"></p>
<p x-text="'.' + osSlash() + 'wireleap exec ' + selected"</p>
</div>
</template>
<template x-if="selected == 'custom'">
<div class="text-gray-600 font-mono py-2">
<p x-text="'socks5h://' + cache.config.forwarders.socks.address"></p>
</div>
</template>
<template x-if="selected == 'intercept'">
<div class="text-gray-600 font-mono py-2">
<p x-show="cache.runtime.platform.os == 'linux'" x-text="'cd ' + cache.status.home"></p>
<p x-show="cache.runtime.platform.os == 'linux'">./wireleap intercept ssh USER@HOST</p>
<p x-show="cache.runtime.platform.os != 'linux'">intercept is not supported on your platform</p>
</div>
</template>
</div>
</template>
</div>
</div>
</template>
</div>
</template>
</div>
</div>
<!-- tab:logs -->
<div x-cloak x-show="currentTab == 'logs'">
<div class="space-y-5 mt-3">
<div>
<p class="text-xs text-gray-900 font-medium uppercase pb-2 pt-4">Controller</p>
<template x-if="error.log">
<pre class="w-full h-44 p-1 overflow-y-auto text-xs scroll-container border border-gray-300 rounded-md bg-white" x-text="error.log"></pre>
</template>
<template x-if="cache.log">
<pre class="w-full h-44 p-1 overflow-y-auto text-xs scroll-container border border-gray-300 rounded-md bg-white"
x-text="cache.log"
x-init="$nextTick(() => $el.scrollTop = $el.scrollHeight); $watch('cache.log', value => $el.scrollTop = $el.scrollHeight)"></pre>
</template>
</div>
<div>
<p class="text-xs text-gray-900 font-medium uppercase pb-2 pt-4">SOCKS Forwarder</p>
<template x-if="error.forwarders_socks_log">
<pre class="w-full h-44 p-1 overflow-y-auto text-xs scroll-container border border-gray-300 rounded-md bg-white" x-text="error.forwarders_socks_log"></pre>
</template>
<template x-if="cache.forwarders_socks_log">
<pre class="w-full h-44 p-1 overflow-y-auto text-xs scroll-container border border-gray-300 rounded-md bg-white"
x-text="cache.forwarders_socks_log"
x-init="$nextTick(() => $el.scrollTop = $el.scrollHeight); $watch('cache.forwarders_socks_log', value => $el.scrollTop = $el.scrollHeight)"></pre>
</template>
</div>
<div>
<p class="text-xs text-gray-900 font-medium uppercase pb-2 pt-4">TUN Forwarder</p>
<template x-if="error.forwarders_tun_log">
<pre class="w-full h-44 p-1 overflow-y-auto text-xs scroll-container border border-gray-300 rounded-md bg-white" x-text="error.forwarders_tun_log"></pre>
</template>
<template x-if="cache.forwarders_tun_log">
<pre class="w-full h-44 p-1 overflow-y-auto text-xs scroll-container border border-gray-300 rounded-md bg-white"
x-text="cache.forwarders_tun_log"
x-init="$nextTick(() => $el.scrollTop = $el.scrollHeight); $watch('cache.forwarders_tun_log', value => $el.scrollTop = $el.scrollHeight)"></pre>
</template>
</div>
</div>
</div>
<!-- tab:debug -->
<div x-cloak x-show="currentTab == 'debug'">
<div class="h-full relative space-y-3 scroll-container overflow-y-auto overflow-hidden mt-3 pb-10">
<!-- tab:debug:core -->
<p class="text-xs text-gray-900 font-medium uppercase pt-4">Core</p>
<div class="space-y-3 mt-3 p-3 bg-white border border-gray-300 rounded-md">
<details class="text-xs whitespace-nowrap cursor-pointer">
<summary class="text-gray-600 font-light">version</summary>
<template x-if="error.version"><p class="p-1 bg-red-200" x-text="error.version"></template>
<template x-if="cache.version">
<ul class="ml-1 p-2 border-l-2 border-blue-200">
<li>version: <span x-text="cache.version.version"></span></li>
</ul>
</template>
</details>
<details class="text-xs whitespace-nowrap cursor-pointer">
<summary class="text-gray-600 font-light">status</summary>
<template x-if="error.status"><p class="p-1 bg-red-200" x-text="error.status"></template>
<template x-if="cache.status">
<ul class="ml-1 p-2 border-l-2 border-blue-200">
<li>home: <span x-text="cache.status.home"></span></li>
<li>pid: <span x-text="cache.status.pid"></span></li>
<li>state: <span x-text="cache.status.state"></span></li>
<li>broker.active_circuit: <span x-text="cache.status.broker.active_circuit"></span></li>
<li>upgrade.required: <span x-text="cache.status.upgrade.required"></span></li>
</ul>
</template>
</details>
<details class="text-xs whitespace-nowrap cursor-pointer">
<summary class="text-gray-600 font-light">config</summary>
<template x-if="error.config"><p class="p-1 bg-red-200" x-text="error.config"></template>
<template x-if="cache.config">
<ul class="ml-1 p-2 border-l-2 border-blue-200">
<li>address: <span x-text="cache.config.address"></span></li>
<li>broker.address: <span x-text="cache.config.broker.address"></span></li>
<li>broker.accesskey.use_on_demand: <span x-text="cache.config.broker.accesskey.use_on_demand"></span></li>
<li>broker.circuit.timeout: <span x-text="cache.config.broker.circuit.timeout"></span></li>
<li>broker.circuit.hops: <span x-text="cache.config.broker.circuit.hops"></span></li>
<li>broker.circuit.whitelist: <span x-text="cache.config.broker.circuit.whitelist"></span></li>
<li>forwarders.socks.address: <span x-text="cache.config.forwarders.socks.address"></span></li>
<li>forwarders.tun.address: <span x-text="cache.config.forwarders.tun.address"></span></li>
</ul>
</template>
</details>
<details class="text-xs whitespace-nowrap cursor-pointer">
<summary class="text-gray-600 font-light">runtime</summary>
<template x-if="error.runtime"><p class="p-1 bg-red-200" x-text="error.runtime"></template>
<template x-if="cache.runtime">
<ul class="ml-1 p-2 border-l-2 border-blue-200">
<li>versions.software: <span x-text="cache.runtime.versions.software"></span></li>
<li>versions.api: <span x-text="cache.runtime.versions.api"></span></li>
<li>versions.client-contract: <span x-text="cache.runtime.versions['client-contract']"></span></li>
<li>versions.client-dir: <span x-text="cache.runtime.versions['client-dir']"></span></li>
<li>versions.client-relay: <span x-text="cache.runtime.versions['client-relay']"></span></li>
<li>upgrade.supported: <span x-text="cache.runtime.upgrade.supported"></span></li>
<li>build.gitcommit: <span x-text="cache.runtime.build.gitcommit"></span></li>
<li>build.goversion: <span x-text="cache.runtime.build.goversion"></span></li>
<li>build.time: <span x-text="cache.runtime.build.time"></span></li>
<li>build.flags: <span x-text="cache.runtime.build.flags"></span></li>
<li>platform.os: <span x-text="cache.runtime.platform.os"></span></li>
<li>platform.arch: <span x-text="cache.runtime.platform.arch"></span></li>
</ul>
</template>
</details>
</div>
<!-- tab:debug:resources -->
<p class="text-xs text-gray-900 font-medium uppercase pt-4">Resources</p>
<div class="space-y-3 mt-3 p-3 bg-white border border-gray-300 rounded-md">
<details class="text-xs whitespace-nowrap cursor-pointer">
<summary class="text-gray-600 font-light">accesskeys</summary>
<template x-if="error.accesskeys"><p class="p-1 bg-red-200" x-text="error.accesskeys"></template>
<template x-if="cache.accesskeys">
<template x-for="accesskey in cache.accesskeys">
<ul class="ml-1 p-2 border-l-2 border-blue-200">
<li>contract: <span x-text="accesskey.contract"></span></li>
<li>duration: <span x-text="accesskey.duration"></span></li>
<li>expiration: <span x-text="accesskey.expiration"></span></li>
<li>state: <span x-text="accesskey.state"></span></li>
</ul>
</template>
</template>
</details>
<details class="text-xs whitespace-nowrap cursor-pointer">
<summary class="text-gray-600 font-light">relays</summary>
<template x-if="error.relays"><p class="p-1 bg-red-200" x-text="error.relays"></template>
<template x-if="cache.relays">
<template x-for="relay in cache.relays">
<ul class="ml-1 p-2 border-l-2 border-blue-200">
<li>role: <span x-text="relay.role"></span></li>
<li>address: <span x-text="relay.address"></span></li>
<li>pubkey: <span x-text="relay.pubkey"></span></li>
<li>selectable: <span x-text="relay.selectable"></span></li>
<li>versions.software: <span x-text="relay.versions.software"></span></li>
<li>versions.client-relay: <span x-text="relay.versions['client-relay']"></span></li>
</ul>
</template>
</template>
</details>
<details class="text-xs whitespace-nowrap cursor-pointer">
<summary class="text-gray-600 font-light">contract</summary>
<template x-if="error.contract"><p class="p-1 bg-red-200" x-text="error.contract"></template>
<template x-if="cache.contract">
<ul class="ml-1 p-2 border-l-2 border-blue-200">
<li>pubkey: <span x-text="cache.contract.pubkey"></span></li>
<li>version: <span x-text="cache.contract.version"></span></li>
<li>endpoint: <span x-text="cache.contract.endpoint"></span></li>
<template x-for="proof_of_funding in cache.contract.proof_of_funding">
<ul class="py-2">
<li>proof_of_funding.type: <span x-text="proof_of_funding.type"></span></li>
<li>proof_of_funding.endpoint: <span x-text="proof_of_funding.endpoint"></span></li>
<li>proof_of_funding.pubkey: <span x-text="proof_of_funding.pubkey"></span></li>
</ul>
</template>
<li>servicekey.duration: <span x-text="cache.contract.servicekey.duration"></span></li>
<li>servicekey.currency: <span x-text="cache.contract.servicekey.currency"></span></li>
<li>servicekey.value: <span x-text="cache.contract.servicekey.value"></span></li>
<li>directory.endpoint: <span x-text="cache.contract.directory.endpoint"></span></li>
<li>directory.public_key: <span x-text="cache.contract.directory.public_key"></span></li>
<li>metadata.operator: <span x-text="cache.contract.metadata.operator"></span></li>
<li>metadata.operator_url: <span x-text="cache.contract.metadata.operator_url"></span></li>
<li>metadata.name: <span x-text="cache.contract.metadata.name"></span></li>
<li>metadata.terms_of_service: <span x-text="cache.contract.metadata.terms_of_service"></span></li>
<li>metadata.privacy_policy: <span x-text="cache.contract.metadata.privacy_policy"></span></li>
</ul>
</template>
</details>
</div>
<!-- tab:debug:forwarders -->
<p class="text-xs text-gray-900 font-medium uppercase pt-4">Forwarders</p>
<div class="space-y-3 mt-3 p-3 bg-white border border-gray-300 rounded-md">
<details class="text-xs whitespace-nowrap cursor-pointer">
<summary class="text-gray-600 font-light">socks</summary>
<template x-if="error.forwarders_socks"><p class="p-1 bg-red-200" x-text="error.forwarders_socks"></template>
<template x-if="cache.forwarders_socks">
<ul class="ml-1 p-2 border-l-2 border-blue-200">
<li>pid: <span x-text="cache.forwarders_socks.pid"></span></li>
<li>state: <span x-text="cache.forwarders_socks.state"></span></li>
<li>address: <span x-text="cache.forwarders_socks.address"></span></li>
<li>binary.ok: <span x-text="cache.forwarders_socks.binary.ok"></span></li>
<li>binary.state.exists: <span x-text="cache.forwarders_socks.binary.state.exists"></span></li>
<li>binary.state.chmod_x: <span x-text="cache.forwarders_socks.binary.state.chmod_x"></span></li>
</ul>
</template>
</details>
<details class="text-xs whitespace-nowrap cursor-pointer">
<summary class="text-gray-600 font-light">tun</summary>
<template x-if="error.forwarders_tun"><p class="p-1 bg-red-200" x-text="error.forwarders_tun"></template>
<template x-if="cache.forwarders_tun">
<ul class="ml-1 p-2 border-l-2 border-blue-200">
<li>pid: <span x-text="cache.forwarders_tun.pid"></span></li>
<li>state: <span x-text="cache.forwarders_tun.state"></span></li>
<li>address: <span x-text="cache.forwarders_tun.address"></span></li>
<li>binary.ok: <span x-text="cache.forwarders_tun.binary.ok"></span></li>
<li>binary.state.exists: <span x-text="cache.forwarders_tun.binary.state.exists"></span></li>
<li>binary.state.chown_0: <span x-text="cache.forwarders_tun.binary.state.chown_0"></span></li>
<li>binary.state.chmod_x: <span x-text="cache.forwarders_tun.binary.state.chmod_x"></span></li>
<li>binary.state.chmod_us: <span x-text="cache.forwarders_tun.binary.state.chmod_us"></span></li>
</ul>
</template>
</details>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>