Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/app/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ export function signOut(shouldRefresh = true) {
export function loadServerInfo() {
logAction('loadServerInfo');

model.serverInfo(null);
api.account.accounts_status()
.then(
reply => reply.has_accounts ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,3 @@ <h1 class="heading1">Welcome to NooBaa</h1>
</div>
</section>

<!-- ko if: isUnableToActivateModalVisible -->
<unable-to-activate-modal></unable-to-activate-modal>
<!-- /ko -->

Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
<svg-icon class="loading-icon icon-big spin"
params="name: 'in-progress'"></svg-icon>
</div>

<!-- ko if: isUnableToActivateModalVisible -->
<unable-to-activate-modal></unable-to-activate-modal>
<!-- /ko -->
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
import template from './loading-server-information-from.html';
import Disposable from 'disposable';
import ko from 'knockout';
import { serverInfo } from 'model';

class LoadingServerInformationFromViewModel extends Disposable{
constructor() {
super();

this.isUnableToActivateModalVisible = ko.pureComputed(
() => Boolean(
serverInfo() &&
serverInfo().config &&
serverInfo().config.phone_home_connectivity_status !== 'CONNECTED'
)
);
}
}

export default {
viewModel: LoadingServerInformationFromViewModel,
template: template
};
15 changes: 12 additions & 3 deletions frontend/src/app/components/login/login-layout/login-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,20 @@ class LoginLayoutViewModel extends Disposable {
return 'unsupported-form';
}

if (serverInfo()) {
return serverInfo().initialized ? 'signin-form' : 'create-system-form';
} else {
if (!serverInfo()) {
return 'loading-server-information-from';
}

let { initialized, config } = serverInfo();
if (initialized) {
return 'signin-form';
}

if (config.phone_home_connectivity_status !== 'CONNECTED') {
return 'loading-server-information-from';
} else {
return 'create-system-form';
}
}
);
}
Expand Down