2019-05-28 17:29:15 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
2019-06-24 00:29:14 +02:00
|
|
|
<nav class="navbar is-black level is-mobile has-text-grey-lighter">
|
|
|
|
<div class="level-left">
|
2020-01-06 16:58:31 +01:00
|
|
|
<router-link :to="{ name: 'accounts' }" class="is-size-4 has-text-weight-light">2FAccount</router-link>
|
2019-06-24 00:29:14 +02:00
|
|
|
</div>
|
|
|
|
<div class="level-right">
|
2020-01-06 10:10:18 +01:00
|
|
|
<p class="level-item" v-if="isLoggedIn">
|
2019-12-21 23:23:44 +01:00
|
|
|
<router-link :to="{ name: 'create' }" class="button is-black">
|
2019-06-24 00:29:14 +02:00
|
|
|
<span class="icon has-text-grey-light">
|
|
|
|
<font-awesome-icon :icon="['fas', 'plus-circle']" />
|
|
|
|
</span>
|
2019-12-21 23:23:44 +01:00
|
|
|
</router-link>
|
2019-06-24 00:29:14 +02:00
|
|
|
</p>
|
|
|
|
<p class="level-item" v-if="!isLoggedIn">
|
|
|
|
<router-link :to="{ name: 'login' }" class="button is-black">
|
2020-01-06 16:58:31 +01:00
|
|
|
Sign in
|
|
|
|
</router-link>
|
|
|
|
</p>
|
|
|
|
<p class="level-item" v-else>
|
|
|
|
<router-link :to="{ name: 'sign out' }" class="button is-black">
|
|
|
|
Sign out
|
2019-06-24 00:29:14 +02:00
|
|
|
</router-link>
|
|
|
|
</p>
|
|
|
|
<p class="level-item" v-if="!isLoggedIn">
|
|
|
|
<router-link :to="{ name: 'register' }" class="button is-black">
|
|
|
|
Register
|
|
|
|
</router-link>
|
|
|
|
</p>
|
|
|
|
<p class="level-item" v-if="isLoggedIn">
|
|
|
|
Hi, {{username}}
|
|
|
|
</p>
|
2019-05-28 17:29:15 +02:00
|
|
|
</div>
|
|
|
|
</nav>
|
2019-06-24 00:29:14 +02:00
|
|
|
|
2019-05-28 17:29:15 +02:00
|
|
|
<main class="py-4">
|
|
|
|
<router-view></router-view>
|
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2019-06-24 00:29:14 +02:00
|
|
|
name: 'App',
|
2019-05-28 17:29:15 +02:00
|
|
|
data(){
|
|
|
|
return {
|
|
|
|
isLoggedIn : null,
|
2019-06-24 00:29:14 +02:00
|
|
|
username : null
|
2019-05-28 17:29:15 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted(){
|
|
|
|
this.isLoggedIn = localStorage.getItem('jwt')
|
2019-06-24 00:29:14 +02:00
|
|
|
this.username = localStorage.getItem('user')
|
2019-05-28 17:29:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|