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', {
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
});
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) {

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

@ -42,18 +42,18 @@
</div>
</nav>
<div class="container">
<div class="container <!-- IF success -->hide<!-- ENDIF success -->">
<p>
<h1>Welcome to the NodeBB Installer</h1>
You are just a few steps away from launching your own NodeBB forum!
</p>
<form action="/" method="post">
<form id="install" action="/" method="post">
<div class="admin">
<p>
<h1><small>Create an Administrator account</small></h1>
<hr />
</p>
<div class="row input-row">
<div class="col-sm-7 col-xs-12 input-field">
<label for="admin:username">Username</label>
@ -103,7 +103,7 @@
<div id="database-config"></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>
</div>

Loading…
Cancel
Save