You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
903 B
JavaScript

10 years ago
'use strict';
var async = require('async');
var nconf = require('nconf');
8 years ago
var databaseController = module.exports;
10 years ago
databaseController.get = function (req, res, next) {
8 years ago
async.waterfall([
function (next) {
async.parallel({
redis: function (next) {
if (nconf.get('redis')) {
var rdb = require('../../database/redis');
rdb.info(rdb.client, next);
} else {
next();
}
},
mongo: function (next) {
if (nconf.get('mongo')) {
var mdb = require('../../database/mongo');
mdb.info(mdb.client, next);
} else {
next();
}
},
postgres: function (next) {
if (nconf.get('postgres')) {
var pdb = require('../../database/postgres');
pdb.info(pdb.pool, next);
} else {
next();
}
},
8 years ago
}, next);
10 years ago
},
8 years ago
function (results) {
res.render('admin/advanced/database', results);
},
8 years ago
], next);
10 years ago
};