2018-09-06 19:46:38 +02:00
|
|
|
<template>
|
2018-09-09 16:22:02 +02:00
|
|
|
<div class="content has-text-centered">
|
2020-05-08 20:43:51 +02:00
|
|
|
<h2>Hi {{userInfo.username}}!</h2>
|
2018-09-09 16:22:02 +02:00
|
|
|
<p>Click on a list or namespace on the left to get started.</p>
|
2020-05-08 20:43:51 +02:00
|
|
|
<router-link
|
|
|
|
class="button is-primary is-right noshadow is-outlined"
|
|
|
|
:to="{name: 'migrateStart'}"
|
|
|
|
v-if="migratorsEnabled"
|
|
|
|
>
|
|
|
|
Import your data into Vikunja
|
|
|
|
</router-link>
|
2018-12-25 23:41:55 +01:00
|
|
|
<TaskOverview :show-all="true"/>
|
2018-09-06 19:46:38 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-03-02 11:25:10 +01:00
|
|
|
import router from '../router'
|
2020-05-08 20:43:51 +02:00
|
|
|
import {mapState} from 'vuex'
|
2018-09-06 19:46:38 +02:00
|
|
|
|
2019-03-02 11:25:10 +01:00
|
|
|
export default {
|
|
|
|
name: "Home",
|
|
|
|
data() {
|
|
|
|
return {
|
2018-11-06 15:54:25 +01:00
|
|
|
loading: false,
|
2018-12-25 23:41:55 +01:00
|
|
|
currentDate: new Date(),
|
2018-11-06 15:54:25 +01:00
|
|
|
tasks: []
|
2019-03-02 11:25:10 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
beforeMount() {
|
|
|
|
// Check if the user is already logged in, if so, redirect him to the homepage
|
2020-05-08 20:43:51 +02:00
|
|
|
if (!this.authenticated) {
|
2019-03-02 11:25:10 +01:00
|
|
|
router.push({name: 'login'})
|
|
|
|
}
|
|
|
|
},
|
2020-05-08 20:43:51 +02:00
|
|
|
computed: mapState({
|
|
|
|
migratorsEnabled: state => state.config.availableMigrators !== null && state.config.availableMigrators.length > 0,
|
|
|
|
authenticated: state => state.auth.authenticated,
|
|
|
|
userInfo: state => state.auth.info,
|
|
|
|
}),
|
2019-03-02 11:25:10 +01:00
|
|
|
}
|
2018-09-06 19:46:38 +02:00
|
|
|
</script>
|