From 799bb56431cf5ae5b8c98c20c514ef95bbb7dec1 Mon Sep 17 00:00:00 2001 From: MattIPv4 Date: Thu, 4 Jun 2020 15:07:35 +0100 Subject: [PATCH] Add duplicate domain warning --- .../en/templates/domain_sections/server.js | 2 ++ .../templates/domain_sections/server.vue | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/server.js b/src/nginxconfig/i18n/en/templates/domain_sections/server.js index 137b2ea..443220e 100644 --- a/src/nginxconfig/i18n/en/templates/domain_sections/server.js +++ b/src/nginxconfig/i18n/en/templates/domain_sections/server.js @@ -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', diff --git a/src/nginxconfig/templates/domain_sections/server.vue b/src/nginxconfig/templates/domain_sections/server.vue index 4eed3fe..c0b2917 100644 --- a/src/nginxconfig/templates/domain_sections/server.vue +++ b/src/nginxconfig/templates/domain_sections/server.vue @@ -49,6 +49,17 @@ THE SOFTWARE. + +
@@ -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) {