Add advanced settings to setupdns

This commit is contained in:
Girish Ramakrishnan
2018-05-15 15:46:24 -07:00
parent 1528aa9d0c
commit 267fa79164
3 changed files with 35 additions and 9 deletions

View File

@@ -3,7 +3,7 @@
/* global tld */
// create main application module
var app = angular.module('Application', ['angular-md5', 'ui-notification']);
var app = angular.module('Application', ['angular-md5', 'ui-notification', 'ui.bootstrap']);
app.filter('zoneName', function () {
return function (domain) {
@@ -19,12 +19,13 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f
$scope.provider = '';
$scope.showDNSSetup = false;
$scope.instanceId = '';
$scope.explicitZone = search.zone || '';
$scope.isDomain = false;
$scope.isSubdomain = false;
$scope.tlsConfig = {
provider: search.env === 'dev' ? 'letsencrypt-staging' : 'letsencrypt-prod'
};
$scope.tlsProvider = [
{ name: 'Let\'s Encrypt Prod', value: 'letsencrypt-prod' },
{ name: 'Let\'s Encrypt Staging', value: 'letsencrypt-staging' },
{ name: 'Self-Signed', value: 'fallback' },
];
// If we migrate the api origin we have to poll the new location
if (search.admin_fqdn) Client.apiOrigin = 'https://' + search.admin_fqdn;
@@ -58,6 +59,7 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f
$scope.dnsCredentials = {
error: null,
busy: false,
advancedVisible: false,
domain: '',
accessKeyId: '',
secretAccessKey: '',
@@ -70,7 +72,11 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f
godaddyApiSecret: '',
nameComUsername: '',
nameComToken: '',
provider: 'route53'
provider: 'route53',
zoneName: '',
tlsConfig: {
provider: 'letsencrypt-prod'
}
};
function readFileLocally(obj, file, fileName) {
@@ -143,7 +149,7 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f
data.token = $scope.dnsCredentials.nameComToken;
}
Client.setupDnsConfig($scope.dnsCredentials.domain, $scope.explicitZone, provider, data, $scope.tlsConfig, function (error) {
Client.setupDnsConfig($scope.dnsCredentials.domain, $scope.dnsCredentials.zoneName, provider, data, $scope.dnsCredentials.tlsConfig, function (error) {
if (error && error.statusCode === 403) {
$scope.dnsCredentials.busy = false;
$scope.error = 'Wrong instance id provided.';