move geocoding / map settings into separate tab

This commit is contained in:
lesion 2022-12-06 23:53:14 +01:00
parent d466094be6
commit 851fce0a90
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 50 additions and 39 deletions

View file

@ -5,6 +5,8 @@ v-card
p.mb-6(v-html="$t('admin.geolocation_description')")
v-form
v-row
v-col(md=3)
v-autocomplete.mb-4(v-model='geocoding_provider_type'
@blur="save('geocoding_provider_type', geocoding_provider_type )"
:label="$t('admin.geocoding_provider_type')"
@ -13,6 +15,7 @@ v-card
:items="geocoding_provider_type_items"
:placeholder="geocoding_provider_type_default")
v-col(md=5)
v-text-field.mb-4(v-model='geocoding_provider'
@blur="save('geocoding_provider', geocoding_provider )"
:label="$t('admin.geocoding_provider')"
@ -20,6 +23,7 @@ v-card
persistent-hint
:placeholder="geocoding_provider_default")
v-col(md=4)
v-autocomplete.mb-6(v-model="geocoding_countrycodes" :disabled="!(geocoding_provider_type === null || geocoding_provider_type === 'Nominatim')"
@blur="save('geocoding_countrycodes', geocoding_countrycodes )"
:label="$t('admin.geocoding_countrycodes')"
@ -29,6 +33,8 @@ v-card
item-text="name"
:hint="$t('admin.geocoding_countrycodes_help')")
v-row
v-col(md=6)
v-text-field.mb-4(v-model='tilelayer_provider'
@blur="save('tilelayer_provider', tilelayer_provider )"
:label="$t('admin.tilelayer_provider')"
@ -36,29 +42,32 @@ v-card
persistent-hint
:placeholder="tilelayer_provider_default")
v-col(md=6)
v-text-field(v-model='tilelayer_provider_attribution'
@blur="save('tilelayer_provider_attribution', tilelayer_provider_attribution )"
:label="$t('admin.tilelayer_provider_attribution')"
:placeholder="tilelayer_provider_attribution_default")
div(id="leaflet-map-preview" max-height='10px')
//- Map
v-card-actions
v-spacer
v-btn(color='primary' @click='testGeocodingProvider' :loading='testGeocodingLoading' outlined ) {{$t('admin.geocoding_test_button')}}
v-btn(color='primary' @click='testTileLayerProvider' :loading='testTileLayerLoading' outlined ) {{$t('admin.tilelayer_test_button')}}
v-btn(color='warning' @click="done" outlined) {{$t("common.ok")}}
</template>
<script>
import { mapActions, mapState } from 'vuex'
import { isoCountries } from '../../server/helpers/geolocation'
// import Map from '~/components/Map'
import "leaflet/dist/leaflet.css"
export default {
props: {
setup: { type: Boolean, default: false }
},
// components: { Map },
data ({ $store }) {
return {
loading: false,

View file

@ -58,16 +58,11 @@ v-container
v-dialog(v-model='showSMTP' destroy-on-close max-width='700px' :fullscreen='$vuetify.breakpoint.xsOnly')
SMTP(@close='showSMTP = false')
v-card-actions
v-btn(text @click='showSMTP=true')
<v-icon v-if='!settings.admin_email' color='error' class="mr-2" v-text='mdiAlert'></v-icon> {{$t('admin.show_smtp_setup')}}
v-dialog(v-model='showGeolocationConfigs' destroy-on-close max-width='700px' :fullscreen='$vuetify.breakpoint.xsOnly')
Geolocation(setup, @close='showGeolocationConfigs = false')
v-card-actions
v-btn(text @click='showGeolocationConfigs=true')
<v-icon v-if='!settings.admin_email' color='primary' class="mr-2" v-text='mdiMap'></v-icon> {{$t('admin.show_geolocation_setup')}}
v-btn(text @click='$emit("complete")' color='primary' v-if='setup') {{$t('common.next')}}
v-icon(v-text='mdiArrowRight')

View file

@ -26,6 +26,12 @@ v-container.container.pa-0.pa-md-3
v-tab-item(value='places')
Places
//- GEOCODING / MAPS
v-tab(href='#geolocation' v-if='settings.allow_geolocation') {{$t('admin.geolocation')}}
v-tab-item(value='geolocation')
Geolocation
//- Collections
v-tab(href='#collections') {{$t('common.collections')}}
v-tab-item(value='collections')
@ -71,6 +77,7 @@ export default {
Events: () => import(/* webpackChunkName: "admin" */'../components/admin/Events'),
Places: () => import(/* webpackChunkName: "admin" */'../components/admin/Places'),
Collections: () => import(/* webpackChunkName: "admin" */'../components/admin/Collections'),
Geolocation: () => import(/* webpackChunkName: "admin" */'../components/admin/Geolocation.vue'),
Federation: () => import(/* webpackChunkName: "admin" */'../components/admin/Federation.vue'),
Moderation: () => import(/* webpackChunkName: "admin" */'../components/admin/Moderation.vue'),
Plugin: () => import(/* webpackChunkName: "admin" */'../components/admin/Plugin.vue'),