From 8556ddd9a08a45add1b65caa4b568a2e97db27e7 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 22 Apr 2015 14:39:37 -0400 Subject: [PATCH] installation spinner; started launch page --- install/web.js | 16 +++++++++++++--- public/src/installer/install.js | 2 ++ src/views/install/index.tpl | 8 ++++---- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/install/web.js b/install/web.js index d1bfa2a1c5..4ccce7efdb 100644 --- a/install/web.js +++ b/install/web.js @@ -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) { diff --git a/public/src/installer/install.js b/public/src/installer/install.js index c21d62a459..7739f228ed 100644 --- a/public/src/installer/install.js +++ b/public/src/installer/install.js @@ -37,6 +37,8 @@ $('document').ready(function() { $('html, body').animate({'scrollTop': '0px'}, 400); return false; + } else { + $('#submit .fa-spin').removeClass('hide'); } } diff --git a/src/views/install/index.tpl b/src/views/install/index.tpl index 5bf430e290..3fbff54144 100644 --- a/src/views/install/index.tpl +++ b/src/views/install/index.tpl @@ -42,18 +42,18 @@ -
+

Welcome to the NodeBB Installer

You are just a few steps away from launching your own NodeBB forum!

-
+

Create an Administrator account


- +
@@ -103,7 +103,7 @@
- +