Add duplicate domain warning

pull/148/head
MattIPv4 2020-06-04 15:07:35 +01:00
parent bc04209423
commit 799bb56431
2 changed files with 20 additions and 1 deletions

View File

@ -28,6 +28,8 @@ export default {
domain: 'Domain',
path: 'Path',
documentRoot: 'Document root',
oneOrMoreOtherDomainsAreAlsoNamed: 'One or more other domains are also named',
thisWillCauseIssuesWithConfigGeneration: 'This will cause issues with config generation.',
wwwSubdomain: 'www subdomain',
cdnSubdomain: 'CDN subdomain',
redirectSubdomains: 'Redirect subdomains',

View File

@ -49,6 +49,17 @@ THE SOFTWARE.
</div>
</div>
<template v-if="duplicateDomain">
<br />
<div class="message is-warning">
<div class="message-body">
{{ i18n.templates.domainSections.server.oneOrMoreOtherDomainsAreAlsoNamed }}
<code class="slim">{{ $props.data.domain.computed }}</code>.
{{ i18n.templates.domainSections.server.thisWillCauseIssuesWithConfigGeneration }}
</div>
</div>
</template>
<div class="field is-horizontal">
<div class="field-label">
<label class="label">{{ i18n.templates.domainSections.server.wwwSubdomain }}</label>
@ -192,7 +203,13 @@ THE SOFTWARE.
i18n,
};
},
computed: computedFromDefaults(defaults, 'server'), // Getters & setters for the delegated data
computed: {
...computedFromDefaults(defaults, 'server'), // Getters & setters for the delegated data
duplicateDomain() {
return this.$parent.$parent.$data.domains
.filter(d => d && d.server.domain.computed === this.$props.data.domain.computed).length > 1;
},
},
watch: {
'$props.data.domain': {
handler(data) {