fix SMTP configuration
This commit is contained in:
@@ -4,26 +4,27 @@
|
|||||||
v-card-text
|
v-card-text
|
||||||
p(v-html="$t('admin.smtp_description')")
|
p(v-html="$t('admin.smtp_description')")
|
||||||
|
|
||||||
v-text-field(v-model='admin_email'
|
v-form(v-model='isValid')
|
||||||
:label="$t('admin.admin_email')"
|
v-text-field(v-model='admin_email'
|
||||||
:rules="$validators.email")
|
:label="$t('admin.admin_email')"
|
||||||
|
:rules="$validators.email")
|
||||||
|
|
||||||
v-text-field(v-model='smtp.host'
|
v-text-field(v-model='smtp.host'
|
||||||
:label="$t('admin.smtp_hostname')"
|
:label="$t('admin.smtp_hostname')"
|
||||||
:rules="[$validators.required('admin.smtp_hostname')]")
|
:rules="[$validators.required('admin.smtp_hostname')]")
|
||||||
|
|
||||||
v-text-field(v-model='smtp.auth.user'
|
v-text-field(v-model='smtp.auth.user'
|
||||||
:label="$t('common.user')"
|
:label="$t('common.user')"
|
||||||
:rules="[$validators.required('common.user')]")
|
:rules="[$validators.required('common.user')]")
|
||||||
|
|
||||||
v-text-field(v-model='smtp.auth.pass'
|
v-text-field(v-model='smtp.auth.pass'
|
||||||
:label="$t('common.password')"
|
:label="$t('common.password')"
|
||||||
:rules="[$validators.required('common.password')]"
|
:rules="[$validators.required('common.password')]"
|
||||||
type='password')
|
type='password')
|
||||||
|
|
||||||
v-card-actions
|
v-card-actions
|
||||||
v-spacer
|
v-spacer
|
||||||
v-btn(color='primary' @click='testSMTP' :loading='loading' :disabled='loading') {{$t('admin.smtp_test_button')}}
|
v-btn(color='primary' @click='testSMTP' :loading='loading' :disabled='loading || !isValid') {{$t('admin.smtp_test_button')}}
|
||||||
v-btn(color='warning' @click="done") {{$t("common.ok")}}
|
v-btn(color='warning' @click="done") {{$t("common.ok")}}
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
@@ -32,6 +33,7 @@ import { mapActions, mapState } from 'vuex'
|
|||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
isValid: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
smtp: { host: '', auth: {} }
|
smtp: { host: '', auth: {} }
|
||||||
}
|
}
|
||||||
@@ -44,9 +46,11 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.smtp.auth.user = this.settings.smtp.auth.user
|
if (this.settings.smtp && this.settings.smtp.auth) {
|
||||||
this.smtp.auth.pass = this.settings.smtp.auth.pass
|
this.smtp.auth.user = this.settings.smtp.auth.user
|
||||||
this.smtp.host = this.settings.smtp.host
|
this.smtp.auth.pass = this.settings.smtp.auth.pass
|
||||||
|
this.smtp.host = this.settings.smtp.host
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['setSetting']),
|
...mapActions(['setSetting']),
|
||||||
|
|||||||
@@ -48,20 +48,35 @@
|
|||||||
inset
|
inset
|
||||||
:label="$t('admin.recurrent_event_visible')")
|
:label="$t('admin.recurrent_event_visible')")
|
||||||
|
|
||||||
|
v-dialog(v-model='showSMTP' destroy-on-close max-width='700px')
|
||||||
|
SMTP(@close='showSMTP = false')
|
||||||
|
|
||||||
|
v-card-actions
|
||||||
|
v-btn(text @click='showSMTP=true') {{$t('admin.show_smtp_setup')}}
|
||||||
|
v-btn(text @click='$emit("complete")' color='primary' v-if='setup') {{$t('common.next')}}
|
||||||
|
v-icon mdi-arrow-right
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import SMTP from './SMTP.vue'
|
||||||
import { mapActions, mapState } from 'vuex'
|
import { mapActions, mapState } from 'vuex'
|
||||||
import moment from 'dayjs'
|
import moment from 'dayjs'
|
||||||
import tzNames from './tz.json'
|
import tzNames from './tz.json'
|
||||||
import locales from '../../locales/esm'
|
import locales from '../../locales/esm'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
props: {
|
||||||
|
setup: { type: Boolean, default: false }
|
||||||
|
},
|
||||||
|
components: { SMTP },
|
||||||
name: 'Settings',
|
name: 'Settings',
|
||||||
data ({ $store }) {
|
data ({ $store }) {
|
||||||
return {
|
return {
|
||||||
title: $store.state.settings.title,
|
title: $store.state.settings.title,
|
||||||
description: $store.state.settings.description,
|
description: $store.state.settings.description,
|
||||||
locales: Object.keys(locales).map(locale => ({ value: locale, text: locales[locale] }))
|
locales: Object.keys(locales).map(locale => ({ value: locale, text: locales[locale] })),
|
||||||
|
showSMTP: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
Reference in New Issue
Block a user