File tree Expand file tree Collapse file tree 5 files changed +35
-7
lines changed
loading-server-information-from Expand file tree Collapse file tree 5 files changed +35
-7
lines changed Original file line number Diff line number Diff line change @@ -371,6 +371,7 @@ export function signOut(shouldRefresh = true) {
371371export function loadServerInfo ( ) {
372372 logAction ( 'loadServerInfo' ) ;
373373
374+ model . serverInfo ( null ) ;
374375 api . account . accounts_status ( )
375376 . then (
376377 reply => reply . has_accounts ?
Original file line number Diff line number Diff line change @@ -85,7 +85,3 @@ <h1 class="heading1">Welcome to NooBaa</h1>
8585 </ div >
8686</ section >
8787
88- <!-- ko if: isUnableToActivateModalVisible -->
89- < unable-to-activate-modal > </ unable-to-activate-modal >
90- <!-- /ko -->
91-
Original file line number Diff line number Diff line change 44 < svg-icon class ="loading-icon icon-big spin "
55 params ="name: 'in-progress' "> </ svg-icon >
66</ div >
7+
8+ <!-- ko if: isUnableToActivateModalVisible -->
9+ < unable-to-activate-modal > </ unable-to-activate-modal >
10+ <!-- /ko -->
Original file line number Diff line number Diff line change 11import template from './loading-server-information-from.html' ;
2+ import Disposable from 'disposable' ;
3+ import ko from 'knockout' ;
4+ import { serverInfo } from 'model' ;
5+
6+ class LoadingServerInformationFromViewModel extends Disposable {
7+ constructor ( ) {
8+ super ( ) ;
9+
10+ this . isUnableToActivateModalVisible = ko . pureComputed (
11+ ( ) => Boolean (
12+ serverInfo ( ) &&
13+ serverInfo ( ) . config &&
14+ serverInfo ( ) . config . phone_home_connectivity_status !== 'CONNECTED'
15+ )
16+ ) ;
17+ }
18+ }
219
320export default {
21+ viewModel : LoadingServerInformationFromViewModel ,
422 template : template
523} ;
Original file line number Diff line number Diff line change @@ -15,11 +15,20 @@ class LoginLayoutViewModel extends Disposable {
1515 return 'unsupported-form' ;
1616 }
1717
18- if ( serverInfo ( ) ) {
19- return serverInfo ( ) . initialized ? 'signin-form' : 'create-system-form' ;
20- } else {
18+ if ( ! serverInfo ( ) ) {
2119 return 'loading-server-information-from' ;
2220 }
21+
22+ let { initialized, config } = serverInfo ( ) ;
23+ if ( initialized ) {
24+ return 'signin-form' ;
25+ }
26+
27+ if ( config . phone_home_connectivity_status !== 'CONNECTED' ) {
28+ return 'loading-server-information-from' ;
29+ } else {
30+ return 'create-system-form' ;
31+ }
2332 }
2433 ) ;
2534 }
You can’t perform that action at this time.
0 commit comments