1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-13 03:02:49 +00:00

updated bunch of file paths and changed the way posts are loaded

This commit is contained in:
2016-01-05 12:28:04 -06:00
parent 719ae331ae
commit c96a84d0ff
13249 changed files with 317868 additions and 2101398 deletions

View File

@@ -7,16 +7,25 @@ var routes = function() {
exp.viewDatabase = function(req, res) {
req.db.stats(function(err, data){
req.db.stats(function(err, data) {
var ctx = {
title: 'Viewing Database: ' + req.dbName,
colls: req.collections[req.dbName],
stats: {
collections: data.collections,
dataSize: utils.bytesToSize(data.dataSize),
storageSize: utils.bytesToSize(data.storageSize),
fileSize: utils.bytesToSize(data.fileSize)
}
title: 'Viewing Database: ' + req.dbName,
colls: req.collections[req.dbName],
stats: {
avgObjSize: utils.bytesToSize(data.avgObjSize),
collections: data.collections,
dataFileVersion: (data.dataFileVersion && data.dataFileVersion.major && data.dataFileVersion.minor ?
data.dataFileVersion.major + '.' + data.dataFileVersion.minor :
null),
dataSize: utils.bytesToSize(data.dataSize),
extentFreeListNum: (data.extentFreeList && data.extentFreeList.num ? data.extentFreeList.num : null),
fileSize: (typeof data.fileSize !== 'undefined' ? utils.bytesToSize(data.fileSize) : null),
indexes: data.indexes,
indexSize: utils.bytesToSize(data.indexSize),
numExtents: data.numExtents.toString(),
objects: data.objects,
storageSize: utils.bytesToSize(data.storageSize),
},
};
res.render('database', ctx);
});
@@ -25,12 +34,12 @@ var routes = function() {
exp.updateCollections = function(req, res) {
req.updateCollections(req.db, req.dbName, function(err) {
if (err) {
req.session.error = 'Something went wrong: ' + err;
return res.redirect('back');
}
req.session.error = 'Something went wrong: ' + err;
return res.redirect('back');
}
req.session.success = 'Collections Updated!';
res.redirect(res.locals.baseHref + 'db/' + req.dbName);
req.session.success = 'Collections Updated!';
res.redirect(res.locals.baseHref + 'db/' + req.dbName);
});
};