show a warning in admin panel in case baseurl is different #149
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
v-container.container.pa-0.pa-md-3
|
v-container.container.pa-0.pa-md-3
|
||||||
v-card
|
v-card
|
||||||
|
v-alert(v-if='url!==settings.baseurl' outlined type='warning' color='red' show-icon :icon='mdiAlert') {{$t('admin.wrong_domain_warning')}}
|
||||||
v-tabs(v-model='selectedTab' show-arrows)
|
v-tabs(v-model='selectedTab' show-arrows)
|
||||||
|
|
||||||
//- SETTINGS
|
//- SETTINGS
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
|
import { mdiAlert } from '@mdi/js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Admin',
|
name: 'Admin',
|
||||||
@@ -63,18 +65,24 @@ export default {
|
|||||||
Theme: () => import(/* webpackChunkName: "admin" */'../components/admin/Theme.vue')
|
Theme: () => import(/* webpackChunkName: "admin" */'../components/admin/Theme.vue')
|
||||||
},
|
},
|
||||||
middleware: ['auth'],
|
middleware: ['auth'],
|
||||||
async asyncData ({ $axios, params, store }) {
|
async asyncData ({ $axios, req }) {
|
||||||
|
let url
|
||||||
|
if (process.client) {
|
||||||
|
url = window.location.protocol + '//' + window.location.host
|
||||||
|
} else {
|
||||||
|
url = req.protocol + '://' + req.headers.host
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const users = await $axios.$get('/users')
|
const users = await $axios.$get('/users')
|
||||||
const unconfirmedEvents = await $axios.$get('/event/unconfirmed')
|
const unconfirmedEvents = await $axios.$get('/event/unconfirmed')
|
||||||
return { users, unconfirmedEvents, selectedTab: 0 }
|
return { users, unconfirmedEvents, selectedTab: 0, url }
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
return { users: [], unconfirmedEvents: [], selectedTab: 0, url }
|
||||||
return { users: [], unconfirmedEvents: [], selectedTab: 0 }
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
mdiAlert,
|
||||||
description: '',
|
description: '',
|
||||||
unconfirmedEvents: [],
|
unconfirmedEvents: [],
|
||||||
selectedTab: 0
|
selectedTab: 0
|
||||||
@@ -100,7 +108,7 @@ export default {
|
|||||||
this.loading = true
|
this.loading = true
|
||||||
await this.$axios.$get(`/event/confirm/${id}`)
|
await this.$axios.$get(`/event/confirm/${id}`)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$root.$message('event.confirmed', { color: 'succes' })
|
this.$root.$message('event.confirmed', { color: 'success' })
|
||||||
this.unconfirmedEvents = this.unconfirmedEvents.filter(e => e.id !== id)
|
this.unconfirmedEvents = this.unconfirmedEvents.filter(e => e.id !== id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user