input token

This commit is contained in:
Alex Tran 2023-11-12 15:21:42 -06:00
parent 557b824f8b
commit 2d489b33e3

View file

@ -29,6 +29,9 @@
async function saveSetting() {
try {
const { data: current } = await api.systemConfigApi.getConfig();
console.log('current', current.reverseGeocoding);
console.log('update', config.reverseGeocoding.useMapbox);
const { data: updated } = await api.systemConfigApi.updateConfig({
systemConfigDto: {
...current,
@ -40,6 +43,8 @@
reverseGeocoding: {
enabled: config.reverseGeocoding.enabled,
citiesFileOverride: config.reverseGeocoding.citiesFileOverride,
useMapbox: config.reverseGeocoding.useMapbox,
mapboxAccessToken: config.reverseGeocoding.mapboxAccessToken,
},
},
});
@ -149,8 +154,24 @@
isEdited={config.reverseGeocoding.citiesFileOverride !==
savedConfig.reverseGeocoding.citiesFileOverride}
/>
</div></SettingAccordion
>
<SettingSwitch
title="Use Mapbox"
{disabled}
subtitle="Use Mapbox for reverse geocoding"
bind:checked={config.reverseGeocoding.useMapbox}
/>
<SettingInputField
inputType={SettingInputFieldType.TEXT}
label="URL"
desc="URL of the machine learning server"
bind:value={config.reverseGeocoding.mapboxAccessToken}
required={true}
disabled={disabled || !config.reverseGeocoding.useMapbox}
isEdited={config.reverseGeocoding.mapboxAccessToken !== savedConfig.reverseGeocoding.mapboxAccessToken}
/>
</div>
</SettingAccordion>
<SettingButtonsRow
on:reset={reset}