Skip to content

Commit

Permalink
Merge pull request #2016 from noobaa/ohad-frontend-dev
Browse files Browse the repository at this point in the history
Loader screen to be used when waiting for system_config
  • Loading branch information
nb-ohad authored Sep 22, 2016
2 parents 5aaebee + e4a24b4 commit 7b3d786
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="text-center">
<p class="heading1 push-next">Initializing Server...</p>

<svg-icon class="loading-icon icon-big spin"
params="name: 'in-progress'"></svg-icon>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import template from './loading-server-information-from.html';

export default {
template: template
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
loading-server-information-from {
display: block;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class LoginLayoutViewModel extends Disposable {

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

return;
}
);
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/components/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function register(ko) {
ko.components.register('create-system-form', require('./login/create-system-form/create-system-form'));
ko.components.register('unsupported-form', require('./login/unsupported-form/unsupported-form'));
ko.components.register('unable-to-activate-modal', require('./login/unable-to-activate-modal/unable-to-activate-modal'));
ko.components.register('loading-server-information-from', require('./login/loading-server-information-from/loading-server-information-from'));
/** INJECT:login **/

// -------------------------------
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/app/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,12 @@ export function deepFreeze(val) {
}
}

export function waitFor(miliseconds) {
export function waitFor(miliseconds, value) {
return new Promise(
resolve => setTimeout(resolve, miliseconds)
resolve => setTimeout(
() => resolve(value),
miliseconds
)
);
}

Expand Down

0 comments on commit 7b3d786

Please sign in to comment.