Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ITEM-363 Fix type variable d'env pas pris en compte #180

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading