mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
link to admin if isAdmin is true
This commit is contained in:
parent
a1e8114673
commit
f8404fc9a9
@ -1,3 +1,4 @@
|
||||
GRAPHQL_URI=http://localhost:4000/graphql
|
||||
DEFAULT_PUBLISHER_ID=2896
|
||||
//BUILD_COMMIT=0000000
|
||||
#BUILD_COMMIT=0000000
|
||||
ADMIN_AUTH_URL=http://localhost/admin/authenticate?token=$1
|
||||
@ -45,6 +45,7 @@
|
||||
<slot name="links"></slot>
|
||||
</ul>
|
||||
<hr class="my-2" />
|
||||
|
||||
<ul class="navbar-nav ml-3">
|
||||
<li class="nav-item">
|
||||
<a :href="getElopageLink()" class="nav-link" target="_blank">
|
||||
@ -54,6 +55,14 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="navbar-nav ml-3" v-if="this.$store.state.isAdmin">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link ponter" @click="admin">
|
||||
{{ $t('admin_area') }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="navbar-nav ml-3">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link pointer" @click="logout">
|
||||
@ -112,6 +121,10 @@ export default {
|
||||
logout() {
|
||||
this.$emit('logout')
|
||||
},
|
||||
admin() {
|
||||
window.location = CONFIG.ADMIN_AUTH_URL.replace('$1',this.$store.state.token)
|
||||
this.$store.dispatch('logout') // logout without redirect
|
||||
},
|
||||
getElopageLink() {
|
||||
const pId = this.$store.state.publisherId
|
||||
? this.$store.state.publisherId
|
||||
|
||||
@ -18,8 +18,9 @@ const environment = {
|
||||
DEFAULT_PUBLISHER_ID: process.env.DEFAULT_PUBLISHER_ID || 2896,
|
||||
}
|
||||
|
||||
const server = {
|
||||
const endpoints = {
|
||||
GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost:4000/graphql',
|
||||
ADMIN_AUTH_URL: process.env.ADMIN_AUTH_URL || 'http://localhost/admin/authenticate?token=$1'
|
||||
}
|
||||
|
||||
const options = {}
|
||||
@ -27,7 +28,7 @@ const options = {}
|
||||
const CONFIG = {
|
||||
...version,
|
||||
...environment,
|
||||
...server,
|
||||
...endpoints,
|
||||
...options,
|
||||
}
|
||||
|
||||
|
||||
@ -87,6 +87,7 @@ export const store = new Vuex.Store({
|
||||
username: '',
|
||||
description: '',
|
||||
token: null,
|
||||
isAdmin: true, // TODO implement this properly
|
||||
coinanimation: true,
|
||||
newsletterState: null,
|
||||
community: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user