add possibility to use a different backend
This commit is contained in:
parent
621739546e
commit
cbe1945f5d
@ -9,6 +9,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<help v-if="showHelp"/>
|
<help v-if="showHelp"/>
|
||||||
<div style="position:fixed;bottom:4pt;right:4pt;display:flex;z-index:10">
|
<div style="position:fixed;bottom:4pt;right:4pt;display:flex;z-index:10">
|
||||||
|
<input v-if="connect_dev" type=button class="btn" style="min-width:28pt;cursor:pointer;" @click="resetConnection" :value="'💚'+connect_dev" />
|
||||||
<input type=button class="btn" style="min-width:28pt;cursor:pointer;" @click="()=>{sending_report = true}" :value=" $t('report') " />
|
<input type=button class="btn" style="min-width:28pt;cursor:pointer;" @click="()=>{sending_report = true}" :value=" $t('report') " />
|
||||||
<input type="button" class="btn" value="" style="min-width:28pt;cursor:pointer;background-position:center;background-image:url('https://img.icons8.com/color/48/discord-logo.png');background-size:1.5em;background-repeat: no-repeat;" @click="joinDiscord"/>
|
<input type="button" class="btn" value="" style="min-width:28pt;cursor:pointer;background-position:center;background-image:url('https://img.icons8.com/color/48/discord-logo.png');background-size:1.5em;background-repeat: no-repeat;" @click="joinDiscord"/>
|
||||||
<input type="button" class="btn" :value="(showHelp?'X':'?')" style="min-width:28pt;border-radius:100%;cursor:pointer;" @click="getHelp"/>
|
<input type="button" class="btn" :value="(showHelp?'X':'?')" style="min-width:28pt;border-radius:100%;cursor:pointer;" @click="getHelp"/>
|
||||||
@ -63,6 +64,7 @@ export default {
|
|||||||
theme: 'light',
|
theme: 'light',
|
||||||
report: '',
|
report: '',
|
||||||
sending_report: false,
|
sending_report: false,
|
||||||
|
connect_dev: undefined,
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
},
|
},
|
||||||
@ -98,6 +100,11 @@ export default {
|
|||||||
// Send message to SW to skip the waiting and activate the new SW
|
// Send message to SW to skip the waiting and activate the new SW
|
||||||
this.registration.waiting.postMessage({ type: 'SKIP_WAITING' })
|
this.registration.waiting.postMessage({ type: 'SKIP_WAITING' })
|
||||||
},
|
},
|
||||||
|
resetConnection() {
|
||||||
|
this.$socket.disconnect();
|
||||||
|
window.localStorage.removeItem('connect-dev');
|
||||||
|
window.navigation.reload();
|
||||||
|
},
|
||||||
detectColorScheme() {
|
detectColorScheme() {
|
||||||
if(localStorage.getItem("theme")){
|
if(localStorage.getItem("theme")){
|
||||||
this.theme = localStorage.getItem("theme")
|
this.theme = localStorage.getItem("theme")
|
||||||
@ -146,6 +153,9 @@ export default {
|
|||||||
userLang = 'en';
|
userLang = 'en';
|
||||||
this.$i18n.locale = userLang.split('-')[0]
|
this.$i18n.locale = userLang.split('-')[0]
|
||||||
}
|
}
|
||||||
|
if (window.localStorage.getItem('connect-dev')) {
|
||||||
|
this.connect_dev = window.localStorage.getItem('connect-dev')
|
||||||
|
}
|
||||||
this.detectColorScheme()
|
this.detectColorScheme()
|
||||||
if (window.location.origin.indexOf('localhost') !== -1) return;
|
if (window.location.origin.indexOf('localhost') !== -1) return;
|
||||||
datadogRum.init({
|
datadogRum.init({
|
||||||
|
@ -3,10 +3,17 @@ import App from './App.vue'
|
|||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
import VueSocketIO from 'bang-vue-socket.io'
|
import VueSocketIO from 'bang-vue-socket.io'
|
||||||
Vue.use(new VueSocketIO({
|
if (window.localStorage.getItem('connect-dev')) {
|
||||||
debug: Vue.config.devtools,
|
Vue.use(new VueSocketIO({
|
||||||
connection: Vue.config.devtools ? `http://${window.location.hostname}:5001` : window.location.origin,
|
debug: true,
|
||||||
}))
|
connection: window.localStorage.getItem('connect-dev'),
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
Vue.use(new VueSocketIO({
|
||||||
|
debug: Vue.config.devtools,
|
||||||
|
connection: (Vue.config.devtools) ? `http://${window.location.hostname}:5001` : window.location.origin,
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
import PrettyCheckbox from 'pretty-checkbox-vue';
|
import PrettyCheckbox from 'pretty-checkbox-vue';
|
||||||
Vue.use(PrettyCheckbox)
|
Vue.use(PrettyCheckbox)
|
||||||
|
Loading…
Reference in New Issue
Block a user