1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
<template>
<Content app-name="mail">
<Navigation v-if="hasAccounts" />
<AppContent>
<div class="mail-empty-content">
<EmptyContent :title="t('mail', 'Connect your mail account')">
<template #icon>
<IconMail :size="65" />
</template>
<template #action>
<AccountForm :display-name="displayName"
:email="email"
:error.sync="error"
@account-created="onAccountCreated" />
</template>
</EmptyContent>
</div>
</AppContent>
</Content>
</template>
<script>
import { NcContent as Content, NcAppContent as AppContent, NcEmptyContent as EmptyContent } from '@nextcloud/vue'
import { loadState } from '@nextcloud/initial-state'
import AccountForm from '../components/AccountForm'
import IconMail from 'vue-material-design-icons/Email'
import Navigation from '../components/Navigation'
import logger from '../logger'
export default {
name: 'Setup',
components: {
AppContent,
AccountForm,
Content,
EmptyContent,
IconMail,
Navigation,
},
data() {
return {
displayName: loadState('mail', 'prefill_displayName'),
email: loadState('mail', 'prefill_email'),
error: null,
}
},
computed: {
hasAccounts() {
return this.$store.getters.accounts.length > 1
},
},
methods: {
onAccountCreated() {
logger.info('account successfully created, redirecting …')
this.$router.push({
name: 'home',
})
},
},
}
</script>
<style>
.mail-empty-content {
margin: 0 auto;
}
</style>
|