Add initial placeholder page for email domains list
This commit is contained in:
@@ -5,7 +5,7 @@ const i18n = useI18n();
|
||||
const t = i18n.t;
|
||||
|
||||
import { ref, onMounted, useTemplateRef, inject } from 'vue';
|
||||
import { Button, Checkbox, InputDialog, Dialog, FormGroup, Switch, SingleSelect } from '@cloudron/pankow';
|
||||
import { Button, Checkbox, InputDialog, Dialog, FormGroup, Switch } from '@cloudron/pankow';
|
||||
import { prettyDecimalSize, sleep } from '@cloudron/pankow/utils';
|
||||
import Section from '../components/Section.vue';
|
||||
import SettingsItem from '../components/SettingsItem.vue';
|
||||
@@ -26,7 +26,6 @@ const features = inject('features');
|
||||
const inputDialog = useTemplateRef('inputDialog');
|
||||
const enableIncomingDialog = useTemplateRef('enableIncomingDialog');
|
||||
const connectionDialog = useTemplateRef('connectionDialog');
|
||||
const domains = ref([]);
|
||||
const domain = ref('');
|
||||
const domainProvider = ref('');
|
||||
const mailConfig = ref({});
|
||||
@@ -208,6 +207,14 @@ async function onDomainChanged() {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const tmp = window.location.hash.slice('#/email-domain/'.length);
|
||||
if (!tmp) return;
|
||||
|
||||
const parts = tmp.split('/');
|
||||
if (parts.length !== 1) return;
|
||||
|
||||
domain.value = parts[0];
|
||||
|
||||
let [error, result] = await dashboardModel.config();
|
||||
if (error) return console.error(error);
|
||||
|
||||
@@ -221,9 +228,6 @@ onMounted(async () => {
|
||||
[error, result] = await domainsModel.list();
|
||||
if (error) return console.error(error);
|
||||
|
||||
domains.value = result;
|
||||
domain.value = domains.value[0].domain;
|
||||
|
||||
await onDomainChanged();
|
||||
});
|
||||
|
||||
@@ -298,7 +302,6 @@ onMounted(async () => {
|
||||
|
||||
<Section :title="$t('email.config.title', { domain: domain })">
|
||||
<template #header-buttons>
|
||||
<SingleSelect v-if="domains.length" v-model="domain" :options="domains" option-key="domain" option-label="domain" @select="onDomainChanged"/>
|
||||
<Button secondary tool icon="fa-solid fa-book" v-tooltip="$t('app.docsActionTooltip')" :menu="infoMenu" />
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user