URL for chatbot server deploy
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Lukas Bachschwell 2019-12-10 16:30:27 +01:00
parent 570a69032e
commit f4f56cb11e
5 changed files with 25 additions and 5 deletions

View File

@ -12,3 +12,5 @@ VUE_APP_BASE_API = '/dev-api'
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js # Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
BOTPRESS_HOST = 'http://localhost:3000'

View File

@ -4,3 +4,4 @@ ENV = 'production'
# base api # base api
VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = '/prod-api'
BOTPRESS_HOST = 'https://joinbot.tk/bot'

View File

@ -6,3 +6,4 @@ ENV = 'staging'
# base api # base api
VUE_APP_BASE_API = '/stage-api' VUE_APP_BASE_API = '/stage-api'
BOTPRESS_HOST = 'https://joinbot.tk/bot'

View File

@ -9,3 +9,7 @@ Current Join Frontend Implementation for the Admin and User dashboards
User: **user** User: **user**
Password: **any** Password: **any**
### Usefull Links:
https://botpress.io/docs/tutorials/webchat-embedding

View File

@ -9,9 +9,15 @@ export default {
name: 'Chatbot', name: 'Chatbot',
components: { }, components: { },
data() { data() {
return {}
}, },
mounted: () => { mounted: () => {
window.botpressWebChat.init({ host: 'http://localhost:3000', botId: 'joinbot' }) window.botpressWebChat.init({ host: process.env.BOTPRESS_HOST, botId: 'joinbot', enableReset: false,
enableTranscriptDownload: false,
hideWidget: true,
extraStylesheet: '/assets/modules/channel-web/chat.css',
botName: 'Joe'
})
setTimeout(() => { setTimeout(() => {
window.botpressWebChat.sendEvent({ window.botpressWebChat.sendEvent({
type: 'show', type: 'show',
@ -20,6 +26,9 @@ export default {
// window.botpressWebChat.sendEvent({ type: 'message', text: 'Hallo!' }) // window.botpressWebChat.sendEvent({ type: 'message', text: 'Hallo!' })
}, 1500) }, 1500)
}, },
beforeDestroy: () => {
document.getElementById('bp-widget').parentElement.removeChild(document.getElementById('bp-widget'))
},
methods: { methods: {
} }
@ -48,11 +57,14 @@ export default {
</style> </style>
<style> <style>
#bp-widget { #bp-widget {
top: 20%;
left: 40%;
bottom: 0px; bottom: 0px;
right: 0px; right: 0px;
width: 400px; width: 70%;
height: 80% !important; height: 100% !important;
}
#bp-web-widget {
width:100%;
height:100%
} }
</style> </style>