Add chatbot enable control in env

This commit is contained in:
nemo 2024-06-11 09:41:59 +01:00
parent d27ef60999
commit 55013c0457
3 changed files with 7 additions and 2 deletions

View File

@ -12,6 +12,9 @@ VITE_OPB_SERVER_SESSION_PASSWORD=very secret
# Be sure to secure your Redis instance
VITE_OBP_REDIS_URL = redis://127.0.0.1:6379
# Enable the chatbot interface "Opey"
VITE_CHATBOT_ENABLED=false
# Product styling setting
#VITE_OBP_LINKS_COLOR="#52b165"
#VITE_OBP_HEADER_LINKS_COLOR="#39455f"

2
auto-imports.d.ts vendored
View File

@ -4,5 +4,5 @@
// Generated by unplugin-auto-import
export {}
declare global {
const ElNotification: typeof import('element-plus/es')['ElNotification']
}

View File

@ -28,6 +28,8 @@
<script setup lang="ts">
import HeaderNav from './components/HeaderNav.vue'
import ChatWidget from './components/ChatWidget.vue'
const isChatbotEnabled = import.meta.env.VITE_CHATBOT_ENABLED === 'true'
</script>
<template>
@ -38,7 +40,7 @@ import ChatWidget from './components/ChatWidget.vue'
<HeaderNav />
</el-header>
<RouterView />
<ChatWidget />
<ChatWidget v-if="isChatbotEnabled"/>
</el-container>
</div>
</template>