diff --git a/dashboard/src/components/DomainDialog.vue b/dashboard/src/components/DomainDialog.vue index dc2715cee..5e3343afa 100644 --- a/dashboard/src/components/DomainDialog.vue +++ b/dashboard/src/components/DomainDialog.vue @@ -9,15 +9,6 @@ const emit = defineEmits([ 'success' ]); const domainsModel = DomainsModel.create(); - // currently, validation of wildcard with various provider is done server side - const tlsProviders = [ - { name: 'Let\'s Encrypt Prod', value: 'letsencrypt-prod' }, - { name: 'Let\'s Encrypt Prod - Wildcard', value: 'letsencrypt-prod-wildcard' }, - { name: 'Let\'s Encrypt Staging', value: 'letsencrypt-staging' }, - { name: 'Let\'s Encrypt Staging - Wildcard', value: 'letsencrypt-staging-wildcard' }, - { name: 'Custom Wildcard Certificate', value: 'fallback' }, -]; - const dialog = useTemplateRef('dialog'); const busy = ref(false); @@ -87,6 +78,9 @@ defineExpose({ customNameservers.value = d.config.customNameservers; dialog.value.open(); + + // ensure we trigger this once + setTimeout(checkValidity, 100); } }); @@ -97,10 +91,9 @@ defineExpose({ :title="editing ? $t('domains.domainDialog.editTitle', { domain: domain }) : $t('domains.domainDialog.addTitle')" :modal="busy" :confirm-busy="busy" - :confirm-active="isFormValid" + :confirm-active="!busy && isFormValid" :confirm-label="$t('main.dialog.save')" :reject-label="busy ? null : $t('main.dialog.cancel')" - :reject-active="!busy" reject-style="secondary" @confirm="onSubmit()" > @@ -109,6 +102,7 @@ defineExpose({
+

{{ error }}

diff --git a/dashboard/src/models/AppsModel.js b/dashboard/src/models/AppsModel.js index df8abe72b..e89a2f782 100644 --- a/dashboard/src/models/AppsModel.js +++ b/dashboard/src/models/AppsModel.js @@ -73,7 +73,6 @@ function appProgressMessage(app) { function create() { const accessToken = localStorage.token; - // TODO maybe we can share those globally let config = null; let profile = null; diff --git a/dashboard/src/models/DomainsModel.js b/dashboard/src/models/DomainsModel.js index 5bec29737..fa0a46bcb 100644 --- a/dashboard/src/models/DomainsModel.js +++ b/dashboard/src/models/DomainsModel.js @@ -5,7 +5,7 @@ import { API_ORIGIN } from '../constants.js'; function create() { const accessToken = localStorage.token; - return { + const exposed = { async list() { let error, result; try { @@ -57,10 +57,9 @@ function create() { if (error || result.status !== 204) return [error || result]; - // TODO is this still needed on update? a syncdns should also do this // this is done so that an out-of-sync dkim key can be synced - // [error] = await domainsModel.setDnsRecords({ domain: domain, type: 'mail' }); - // if (error) console.error(error); // not fatal for now + [error] = await exposed.setDnsRecords({ domain: domain, type: 'mail' }); + if (error) console.error(error); // not fatal for now return [null]; }, @@ -121,6 +120,8 @@ function create() { return [null, result.body]; }, }; + + return exposed; } export default {