frontend/src/components/Home.vue

36 lines
681 B
Vue
Raw Normal View History

2018-09-06 17:46:38 +00:00
<template>
2018-09-09 14:22:02 +00:00
<div class="content has-text-centered">
<h2>Hi {{user.infos.username}}!</h2>
<p>Click on a list or namespace on the left to get started.</p>
<TaskOverview :show-all="true"/>
2018-09-06 17:46:38 +00:00
</div>
</template>
<script>
import auth from '../auth'
import router from '../router'
2018-09-06 17:46:38 +00:00
export default {
name: "Home",
data() {
return {
user: auth.user,
2018-11-06 14:54:25 +00:00
loading: false,
currentDate: new Date(),
2018-11-06 14:54:25 +00:00
tasks: []
}
},
beforeMount() {
// Check if the user is already logged in, if so, redirect him to the homepage
2018-11-01 21:34:29 +00:00
if (!auth.user.authenticated) {
router.push({name: 'login'})
}
},
methods: {
logout() {
auth.logout()
},
},
}
2018-09-06 17:46:38 +00:00
</script>