Merge pull request '#7358: Added chip in Navbar to show environment' (!1618) from 7358-AddChipInNavbar into dev
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #1618
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Jon Elias 2025-03-26 11:44:56 +00:00
commit 415d44a33a
1 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,5 @@
<script setup>
import { onMounted, ref } from 'vue';
import { onMounted, ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useState } from 'src/composables/useState';
import { useStateStore } from 'stores/useStateStore';
@ -18,6 +18,14 @@ const state = useState();
const user = state.getUser();
const appName = 'Lilium';
const pinnedModulesRef = ref();
const hostname = window.location.hostname;
const env = ref();
const getEnvironment = computed(() => {
env.value = hostname.split('-');
if (env.value.length <= 1) return;
return env.value[0];
});
onMounted(() => stateStore.setMounted());
const refresh = () => window.location.reload();
@ -49,6 +57,9 @@ const refresh = () => window.location.reload();
{{ t('globals.backToDashboard') }}
</QTooltip>
</QBtn>
<QBadge v-if="getEnvironment" color="primary" align="top">
{{ getEnvironment }}
</QBadge>
</RouterLink>
<VnBreadcrumbs v-if="$q.screen.gt.sm" />
<QSpinner