From 75b60a2949ec8c76fd234c5cd7995cfe0b83d5c8 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 23 Jan 2017 12:22:02 -0800 Subject: [PATCH] Make restore work without a domain Fixes #195 --- webadmin/src/js/main.js | 3 ++- webadmin/src/js/setup.js | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/webadmin/src/js/main.js b/webadmin/src/js/main.js index 546339735..b170408a0 100644 --- a/webadmin/src/js/main.js +++ b/webadmin/src/js/main.js @@ -103,7 +103,8 @@ angular.module('Application').controller('MainController', ['$scope', '$route', Client.getStatus(function (error, status) { if (error) return $scope.error(error); - if (!status.activated) { + if (!status.adminFqdn) { + console.log('You have on domain, redirecting', status.configState.configured); window.location.href = status.configState.configured ? '/setup.html' : '/setupdns.html'; return; } diff --git a/webadmin/src/js/setup.js b/webadmin/src/js/setup.js index 03fecc308..18fa81932 100644 --- a/webadmin/src/js/setup.js +++ b/webadmin/src/js/setup.js @@ -66,17 +66,17 @@ app.controller('SetupController', ['$scope', '$http', 'Client', function ($scope return; } - if (status.activated) { - window.location.href = '/'; - return; - } - // if we don't have a domain yet, first go to domain setup if (!status.adminFqdn) { window.location.href = '/setupdns.html'; return; } + if (status.activated) { + window.location.href = '/'; + return; + } + if (status.provider === 'caas') { if (!search.setupToken) { window.location.href = '/error.html?errorCode=2';