Skip to content

Commit

Permalink
ITEM-363 Fix type variable d'env pas pris en compte
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelQuetin committed Nov 27, 2024
1 parent 44a73f7 commit 440fb3a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .env-dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VITE_API_URL=
VITE_API_URL_IDREF=
VITE_MAINTENANCE=false
VITE_MAINTENANCE=0
4 changes: 2 additions & 2 deletions README-developpement.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
## Maintenance

Pour passer l'application en mode maintenance il suffit de passer la variable d'environement `VITE_MAINTENANCE` à
`true`.
Sinon pour passer en mode maintenance sur les serveurs, il suffit de passer la varable `ITEM_FRONT_MAINTENANCE` à `true`
`1`.
Sinon pour passer en mode maintenance sur les serveurs, il suffit de passer la variable `ITEM_FRONT_MAINTENANCE` à `1`
du projet [Item-docker](https://github.com/abes-esr/item-docker).
3 changes: 2 additions & 1 deletion docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Paramètres par défaut du conteneur
export ITEM_FRONT_API_BASEURL=${ITEM_FRONT_API_BASEURL:='http://localhost:8081/'}
export ITEM_FRONT_IDREF_API_URL=${ITEM_FRONT_IDREF_API_URL:='http://localhost:8081/'}
export ITEM_FRONT_MAINTENANCE=${ITEM_FRONT_MAINTENANCE:='false'}
export ITEM_FRONT_MAINTENANCE=${ITEM_FRONT_MAINTENANCE:='0'}


# Remplace les placeholders dans le code généré en prod
Expand All @@ -12,6 +12,7 @@ export ITEM_FRONT_MAINTENANCE=${ITEM_FRONT_MAINTENANCE:='false'}
echo "-> Remplacement des placeholders venant du .env de vuejs dans la destination /usr/share/nginx/html/"
echo "-> ITEM_FRONT_API_BASEURL=${ITEM_FRONT_API_BASEURL}"
echo "-> ITEM_PLACEHOLDER_VITE_IDREF_API_URL=${ITEM_FRONT_IDREF_API_URL}"
echo "-> ITEM_PLACEHOLDER_VITE_MAINTENANCE=${ITEM_FRONT_MAINTENANCE}"
rm -rf /usr/share/nginx/html/
cp -rf /usr/share/nginx/html.orig/ /usr/share/nginx/html/
sed -i \
Expand Down
7 changes: 4 additions & 3 deletions src/components/Structure/Maintenance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
</v-overlay>
</template>
<script setup>
import { computed } from 'vue';
const warningDialog = computed(() => import.meta.env.VITE_MAINTENANCE === 'true');
let maintenance = import.meta.env.VITE_MAINTENANCE;
const warningDialog = computed(() => {
return maintenance == true;
});
</script>
<style>
Expand Down

0 comments on commit 440fb3a

Please sign in to comment.