Show hint about subdomain cloudrons in dns setup

This commit is contained in:
Johannes Zellner
2017-06-20 11:42:01 +02:00
parent e6eda1283c
commit 801d848908
2 changed files with 20 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
'use strict';
/* global tld */
// create main application module
var app = angular.module('Application', ['angular-md5', 'ui-notification']);
@@ -19,6 +21,21 @@ app.controller('SetupDNSController', ['$scope', '$http', 'Client', function ($sc
$scope.showDNSSetup = false;
$scope.instanceId = '';
$scope.explicitZone = search.zone || '';
$scope.isDomain = false;
$scope.isSubdomain = false;
$scope.$watch('dnsCredentials.domain', function (newVal) {
if (!newVal) {
$scope.isDomain = false;
$scope.isSubdomain = false;
} else if (!tld.getDomain(newVal) || newVal[newVal.length-1] === '.') {
$scope.isDomain = false;
$scope.isSubdomain = false;
} else {
$scope.isDomain = true;
$scope.isSubdomain = tld.getDomain(newVal) !== newVal;
}
});
// keep in sync with certs.js
$scope.dnsProvider = [

View File

@@ -58,6 +58,7 @@
<div class="form-group" style="margin-bottom: 0;" ng-class="{ 'has-error': dnsCredentialsForm.domain.$dirty && dnsCredentialsForm.domain.$invalid }">
<input type="text" class="form-control" ng-model="dnsCredentials.domain" name="domain" placeholder="example.com" required autofocus ng-disabled="dnsCredentials.busy">
</div>
<p ng-show="isSubdomain" class="text-bold">Cloudrons on subdomains is only supported in enterprise version.</p>
</div>
</div>
<div class="row">
@@ -76,14 +77,14 @@
<div class="form-group" ng-class="{ 'has-error': dnsCredentialsForm.secretAccessKey.$dirty && dnsCredentialsForm.secretAccessKey.$invalid }" ng-show="dnsCredentials.provider === 'route53'">
<input type="text" class="form-control" ng-model="dnsCredentials.secretAccessKey" name="secretAccessKey" placeholder="Secret Access Key" ng-required="dnsCredentials.provider === 'route53'" ng-disabled="dnsCredentials.busy">
<br/>
<span ng-show="dnsCredentials.domain || explicitZone"><b>{{ (explicitZone ? explicitZone : dnsCredentials.domain) | zoneName }}</b> must be hosted on <a href="https://aws.amazon.com/route53/?nc2=h_m1" target="_blank">AWS Route53</a>.</span>
<span ng-show="isDomain || explicitZone"><b>{{ (explicitZone ? explicitZone : dnsCredentials.domain) | zoneName }}</b> must be hosted on <a href="https://aws.amazon.com/route53/?nc2=h_m1" target="_blank">AWS Route53</a>.</span>
</div>
<!-- DigitalOcean -->
<div class="form-group" ng-class="{ 'has-error': dnsCredentialsForm.digitalOceanToken.$dirty && dnsCredentialsForm.digitalOceanToken.$invalid }" ng-show="dnsCredentials.provider === 'digitalocean'">
<input type="text" class="form-control" ng-model="dnsCredentials.digitalOceanToken" name="digitalOceanToken" placeholder="API Token" ng-required="dnsCredentials.provider === 'digitalocean'" ng-disabled="dnsCredentials.busy">
<br/>
<span ng-show="dnsCredentials.domain || explicitZone"><b>{{ (explicitZone ? explicitZone : dnsCredentials.domain) | zoneName }}</b> must be hosted on <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-a-host-name-with-digitalocean#step-two%E2%80%94change-your-domain-server" target="_blank">DigitalOcean</a>.</span>
<span ng-show="isDomain || explicitZone"><b>{{ (explicitZone ? explicitZone : dnsCredentials.domain) | zoneName }}</b> must be hosted on <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-a-host-name-with-digitalocean#step-two%E2%80%94change-your-domain-server" target="_blank">DigitalOcean</a>.</span>
</div>
<!-- Wildcard -->