1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/fittrackee_ynh.git synced 2024-09-03 18:36:16 +02:00

Merge pull request #48 from YunoHost-Apps/make-config_panel-consistent

Make config panel consistent
This commit is contained in:
Thomas 2023-12-17 18:48:37 +01:00 committed by GitHub
commit db6d6711ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 15 deletions

View file

@ -36,6 +36,6 @@ STATICMAP_SUBDOMAINS=''
# Weather
# available weather API providers: darksky, visualcrossing
WEATHER_API_PROVIDER=__WEATHER_PROVIDER__
WEATHER_API_KEY=__WEATHER_KEY__
WEATHER_API_PROVIDER=__WEATHER_API_PROVIDER__
WEATHER_API_KEY=__WEATHER_API_KEY__

View file

@ -26,7 +26,7 @@ services = ["__APP__", "__APP___workers"]
help.fr = "Change le répertoire de données où sont stockés tous les fichiers .gpx téléversés et les photos de profil"
bind = "UPLOAD_FOLDER:/var/www/__APP__/.env"
[main.config.weather_provider]
[main.config.weather_api_provider]
ask.en = "Change weather provider"
ask.fr = "Changer le fournisseur météo"
type = "select"
@ -36,7 +36,7 @@ services = ["__APP__", "__APP___workers"]
help.fr = "Changer votre fournisseur météo en choisissant un de ceux qui vous sont proposés"
bind = "WEATHER_API_PROVIDER:/var/www/__APP__/.env"
[main.config.WEATHER_API_KEY]
[main.config.weather_api_key]
ask.en = "Change weather api key"
ask.fr = "Changer la clé api pour la météo"
type = "string"

View file

@ -47,7 +47,7 @@ ram.runtime = "50M"
help.fr = "Choisissez un mot de passe pour lutilisateur admin ici."
type = "password"
[install.weather_provider]
[install.weather_api_provider]
ask.en = "(Optional) Choose your weather provider between Darksky and Visual Crossing"
ask.fr = "(Optionnel) Choisissez votre fournisseur météo entre Darksky et Visual Crossing"
help.en = "Since Fittrackee 0.7.15, only Visual Crossing is supported"
@ -57,7 +57,7 @@ ram.runtime = "50M"
default = "visualcrossing"
optional = true
[install.weather_key]
[install.weather_api_key]
ask.en = "(Optional) Insert here the api key from the chosen weather provider"
ask.fr = "(Optionnel) Insérez ici la clé API du fournisseur de météo choisi"
type = "string"

View file

@ -16,9 +16,6 @@ source /usr/share/yunohost/helpers
admin=$(ynh_user_get_info --username=$admin --key=username)
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
weather_provider=$(ynh_app_setting_get --app=$app --key=$weather_provider)
weather_key=$(ynh_app_setting_get --app=$app --key=$weather_key)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================

View file

@ -11,8 +11,8 @@ source /usr/share/yunohost/helpers
admin=$(ynh_user_get_info --username=$admin --key=username)
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
ynh_app_setting_set --app=$app --key=weather_provider --value=$weather_provider
ynh_app_setting_set --app=$app --key=weather_key --value=$weather_key
ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider
ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key
#=================================================

View file

@ -9,6 +9,21 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
if [ -z "${weather_api_provider:-}" ]; then
weather_api_provider=$weather_provider
ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider
fi
if [ -z "${weather_api_key:-}" ]; then
weather_api_key=$weather_key
ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key
fi
#=================================================
# LOAD SETTINGS
#=================================================
@ -16,9 +31,6 @@ source /usr/share/yunohost/helpers
admin=$(ynh_user_get_info --username=$admin --key=username)
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
weather_provider=$(ynh_app_setting_get --app=$app --key=$weather_provider)
weather_key=$(ynh_app_setting_get --app=$app --key=$weather_key)
#=================================================
# CHECK VERSION
#=================================================

View file

@ -21,4 +21,5 @@ test_format = 1.0
test_upgrade_from.e49294c.name = "0.7.22"
test_upgrade_from.a446e8c.name = "0.7.23"
test_upgrade_from.316dea4.name = "0.7.24"
test_upgrade_from.d682f12.name = "0.7.25~ynh3"
test_upgrade_from.d682f12.name = "0.7.25~ynh3"
test_upgrade_from.e48197d.name = "0.7.26"