Add: コントロールパネルにAllowedEmailDomainsを追加

This commit is contained in:
鴇峰 朔華 2024-11-25 20:08:59 +09:00
parent 8229e27128
commit 866cd43207

View File

@ -88,6 +88,19 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder>
<template #label>Allowed Email Domains</template>
<template v-if="allowedEmailDomainsForm.modified.value" #footer>
<MkFormFooter :form="allowedEmailDomainsForm"/>
</template>
<div class="_gaps_m">
<MkTextarea v-model="allowedEmailDomainsForm.state.allowedEmailDomains">
<template #label>Allowed Email Domains List</template>
</MkTextarea>
</div>
</MkFolder>
<MkFolder>
<template #label>Banned Email Domains</template>
<template v-if="bannedEmailDomainsForm.modified.value" #footer>
@ -193,6 +206,15 @@ const emailValidationForm = useForm({
fetchInstance(true);
});
const allowedEmailDomainsForm = useForm({
allowedEmailDomains: meta.allowedEmailDomains?.join('\n') || '',
}, async (state) => {
await os.apiWithDialog('admin/update-meta', {
allowedEmailDomains: state.allowedEmailDomains.split('\n'),
});
fetchInstance(true);
});
const bannedEmailDomainsForm = useForm({
bannedEmailDomains: meta.bannedEmailDomains?.join('\n') || '',
}, async (state) => {