diff --git a/src/backup/restore.js b/src/backup/restore.js index 0f0905021..e01ad3a8d 100644 --- a/src/backup/restore.js +++ b/src/backup/restore.js @@ -79,7 +79,11 @@ function runRestore(file, callback) { var platform = os.platform(); winston.info('Starting Restore... (' + platform + ')'); - var options = ['--uri', CONNECTION_URI, '-d', databaseName, path.join(__dirname, '../../restores/restore_' + file, 'database/trudesk')]; + var dbName = fs.readdirSync(path.join(__dirname, '../../restores/restore_' + file, 'database'))[0]; + if (!dbName) + return callback(new Error('Invalid Backup. Unable to get DBName')); + + var options = ['--uri', CONNECTION_URI, '-d', databaseName, path.join(__dirname, '../../restores/restore_' + file, 'database', dbName)]; var mongodump = null; if (platform === 'win32') mongodump = spawn(path.join(__dirname, 'bin', platform, 'mongorestore'), options); diff --git a/src/controllers/install.js b/src/controllers/install.js index 8a447ccc0..dfd06754d 100644 --- a/src/controllers/install.js +++ b/src/controllers/install.js @@ -16,6 +16,7 @@ var async = require('async'), path = require('path'), _ = require('lodash'), winston = require('winston'), + pkg = require('../../package'), Chance = require('chance'); var installController = {}; @@ -27,6 +28,8 @@ installController.index = function(req, res) { content.title = 'Install Trudesk'; content.layout = false; + content.bottom = 'Trudesk v' + pkg.version; + res.render('install', content); }; diff --git a/src/controllers/main.js b/src/controllers/main.js index ef0779078..03d9aff0b 100644 --- a/src/controllers/main.js +++ b/src/controllers/main.js @@ -16,7 +16,8 @@ var _ = require('lodash'), path = require('path'), passport = require('passport'), winston = require('winston'), - nconf = require('nconf'); + + pkg = require('../../package'); var mainController = {}; @@ -45,6 +46,7 @@ mainController.index = function(req, res) { if (settings.hasCustomPageLogo.value && settings.customPageLogoFilename.value.length > 0) content.pageLogo = '/assets/' + settings.customPageLogoFilename.value; + content.bottom = 'Trudesk v' + pkg.version; res.render('login', content); }); diff --git a/src/views/install.hbs b/src/views/install.hbs index 174c97f13..0a3442d65 100644 --- a/src/views/install.hbs +++ b/src/views/install.hbs @@ -197,6 +197,15 @@ stroke-width: 5; stroke-linecap: round; } + .bottom { + position: fixed; + bottom: 0; + left: 0; + font-size: 12px; + font-family: "Roboto", Arial, sans-serif; + margin: 0 0 5px 15px; + color: rgba(0,0,0,0.5); + } @@ -381,6 +390,10 @@ +