Always remind the user that the DNS zone has to be hosted on the provider
Do not use $location as the search() object is not consistent without the angular router, which is not used here
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
// create main application module
|
||||
var app = angular.module('Application', ['angular-md5', 'ui-notification', 'ngTld']);
|
||||
var app = angular.module('Application', ['angular-md5', 'ui-notification']);
|
||||
|
||||
app.controller('SetupDNSController', ['$scope', '$http', 'Client', 'ngTld', '$location', function ($scope, $http, Client, ngTld, $location) {
|
||||
app.filter('zoneName', function () {
|
||||
return function (domain) {
|
||||
return tld.getDomain(domain);
|
||||
};
|
||||
});
|
||||
|
||||
app.controller('SetupDNSController', ['$scope', '$http', 'Client', function ($scope, $http, Client) {
|
||||
var search = decodeURIComponent(window.location.search).slice(1).split('&').map(function (item) { return item.split('='); }).reduce(function (o, k) { o[k[0]] = k[1]; return o; }, {});
|
||||
|
||||
$scope.initialized = false;
|
||||
@@ -12,6 +18,7 @@ app.controller('SetupDNSController', ['$scope', '$http', 'Client', 'ngTld', '$lo
|
||||
$scope.provider = '';
|
||||
$scope.showDNSSetup = false;
|
||||
$scope.instanceId = '';
|
||||
$scope.explicitZone = search.zone || '';
|
||||
|
||||
// keep in sync with certs.js
|
||||
$scope.dnsProvider = [
|
||||
@@ -38,7 +45,7 @@ app.controller('SetupDNSController', ['$scope', '$http', 'Client', 'ngTld', '$lo
|
||||
|
||||
var data = {
|
||||
domain: $scope.dnsCredentials.domain,
|
||||
zoneName: $location.search().zone || '',
|
||||
zoneName: $scope.explicitZone,
|
||||
provider: $scope.dnsCredentials.provider,
|
||||
accessKeyId: $scope.dnsCredentials.accessKeyId,
|
||||
secretAccessKey: $scope.dnsCredentials.secretAccessKey,
|
||||
|
||||
Reference in New Issue
Block a user