-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
810 lines (777 loc) · 34.8 KB
/
Copy pathindex.html
File metadata and controls
810 lines (777 loc) · 34.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MeshCore Repeater / Room server USB setup</title>
<link href="./lib/css/beer.css" rel="stylesheet">
<link href="./css/style.css" rel="stylesheet">
<link rel="stylesheet" href="./lib/css/leaflet.css" />
<script src="./lib/leaflet.js"></script>
</head>
<body class="dark">
<div id="app" v-cloak>
<div v-if="app.busy" class="overlay">
<progress class="circle large"></progress>
<span>{{ app.busy }}</span>
</div>
<div class="snackbar" :class="snackbar.class" popover>
<i v-if="snackbar.icon">{{ snackbar.icon }}</i>
<span v-html="snackbar.text"></span>
</div>
<header>
<nav>
<h5 class="small">Repeater / Room server USB setup</h5>
<span class="max"></span>
<button v-if="app.connected" @click="disconnect">
<i>usb_off</i><span>Disconnect</span>
</button>
<button v-else-if="app.connecting" disabled>
<progress class="circle small"></progress>
<span>Connecting...</span>
</button>
<button v-else @click="connect">
<i>usb</i><span>Connect</span>
</button>
</nav>
</header>
<dialog ref="vanityDialog">
<header>
<nav>
<h6>Generate vanity public key</h6>
<span class="max"></span>
<button class="transparent circle" @click="closeVanityDialog"><i>close</i></button>
</nav>
</header>
<!-- Input phase -->
<div v-if="vanity.phase === 'input'">
<p>Enter a hex prefix (1-8 characters) for your public key. Uses {{ vanity.cores }} CPU cores.</p>
<div class="field border label">
<input placeholder=" " v-model="vanity.prefix" maxlength="8" pattern="[0-9a-fA-F]*"
@input="vanity.prefix = vanity.prefix.replace(/[^0-9a-fA-F]/g, '')">
<label>Hex prefix (0-9, a-f)</label>
</div>
<div
v-if="vanity.prefix.length >= 2 && (vanity.prefix.toUpperCase().startsWith('00') || vanity.prefix.toUpperCase().startsWith('FF'))"
class="row" style="align-items: center; gap: 0.5em; color: var(--error); margin: 0.5em 0">
<i>warning</i>
<span>Prefixes starting with "00" or "FF" are reserved by MeshCore.</span>
</div>
<table class="border" v-if="vanity.prefix.length > 0">
<tr>
<td>Prefix</td>
<td><code>{{ vanity.prefix.toLowerCase() }}...</code></td>
</tr>
<tr>
<td>Expected attempts</td>
<td>{{ (Math.pow(16, vanity.prefix.length)).toLocaleString() }}</td>
</tr>
<tr>
<td>Estimated time</td>
<td>{{ vanity.estimatedTime }}</td>
</tr>
</table>
<nav class="right-align">
<button class="transparent link" @click="closeVanityDialog">Cancel</button>
<button @click="startVanityGen"
:disabled="!vanity.prefix || (vanity.prefix.length >= 2 && (vanity.prefix.toUpperCase().startsWith('00') || vanity.prefix.toUpperCase().startsWith('FF')))">
<i>play_arrow</i>
<span>Generate</span>
</button>
</nav>
</div>
<!-- Generating phase -->
<div v-if="vanity.phase === 'generating'">
<p>Searching for public key starting with <code>{{ vanity.prefix.toLowerCase() }}...</code></p>
<progress :value="vanity.progress" max="100"></progress>
<div class="small-space"></div>
<table class="border">
<tr>
<td>Attempts</td>
<td>{{ vanity.attempts.toLocaleString() }}</td>
</tr>
<tr>
<td>Elapsed</td>
<td>{{ vanity.elapsed }}</td>
</tr>
<tr>
<td>Speed</td>
<td>{{ vanity.keysPerSec }} keys/sec</td>
</tr>
</table>
<nav class="right-align">
<button @click="cancelVanityGen">
<i>stop</i>
<span>Cancel</span>
</button>
</nav>
</div>
<!-- Result phase -->
<div v-if="vanity.phase === 'result'">
<div class="row" style="align-items: center; gap: 0.5em; color: var(--primary); margin-bottom: 0.5em">
<i>check_circle</i>
<span>Found a match in {{ vanity.attempts.toLocaleString() }} attempts ({{ vanity.elapsed }})</span>
</div>
<div class="field border label">
<input :value="vanity.resultPubKey" readonly>
<label>Public Key</label>
</div>
<div class="field border label">
<input type="password" :value="vanity.resultPrvKey" readonly>
<label>Private Key (64 bytes, hidden)</label>
</div>
<div class="row" style="align-items: center; gap: 0.5em; color: var(--error); margin: 0.5em 0">
<i>warning</i>
<span>Applying this key changes the device identity. A reboot is required.</span>
</div>
<nav class="right-align">
<button class="transparent link" @click="closeVanityDialog">Cancel</button>
<button @click="applyVanityKey">
<i>check</i>
<span>Use this key</span>
</button>
</nav>
</div>
</dialog>
<dialog ref="consoleDialog">
<header>
<nav>
<h6>Console</h6>
<span class="max"></span>
<button class="transparent circle" @click="consoleDialog.close()"><i>close</i></button>
</nav>
</header>
<div class="console-output" ref="consoleOutput" @click="consoleFocus" @mouseup="consoleCopy">
<div v-for="entry in consoleLog" :class="'console-' + entry.type">{{ entry.text }}</div>
<form @submit.prevent="sendConsoleCmd" class="console-input-line">
<span class="console-prompt"
:title="regionLoadMode ? 'Region load mode: submit an empty line to commit and exit' : ''"
>{{ regionLoadMode ? 'region>' : '>' }} </span>
<input v-model="consoleCmd" ref="consoleCmdInput" spellcheck="false" autocomplete="off"
:style="{ width: (consoleCmd.length || 1) + 'ch' }" @keydown.up.prevent="consoleHistoryUp"
@keydown.down.prevent="consoleHistoryDown" @keydown.tab.prevent="consoleTab">
<span class="console-ghost" v-if="consoleSuggestion">{{ consoleSuggestion }}</span>
<progress v-if="consoleBusy" class="circle small"></progress>
</form>
</div>
</dialog>
<dialog ref="statsDialog" class="stats-dialog">
<header>
<nav>
<h6>Stats</h6>
<span class="max"></span>
<button class="transparent circle" @click="refreshStats" :disabled="stats.loading">
<i>refresh</i>
<div class="tooltip left max bottom" @click.stop>Re-read stats from the device</div>
</button>
<button class="transparent circle" @click="statsDialog.close()"><i>close</i></button>
</nav>
</header>
<div v-if="stats.loading && !statsRows.length" class="row" style="align-items: center; gap: 0.75em">
<progress class="circle small"></progress>
<span>Reading stats...</span>
</div>
<div v-if="stats.error" class="row" style="align-items: center; gap: 0.5em; color: var(--error)">
<i>error</i>
<span>{{ stats.error }}</span>
</div>
<div v-if="statsRows.length" class="stats-list" :class="{ 'stats-stale': stats.loading }">
<div v-for="row of statsRows" :key="row.label" class="stats-row">
<div class="stats-label">{{ row.label }}</div>
<div v-for="line of row.lines" class="stats-value">{{ line }}</div>
</div>
</div>
<nav class="right-align" v-if="stats.fetchedAt">
<span class="small-text">Updated {{ stats.fetchedAt }}</span>
</nav>
</dialog>
<dialog ref="mapDialog" class="no-round">
<header>
<nav>
<h6>Choose location from map</h6>
<span class="max"></span>
<button class="transparent circle" @click="mapDialog.close()"><i>close</i></button>
</nav>
</header>
<div class="small-space"></div>
<button @click="requestLocation">
<i>my_location</i>
<span>Request location</span>
</button>
<div class="small-space"></div>
<div id="map" class="no-round"></div>
<nav class="right-align">
<button class="transparent link" @click="mapDialog.close()">Cancel</button>
<button class="transparent link" @click="setMapLatLon">Set location</button>
</nav>
</dialog>
<main class="responsive padding" v-if="app.connected">
<div class="dual-pane">
<fieldset :disabled="app.locked">
<legend>Info & Actions</legend>
<div class="actions">
<button @click="openConsole">
<i>terminal</i>
<span>Console</span>
<div class="tooltip right max bottom" @click.stop>
Send manual CLI commands to the device
</div>
</button>
<button @click="openStats">
<i>speed</i>
<span>Stats</span>
<div class="tooltip right max bottom" @click.stop>
Show battery, uptime, radio and packet statistics
</div>
</button>
<button @click="importConfig">
<i>upload</i>
<span>Import</span>
<div class="tooltip right max bottom" @click.stop>
Import configuration from a JSON file
</div>
</button>
<button @click="exportConfig">
<i>download</i>
<span>Export</span>
<div class="tooltip right max bottom" @click.stop>
Export current configuration to a JSON file
</div>
</button>
</div>
<div class="small-space"></div>
<div class="row">
<div class="field label max">
<input placeholder=" " v-model="app.device.version" readonly>
<label>Version</label>
</div>
<div class="field label max">
<input placeholder=" " v-model="app.device.clock" readonly>
<label>Clock</label>
</div>
</div>
<div class="small-space"></div>
<div class="row">
<div class="field label max" v-if="app.device.pubKey">
<input placeholder=" " v-model="app.device.pubKey" readonly>
<label>Public Key</label>
</div>
<button class="circle" @click="openVanityDialog" v-if="app.device.pubKey">
<i>edit</i>
<div class="tooltip right max bottom" @click.stop>
Generate a new identity with a custom public key prefix
</div>
</button>
<div class="field label max" v-if="app.device.role">
<input placeholder=" " v-model="app.device.role" readonly>
<label>Role</label>
</div>
</div>
<div class="small-space"></div>
<div class="row" v-if="app.device.prvKey">
<div class="field label max">
<input placeholder=" " type="password" :value="app.device.prvKey" readonly>
<label>Private Key</label>
</div>
<button class="circle" @click="copyPrvKey">
<i>content_copy</i>
</button>
</div>
<div class="small-space"></div>
<div class="actions">
<button @click="sendAdvert">
<i>cell_tower</i>
<span>Send Advert</span>
<div class="tooltip right max bottom" @click.stop>
Sends an advertisement packet
</div>
</button>
<button @click="startOTA">
<i>upgrade</i>
<span>Start OTA</span>
<div class="tooltip right max bottom" @click.stop>
<p>Start Over the air firmware upgrade. In case of ESP32 device, new WiFi AP will be created that you
can use to upload firmware binary. In case of nRF52 device, use <b>nRF Connect</b> app to update the
firwmare.</p>
<p>Please visit <b><a target="_blank"
href="https://github.com/ripplebiz/MeshCore/blob/main/docs/faq.md#q-how-to--update-repeater-and-room-server-firmware-over-the-air">FAQ</a></b>
for more information.</p>
</div>
</button>
<button @click="reboot">
<i>restart_alt</i>
<span>Reboot</span>
<div class="tooltip right max bottom" @click.stop>
Reboot the device
</div>
</button>
<button @click="erase">
<i>delete</i>
<span>Factory reset</span>
<div class="tooltip right max bottom" @click.stop>
Delete identity and all settings from the device
</div>
</button>
</div>
</fieldset>
<fieldset :disabled="app.locked">
<legend>Name & Location</legend>
<div class="field border label no-margin">
<input placeholder=" " :value="app.device.vars.name" @input="onNameInput">
<label>Name</label>
<div class="tooltip right max bottom" @click.stop>
Max length is 24 bytes with location set, 32 otherwise. Emoji and unicode may take more than one byte.
</div>
</div>
<nav class="right-align no-space no-margin">
<span class="byte-counter"
:style="{ color: nameBytes >= nameMaxBytes ? 'var(--error)' : 'var(--on-surface-variant)' }">{{ nameBytes
}} / {{ nameMaxBytes }} bytes</span>
</nav>
<div class="row">
<div class="field border label max">
<input placeholder=" " type="text" pattern="-?[0-9]{1,2}([.][0-9]{1,6})?" v-model="app.device.vars.lat">
<label>Latitude</label>
</div>
<div class="field border label max">
<input placeholder=" " type="text" pattern="-?[0-9]{1,3}([.][0-9]{1,6})?" v-model="app.device.vars.lon">
<label>Longitude</label>
</div>
<button class="circle" @click="showMap">
<i>map</i>
<div class="tooltip right max bottom" @click.stop>
Set coordinates from map
</div>
</button>
</div>
</fieldset>
<fieldset :disabled="app.locked">
<legend>Access</legend>
<div class="row">
<div class="field border label max">
<input type="password" placeholder=" " v-model="app.device.password">
<label>New Admin password</label>
<div class="tooltip right max bottom" @click.stop>
Sets a new admin password. Any node using this password will be added to the admin
ACL list.<br>
Default: "password".
</div>
</div>
</div>
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars['guest.password']">
<label>Guest password</label>
<div class="tooltip right max bottom" @click.stop>
Sets/updates the guest password. Leaving this empty is recommended, as it gives users access to owner info
and neighbors functionality.
</div>
</div>
</fieldset>
<fieldset :disabled="app.locked" v-if="app.device.role === 'room-server'">
<legend>Room server settings</legend>
<div class="actions">
<label class="checkbox">
<input type="checkbox" v-model="app.device.vars['allow.read.only']">
<span>Read only</span>
<div class="tooltip right max bottom" @click.stop>
Allow login with blank password in read-only mode (cannot post to room).<br>
Default: off
</div>
</label>
</div>
</fieldset>
<fieldset :disabled="app.locked">
<legend>Radio settings</legend>
<div class="field border label max">
<select @change="setRadioPreset($event.target.value)">
<option v-for="(preset, i) of app.presets" :selected="preset === app.preset" :value="i">{{ preset.title }}
</option>
</select>
<label>Preset</label>
<div class="tooltip right max bottom" @click.stop>
<p>Suggested radio settings per region.</p>
<p>These radio settings have been suggested by the community.</p>
</div>
</div>
<div class="row">
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars.radio.freq" type="number" min="400" max="2500"
step="0.001">
<label>Frequency(MHz)</label>
</div>
<div class="field border label max">
<select v-model="app.device.vars.radio.bw">
<option value="7.8">7.8</option>
<option value="10.4">10.4</option>
<option value="15.6">15.6</option>
<option value="20.8">20.8</option>
<option value="31.25">31.25</option>
<option value="41.7">41.7</option>
<option value="62.5">62.5</option>
<option value="125">125</option>
<option value="250">250</option>
<option value="500">500</option>
<option value="203.125">203.125 [2.4Ghz]</option>
<option value="406.25">406.25 [2.4Ghz]</option>
<option value="812.5">812.5 [2.4Ghz]</option>
<option value="1625.0">1625.0 [2.4Ghz]</option>
</select>
<label>Bandwidth(kHz)</label>
</div>
</div>
<div class="row">
<div class="field border label max">
<select v-model="app.device.vars.radio.sf">
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
<label>Spreading factor</label>
</div>
<div class="field border label max">
<select v-model="app.device.vars.radio.cr">
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
</select>
<label>Coding rate</label>
</div>
</div>
<div class="row">
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars.tx" type="number" min="1" max="22" step="1">
<label>TX Power(dBm)</label>
<div class="tooltip right max bottom" @click.stop>
Power level of the LoRa chip (1-22 dBm). Some boards have an additional amplifier. Setting too high may
violate local regulations.
</div>
</div>
<div class="field border label max">
<input placeholder=" " v-model="dutyCycle" type="number" min="1" max="50" step="1">
<label>Duty cycle (%)</label>
<div class="tooltip right max bottom" @click.stop>
<p>After each transmission, the repeater enforces a silent period proportional to the on-air time. You
are responsible for choosing a value appropriate for your jurisdiction (e.g. EU 868 MHz requires 10%
duty cycle).</p>
<p>Airtime factor (AF): {{ app.device.vars.af }}<br>
Default: 1 (~50%)</p>
</div>
</div>
</div>
</fieldset>
<fieldset :disabled="app.locked">
<legend>Advertising</legend>
<div class="row">
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars['advert.interval']" type="number" min="0" max="240"
step="1">
<label>Advert interval (minutes)</label>
<div class="tooltip right max bottom" @click.stop>
Zero-hop advert interval in minutes, rounded to nearest multiple of 2 (60-240, or 0 to disable).<br>
Default: 0
</div>
</div>
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars['flood.advert.interval']" type="number" min="0" max="168"
step="1">
<label>Flood advert interval (hours)</label>
<div class="tooltip right max bottom" @click.stop>
Flood advert interval in hours (3-168, or 0 to disable).<br>
Default: 47 (repeater), 0 (sensor)
</div>
</div>
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars['flood.max']" type="number" min="0" max="64" step="1">
<label>Flood max</label>
<div class="tooltip right max bottom" @click.stop>
Maximum flood hop count (0-64).<br>
Default: 64
</div>
</div>
</div>
<div class="row" v-if="supportsVar('flood.max.unscoped') && hasVar('flood.max.unscoped')">
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars['flood.max.unscoped']" type="number" min="0" max="64"
step="1">
<label>Flood max (unscoped)</label>
<div class="tooltip right max bottom" @click.stop>
Maximum hop count for flood packets that carry no region scope (0-64).<br>
Requires firmware 1.16+
</div>
</div>
<div class="field border label max" v-if="hasVar('flood.max.advert')">
<input placeholder=" " v-model="app.device.vars['flood.max.advert']" type="number" min="0" max="64"
step="1">
<label>Flood max (adverts)</label>
<div class="tooltip right max bottom" @click.stop>
Maximum hop count for flooded adverts (0-64).<br>
Default: 16. Requires firmware 1.16+
</div>
</div>
</div>
</fieldset>
<fieldset :disabled="app.locked" v-if="acl.supported">
<legend>Access control</legend>
<div v-if="!acl.list.length" class="row" style="align-items: center; gap: 0.5em; color: var(--primary)">
<i>info</i>
<span>No nodes in the access list yet.</span>
</div>
<div v-for="entry of acl.list" :key="entry.uid" class="row acl-row">
<div class="field border label max">
<input placeholder=" " v-model="entry.pubkey" spellcheck="false" class="mono"
:class="{ invalid: !isValidPubKey(entry.pubkey) }">
<label>Public key</label>
</div>
<div class="field border label acl-role">
<select :value="aclRole(entry)" @change="setAclRole(entry, $event.target.value)">
<option v-for="role of ACL_ROLES" :value="role.value">{{ role.label }}</option>
</select>
<label>Role</label>
</div>
<button class="circle transparent" @click="deleteAclEntry(entry.uid)">
<i>delete</i>
<div class="tooltip left max bottom" @click.stop>Remove this node's access</div>
</button>
</div>
<div class="small-space"></div>
<button @click="addAclEntry">
<i>person_add</i>
<span>Add node</span>
<div class="tooltip right max bottom" @click.stop>
Add a node by its full 64-character public key. Applied with the global Save button.
</div>
</button>
</fieldset>
<fieldset :disabled="app.locked" v-if="regions.supported">
<legend>Regions</legend>
<article v-if="regions.truncated" class="border error-text small-text">
<i>warning</i>
The device's reply buffer is full, so this region list is incomplete.
Editing is disabled to avoid deleting regions that are not shown here.
Use the console (<b>region</b>) to inspect the full tree.
</article>
<template v-if="regionsEditable">
<div class="row">
<div class="field border label max" v-if="regions.supportsDefault">
<select v-model="regions.defaultUid">
<option value="">(none)</option>
<option v-for="r of regionChoices" :value="r.uid">{{ r.name }}</option>
</select>
<label>Default region</label>
<div class="tooltip right max bottom" @click.stop>
The scope this node uses for its own flood traffic when no other region applies.
Selecting a region also re-enables flood on it.
</div>
</div>
<div class="field border label max">
<select v-model="regions.homeUid">
<option v-for="r of regions.list" :value="r.uid">{{ r.name === '*' ? '* (none)' : r.name }}</option>
</select>
<label>Home region</label>
<div class="tooltip right max bottom" @click.stop>
The region this node considers itself to be in.
</div>
</div>
</div>
<div class="small-space"></div>
<div v-for="region of regions.list" :key="region.uid" class="row region-row">
<div class="field border label max">
<input placeholder=" " v-model="region.name" spellcheck="false"
:readonly="region.uid === ROOT_UID"
:class="{ invalid: region.uid !== ROOT_UID && !isValidRegionName(region.name) }">
<label>{{ region.uid === ROOT_UID ? 'Unscoped traffic' : 'Region name' }}</label>
</div>
<div class="field border label max" v-if="region.uid !== ROOT_UID">
<select v-model="region.parentUid">
<option v-for="option of regionParents(region.uid)" :value="option.uid">
{{ option.name }}
</option>
</select>
<label>Parent</label>
</div>
<label class="checkbox region-flood">
<input type="checkbox" v-model="region.flood">
<span>Allow Flood</span>
<div class="tooltip left max bottom" @click.stop v-if="region.uid === ROOT_UID">
Repeat unscoped flood traffic, i.e. packets that carry no region at all.
<br>
This does <b>not</b> allow regions that are not listed here to be repeated -
scoped traffic is only repeated when it matches one of the regions below.
</div>
<div class="tooltip left max bottom" @click.stop v-else>
Allow flood traffic scoped to this region to be repeated.
</div>
</label>
<button class="circle transparent" :disabled="region.uid === ROOT_UID"
@click="deleteRegion(region.uid)">
<i>delete</i>
</button>
</div>
<div class="small-space"></div>
<button @click="addRegion">
<i>add</i>
<span>Add region</span>
<div class="tooltip right max bottom" @click.stop>
Names may contain letters, digits, "-", "#" and "$" - no spaces.
Changes are written with the global Save button.
</div>
</button>
</template>
</fieldset>
<fieldset :disabled="app.locked" v-if="supportsVar('owner.info')">
<legend>Owner info</legend>
<div class="field textarea border label max no-margin">
<textarea placeholder=" " :value="app.device.vars['owner.info']" @input="onOwnerInfoInput"
rows="4"></textarea>
<label>Owner info</label>
</div>
<nav class="right-align no-space no-margin">
<span class="byte-counter"
:style="{ color: ownerInfoBytes >= 119 ? 'var(--error)' : 'var(--on-surface-variant)' }">{{ ownerInfoBytes
}} / 119 bytes</span>
</nav>
</fieldset>
<label class="checkbox">
<input type="checkbox" v-model="app.showAdvanced">
<span>Show advanced settings</span>
</label>
<fieldset :disabled="app.locked" v-if="app.showAdvanced">
<legend>Advanced settings</legend>
<div class="row">
<div class="field border label max" v-if="supportsVar('loop.detect')">
<select v-model="app.device.vars['loop.detect']">
<option value="off">Off</option>
<option value="minimal">Minimal</option>
<option value="moderate">Moderate</option>
<option value="strict">Strict</option>
</select>
<label>Loop detection</label>
<div class="tooltip right max bottom" @click.stop>
<p>Rejects flood packets that appear to be in a loop.<br>
Default: off. Requires firmware 1.14+
</p>
<p>Minimal: drops if own hash appears 4+ times (1-byte) or 2+ (2-byte). Moderate: 2+ (1-byte) or 1+
(2-byte). Strict: 1+ for all sizes.</p>
</div>
</div>
<div class="field border label max" v-if="supportsVar('path.hash.mode')">
<select v-model="app.device.vars['path.hash.mode']">
<option value="0">1-byte (0)</option>
<option value="1">2-byte (1)</option>
<option value="2">3-byte (2)</option>
</select>
<label>Path hash mode</label>
<div class="tooltip right max bottom" @click.stop>
<p>Sets the ID/hash encoding size used in adverts.<br>
Default: 0. Requires firmware 1.14+
</p>
<p>0: 1-byte (256 IDs, max 64 flood). 1: 2-byte (65K IDs, max 32 flood). 2: 3-byte (16M IDs, max 21
flood).</p>
<p>Older firmware (<1.14) will drop packets with multi-byte hashes.</p>
</div>
</div>
</div>
<div class="row">
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars['int.thresh']" type="number" min="0" max="255" step="1">
<label>Interference threshold</label>
<div class="tooltip right max bottom" @click.stop>
Local interference threshold.<br>
Default: 0
</div>
</div>
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars['agc.reset.interval']" type="number" min="0" step="4">
<label>AGC reset interval</label>
<div class="tooltip right max bottom" @click.stop>
AGC reset interval in seconds, rounded down to a multiple of 4.<br>
Default: 0
</div>
</div>
</div>
<div class="row">
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars.rxdelay" type="number" min="0" max="20" step="0.1">
<label>RX delay base</label>
<div class="tooltip right max bottom" @click.stop>
[Experimental] Processing delay for received traffic (0-20).<br>
Default: 0
</div>
</div>
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars.txdelay" type="number" min="0" max="2" step="0.1">
<label>TX delay factor</label>
<div class="tooltip right max bottom" @click.stop>
Retransmit delay factor for flood traffic (0-2).<br>
Default: 0.5
</div>
</div>
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars['direct.txdelay']" type="number" min="0" max="2"
step="0.1">
<label>Direct TX delay</label>
<div class="tooltip right max bottom" @click.stop>
Retransmit delay factor for direct traffic (0-2).<br>
Default: 0.2
</div>
</div>
</div>
<div class="row" v-if="hasVar('adc.multiplier')">
<div class="field border label max">
<input placeholder=" " v-model="app.device.vars['adc.multiplier']" type="number" min="0" step="0.001">
<label>ADC multiplier</label>
<div class="tooltip right max bottom" @click.stop>
Battery voltage divider calibration. 0 uses the board default.
</div>
</div>
</div>
<div class="row">
<label class="checkbox" v-if="hasVar('radio.rxgain')">
<input type="checkbox" v-model="app.device.vars['radio.rxgain']">
<span>RX boosted gain</span>
<div class="tooltip right max" @click.stop>
Boosted LoRa receive gain. Improves sensitivity at a small power cost.
Not supported on every radio.
</div>
</label>
</div>
<div class="row">
<label class="checkbox">
<input type="checkbox" v-model="app.device.vars.repeat">
<span>Repeat</span>
<div class="tooltip right max" @click.stop>
Enables or disables repeating.<br>
Default: Room server: off, Repeater: on
</div>
</label>
<label class="checkbox">
<input type="checkbox" v-model="app.device.vars['multi.acks']" true-value="1" false-value="0">
<span>Multi ACKs</span>
<div class="tooltip right max" @click.stop>
Enable multi-acks support.<br>
Default: off
</div>
</label>
</div>
</fieldset>
</div>
<div class="small-space"></div>
<div v-if="hasChanges" class="row" style="align-items: center; gap: 0.5em; color: var(--primary)">
<i>info</i>
<span>You have unsaved changes</span>
</div>
<div class="small-space" v-if="hasChanges"></div>
<button @click="setData">
<i>save</i>
<span>Save settings</span>
</button>
</main>
</div>
<script type="module" src="./lib/beer.min.js"></script>
<script type="module" src="./src/gui.js"></script>
</body>
</html>