Give more info in dns setup what is happening with the domain
This commit is contained in:
@@ -12,56 +12,40 @@ app.controller('SetupController', ['$scope', 'Client', function ($scope, Client)
|
||||
|
||||
$scope.client = Client;
|
||||
$scope.view = '';
|
||||
$scope.busy = true;
|
||||
$scope.account = {
|
||||
email: '',
|
||||
displayName: '',
|
||||
requireEmail: true,
|
||||
username: '',
|
||||
password: ''
|
||||
};
|
||||
$scope.error = null;
|
||||
$scope.initialized = false;
|
||||
$scope.apiServerOrigin = '';
|
||||
$scope.webServerOrigin = '';
|
||||
|
||||
$scope.activateCloudron = function () {
|
||||
$scope.busy = true;
|
||||
$scope.error = null;
|
||||
|
||||
Client.createAdmin($scope.account.username, $scope.account.password, $scope.account.email, $scope.account.displayName, function (error) {
|
||||
if (error && error.statusCode === 400) {
|
||||
$scope.busy = false;
|
||||
$scope.error = { username: error.message };
|
||||
$scope.account.username = '';
|
||||
$scope.ownerForm.username.$setPristine();
|
||||
setTimeout(function () { $('#inputUsername').focus(); }, 200);
|
||||
return;
|
||||
} else if (error) {
|
||||
$scope.busy = false;
|
||||
console.error('Internal error', error);
|
||||
$scope.error = { generic: error.message };
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = '/';
|
||||
});
|
||||
};
|
||||
|
||||
$scope.email = {
|
||||
$scope.owner = {
|
||||
error: null,
|
||||
busy: false,
|
||||
|
||||
submit: function () {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
$scope.invite = {
|
||||
error: null,
|
||||
busy: false,
|
||||
email: '',
|
||||
displayName: '',
|
||||
username: '',
|
||||
password: '',
|
||||
|
||||
submit: function () {
|
||||
$scope.owner.busy = true;
|
||||
$scope.owner.error = null;
|
||||
|
||||
Client.createAdmin($scope.owner.username, $scope.owner.password, $scope.owner.email, $scope.owner.displayName, function (error) {
|
||||
if (error && error.statusCode === 400) {
|
||||
$scope.owner.busy = false;
|
||||
$scope.owner.error = { username: error.message };
|
||||
$scope.owner.username = '';
|
||||
$scope.ownerForm.username.$setPristine();
|
||||
setTimeout(function () { $('#inputUsername').focus(); }, 200);
|
||||
return;
|
||||
} else if (error) {
|
||||
$scope.owner.busy = false;
|
||||
console.error('Internal error', error);
|
||||
$scope.owner.error = { generic: error.message };
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = '/';
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -90,11 +74,12 @@ app.controller('SetupController', ['$scope', 'Client', function ($scope, Client)
|
||||
}
|
||||
}
|
||||
|
||||
function setView() {
|
||||
if (search.view === 'owner') $scope.view = 'owner';
|
||||
else if (search.view === 'email') $scope.view = 'email';
|
||||
else if (search.view === 'invite') $scope.view = 'invite';
|
||||
else $scope.view = 'owner';
|
||||
function setView(view) {
|
||||
if (view === 'finished') {
|
||||
$scope.view = 'finished';
|
||||
} else {
|
||||
$scope.view = 'owner';
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
@@ -102,12 +87,12 @@ app.controller('SetupController', ['$scope', 'Client', function ($scope, Client)
|
||||
if (error) return Client.initError(error, init);
|
||||
|
||||
redirectIfNeeded(status);
|
||||
setView();
|
||||
setView(search.view);
|
||||
|
||||
$scope.apiServerOrigin = status.apiServerOrigin;
|
||||
$scope.webServerOrigin = status.webServerOrigin;
|
||||
|
||||
$scope.busy = false;
|
||||
$scope.initialized = true;
|
||||
|
||||
// Ensure we have a good autofocus
|
||||
setTimeout(function () {
|
||||
|
||||
Reference in New Issue
Block a user