installation spinner; started launch page

v1.18.x
psychobunny 10 years ago
parent e9a92bd1bf
commit 8556ddd9a0

@ -62,7 +62,9 @@ function welcome(req, res) {
}); });
res.render('install/index', { res.render('install/index', {
databases: databases databases: databases,
error: res.locals.error ? true : false,
success: res.locals.success ? true : false
}); });
} }
@ -75,11 +77,19 @@ function install(req, res) {
} }
} }
require('child_process').fork('app', ['--setup'], { var child = require('child_process').fork('app', ['--setup'], {
env: env env: env
}); });
res.json({}); child.on('close', function(data) {
if (data === 0) {
res.locals.success = true;
} else {
res.locals.error = true;
}
welcome(req, res);
});
} }
function compileLess(callback) { function compileLess(callback) {

@ -37,6 +37,8 @@ $('document').ready(function() {
$('html, body').animate({'scrollTop': '0px'}, 400); $('html, body').animate({'scrollTop': '0px'}, 400);
return false; return false;
} else {
$('#submit .fa-spin').removeClass('hide');
} }
} }

@ -42,12 +42,12 @@
</div> </div>
</nav> </nav>
<div class="container"> <div class="container <!-- IF success -->hide<!-- ENDIF success -->">
<p> <p>
<h1>Welcome to the NodeBB Installer</h1> <h1>Welcome to the NodeBB Installer</h1>
You are just a few steps away from launching your own NodeBB forum! You are just a few steps away from launching your own NodeBB forum!
</p> </p>
<form action="/" method="post"> <form id="install" action="/" method="post">
<div class="admin"> <div class="admin">
<p> <p>
<h1><small>Create an Administrator account</small></h1> <h1><small>Create an Administrator account</small></h1>
@ -103,7 +103,7 @@
<div id="database-config"></div> <div id="database-config"></div>
</div> </div>
<button type="submit" class="btn btn-lg btn-success">Install NodeBB</button> <button id="submit" type="submit" class="btn btn-lg btn-success">Install NodeBB <i class="fa fa-spinner fa-spin hide"></i></button>
</form> </form>
</div> </div>

Loading…
Cancel
Save