mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-07 09:13:04 +02:00
Add node GPS enablement + sourcing. Closes #53.
This commit is contained in:
@@ -54,6 +54,9 @@ export function SettingsRadioSection({
|
||||
const [sf, setSf] = useState('');
|
||||
const [cr, setCr] = useState('');
|
||||
const [pathHashMode, setPathHashMode] = useState('0');
|
||||
const [advertLocationSource, setAdvertLocationSource] = useState<
|
||||
'off' | 'node_gps' | 'saved_coords'
|
||||
>('saved_coords');
|
||||
const [gettingLocation, setGettingLocation] = useState(false);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [rebooting, setRebooting] = useState(false);
|
||||
@@ -86,6 +89,7 @@ export function SettingsRadioSection({
|
||||
setSf(String(config.radio.sf));
|
||||
setCr(String(config.radio.cr));
|
||||
setPathHashMode(String(config.path_hash_mode));
|
||||
setAdvertLocationSource(config.advert_location_source ?? 'saved_coords');
|
||||
}, [config]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -175,6 +179,9 @@ export function SettingsRadioSection({
|
||||
lat: parsedLat,
|
||||
lon: parsedLon,
|
||||
tx_power: parsedTxPower,
|
||||
...(advertLocationSource !== (config.advert_location_source ?? 'saved_coords')
|
||||
? { advert_location_source: advertLocationSource }
|
||||
: {}),
|
||||
radio: {
|
||||
freq: parsedFreq,
|
||||
bw: parsedBw,
|
||||
@@ -506,6 +513,28 @@ export function SettingsRadioSection({
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="advert-location-source">Advert Location Source</Label>
|
||||
<select
|
||||
id="advert-location-source"
|
||||
value={advertLocationSource}
|
||||
onChange={(e) =>
|
||||
setAdvertLocationSource(e.target.value as 'off' | 'node_gps' | 'saved_coords')
|
||||
}
|
||||
className="w-full h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"
|
||||
>
|
||||
<option value="off">Off</option>
|
||||
<option value="node_gps">Use Node GPS</option>
|
||||
<option value="saved_coords">Use Saved Coordinates</option>
|
||||
</select>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
This only controls which location source the radio puts into adverts. If you choose Use
|
||||
Node GPS, GPS still has to be enabled manually on the node itself for live coordinates
|
||||
to take effect; RemoteTerm cannot turn it on through the interface library. RemoteTerm
|
||||
still uses the saved coordinates above for local distance math and similar UI
|
||||
calculations.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{config.path_hash_mode_supported && (
|
||||
|
||||
Reference in New Issue
Block a user