mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
display posts cache capacity/post count
This commit is contained in:
@@ -33,6 +33,7 @@ var adminController = {
|
||||
events: {},
|
||||
logs: {},
|
||||
database: {},
|
||||
postCache: {},
|
||||
plugins: {},
|
||||
languages: {},
|
||||
settings: {},
|
||||
@@ -236,6 +237,26 @@ adminController.logs.get = function(req, res, next) {
|
||||
});
|
||||
};
|
||||
|
||||
adminController.postCache.get = function(req, res, next) {
|
||||
var cache = require('../posts/cache');
|
||||
var avgPostSize = 0;
|
||||
var percentFull = 0;
|
||||
if (cache.itemCount > 0) {
|
||||
avgPostSize = parseInt((cache.length / cache.itemCount), 10);
|
||||
percentFull = ((cache.length / cache.max) * 100).toFixed(2);
|
||||
}
|
||||
|
||||
res.render('admin/advanced/post-cache', {
|
||||
cache: {
|
||||
length: cache.length,
|
||||
max: cache.max,
|
||||
itemCount: cache.itemCount,
|
||||
percentFull: percentFull,
|
||||
avgPostSize: avgPostSize
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
adminController.plugins.get = function(req, res, next) {
|
||||
plugins.getAll(function(err, plugins) {
|
||||
if (err || !Array.isArray(plugins)) {
|
||||
|
||||
Reference in New Issue
Block a user