Client - display weather data source in About page
This commit is contained in:
parent
cd66952db9
commit
895592fbb1
@ -40,6 +40,12 @@
|
||||
{{ $t('about.CONTACT_ADMIN') }}
|
||||
</a>
|
||||
</div>
|
||||
<div v-if="weather_provider && weather_provider.name">
|
||||
{{ $t('about.WEATHER_DATA_FROM') }}
|
||||
<a :href="weather_provider.url" target="_blank" rel="nofollow noopener">
|
||||
{{ weather_provider.name }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -55,6 +61,22 @@
|
||||
const appConfig: ComputedRef<TAppConfig> = computed(
|
||||
() => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]
|
||||
)
|
||||
const weather_provider: ComputedRef<Record<string, string>> = computed(() =>
|
||||
get_weather_provider()
|
||||
)
|
||||
|
||||
function get_weather_provider() {
|
||||
const weather_provider: Record<string, string> = {}
|
||||
if (appConfig.value.weather_provider === 'darksky') {
|
||||
weather_provider['name'] = 'Dark Sky'
|
||||
weather_provider['url'] = 'https://darksky.net'
|
||||
}
|
||||
if (appConfig.value.weather_provider === 'visualcrossing') {
|
||||
weather_provider['name'] = 'Visual Crossing'
|
||||
weather_provider['url'] = 'https://www.visualcrossing.com'
|
||||
}
|
||||
return weather_provider
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -2,5 +2,6 @@
|
||||
"CONTACT_ADMIN": "Contact the administrator",
|
||||
"FITTRACKEE_DESCRIPTION": "<strong>FitTrackee</strong> is a self-hosted outdoor activity tracker.",
|
||||
"FITTRACKEE_LICENSE": "under {0} license ",
|
||||
"SOURCE_CODE": "Source code"
|
||||
"SOURCE_CODE": "Source code",
|
||||
"WEATHER_DATA_FROM": "Weather data from:"
|
||||
}
|
@ -2,5 +2,6 @@
|
||||
"CONTACT_ADMIN": "Contacter l'administrateur",
|
||||
"FITTRACKEE_DESCRIPTION": "<strong>FitTrackee</strong> est un <em>tracker</em> d'activités sportives (en extérieur).",
|
||||
"FITTRACKEE_LICENSE": "sous licence {0} (en) ",
|
||||
"SOURCE_CODE": "Code source (en)"
|
||||
"SOURCE_CODE": "Code source (en)",
|
||||
"WEATHER_DATA_FROM": "Source des données météo :"
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ export interface IAppStatistics {
|
||||
}
|
||||
|
||||
export type TAppConfig = {
|
||||
[key: string]: number | boolean | string
|
||||
[key: string]: number | boolean | string | null
|
||||
admin_contact: string
|
||||
gpx_limit_import: number
|
||||
is_email_sending_enabled: boolean
|
||||
@ -16,6 +16,7 @@ export type TAppConfig = {
|
||||
max_users: number
|
||||
max_zip_file_size: number
|
||||
version: string
|
||||
weather_provider: string | null
|
||||
}
|
||||
|
||||
export interface IApplication {
|
||||
|
Loading…
Reference in New Issue
Block a user