installer: database error messages

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

@ -9,7 +9,8 @@ var winston = require('winston'),
async = require('async'),
uglify = require('uglify-js'),
nconf = require('nconf'),
app = express();
app = express(),
server;
var web = {},
scripts = [
@ -39,7 +40,7 @@ web.install = function(port) {
function launchExpress(port) {
var server = app.listen(port, function() {
server = app.listen(port, function() {
var host = server.address().address;
winston.info('Web installer listening on http://%s:%s', host, port);
});
@ -48,6 +49,7 @@ function launchExpress(port) {
function setupRoutes() {
app.get('/', welcome);
app.post('/', install);
app.post('/launch', launch);
}
function welcome(req, res) {
@ -92,6 +94,10 @@ function install(req, res) {
});
}
function launch(req, res) {
}
function compileLess(callback) {
if ((nconf.get('from-file') || '').indexOf('less') !== -1) {
winston.info('LESS compilation skipped');

@ -25,6 +25,13 @@ $('document').ready(function() {
$('form').submit(validateAll);
activate('database', $('[name="database"]'));
if ($('#database-error').length) {
$('[name="database"]').parents('.input-row').addClass('error');
$('html, body').animate({
scrollTop: ($('#database-error').offset().top + 100) + 'px'
}, 400);
}
}
function validateAll(ev) {

@ -84,6 +84,10 @@
</div>
</div>
<!-- IF error -->
<a id="database-error"></a>
<!-- ENDIF error -->
<div class="database">
<p>
<h1><small>Configure your database</small></h1>
@ -98,6 +102,7 @@
<option value="mongo">MongoDB</option>
</select>
</div>
<!-- IF error --><div class="col-sm-5 help-text">There was an error connecting to your database. Please try again.</div><!-- ENDIF error -->
</div>
<div id="database-config"></div>
@ -107,6 +112,15 @@
</form>
</div>
<div class="container <!-- IF !success -->hide<!-- ENDIF !success -->">
<p>
<h1>Congratulations! Your NodeBB has been set-up.</h1>
<button id="launch" class="btn btn-lg btn-success">Launch NodeBB <i class="fa fa-spinner fa-spin hide"></i></button>
</p>
</div>
<div class="hide">
<!-- BEGIN databases -->
<div data-database="{databases.name}">

Loading…
Cancel
Save