diff --git a/src/js/setup.js b/src/js/setup.js index df0f11cc3..d21845b15 100644 --- a/src/js/setup.js +++ b/src/js/setup.js @@ -11,8 +11,8 @@ app.controller('SetupController', ['$scope', 'Client', function ($scope, 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.client = Client; - $scope.initialized = false; - $scope.busy = false; + $scope.view = ''; + $scope.busy = true; $scope.account = { email: '', displayName: '', @@ -33,7 +33,7 @@ app.controller('SetupController', ['$scope', 'Client', function ($scope, Client) $scope.busy = false; $scope.error = { username: error.message }; $scope.account.username = ''; - $scope.setupForm.username.$setPristine(); + $scope.ownerForm.username.$setPristine(); setTimeout(function () { $('#inputUsername').focus(); }, 200); return; } else if (error) { @@ -47,6 +47,24 @@ app.controller('SetupController', ['$scope', 'Client', function ($scope, Client) }); }; + $scope.email = { + error: null, + busy: false, + + submit: function () { + + } + }; + + $scope.invite = { + error: null, + busy: false, + + submit: function () { + + } + }; + function redirectIfNeeded(status) { if ('develop' in search || localStorage.getItem('develop')) { console.warn('Cloudron develop mode on. To disable run localStorage.removeItem(\'develop\')'); @@ -72,16 +90,24 @@ 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 init() { Client.getStatus(function (error, status) { if (error) return Client.initError(error, init); redirectIfNeeded(status); + setView(); $scope.apiServerOrigin = status.apiServerOrigin; $scope.webServerOrigin = status.webServerOrigin; - $scope.initialized = true; + $scope.busy = false; // Ensure we have a good autofocus setTimeout(function () { diff --git a/src/setup.html b/src/setup.html index d65089d25..38b2bbf53 100644 --- a/src/setup.html +++ b/src/setup.html @@ -4,7 +4,7 @@ - Cloudron Admin Setup + Cloudron Setup @@ -40,70 +40,119 @@ - Cloudron is offline. Reconnecting... + Cloudron is offline. Reconnecting... -
-
-
- -
-
+
+ +
+
+ +
-
-
-
-
-
-
-
-

Welcome to Cloudron

-

Setup Admin Account

-
-
-
-
-
-
-
- - -
-
- - -
-
- -

{{ error.username }}

- -
-
- - -
- Password must be atleast 8 characters -
-
-
-
-
-
-
-
- -
-
-
+
+
+
+
+
+
+

Welcome to Cloudron

+

Setup Owner Account

+
+
+
+
+
+
+
+ +
+
+ + +
+
+ +

{{ error.username }}

+ +
+
+ + +
+ Password must be atleast 8 characters +
+
+
+
+
+
+
+ +
+
+
+
- +
+
+
+
+
+
+

Welcome to Cloudron

+

Setup Email Sending

+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+

Welcome to Cloudron

+

Invite your first Users

+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+ +