mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-08-08 17:30:06 +08:00
Add duplicate domain warning
This commit is contained in:
@@ -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',
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user