Show warning if a mailbox domain does not have incoming enabled
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
|
||||
import { ref, useTemplateRef } from 'vue';
|
||||
import { ref, useTemplateRef, computed } from 'vue';
|
||||
import { Dialog, Button, TextInput, FormGroup, Checkbox, InputGroup, SingleSelect } from '@cloudron/pankow';
|
||||
import { prettyDecimalSize } from '@cloudron/pankow/utils';
|
||||
import MailboxesModel from '../models/MailboxesModel.js';
|
||||
@@ -26,6 +26,11 @@ const active = ref(false);
|
||||
const enablePop3 = ref(false);
|
||||
const domainList = ref([]);
|
||||
|
||||
const domainHasIncomingEnabled = computed(() => {
|
||||
const selected = domainList.value.find(d => d.domain === domain.value);
|
||||
return selected ? selected.enabled : false;
|
||||
});
|
||||
|
||||
function onAddAlias() {
|
||||
aliases.value.push({
|
||||
name: '',
|
||||
@@ -103,6 +108,7 @@ defineExpose({
|
||||
return {
|
||||
domain: d.domain,
|
||||
label: '@' + d.domain,
|
||||
enabled: !!d.enabled,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -135,6 +141,7 @@ defineExpose({
|
||||
<TextInput id="nameInput" style="flex-grow: 1;" v-model="name"/>
|
||||
<SingleSelect v-model="domain" :options="domainList" option-key="domain" option-label="label" />
|
||||
</InputGroup>
|
||||
<div class="warning-label" v-if="!domainHasIncomingEnabled">{{ $t('email.addMailboxDialog.incomingDisabledWarning') }}</div>
|
||||
<div class="error-label" v-if="formError">{{ formError }}</div>
|
||||
</FormGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user