mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
ESlint comma-dangle
This commit is contained in:
@@ -11,7 +11,7 @@ blacklistController.get = function (req, res, next) {
|
||||
}
|
||||
res.render('admin/manage/ip-blacklist', {
|
||||
rules: rules,
|
||||
title: '[[pages:ip-blacklist]]'
|
||||
title: '[[pages:ip-blacklist]]',
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -19,15 +19,15 @@ cacheController.get = function (req, res, next) {
|
||||
max: postCache.max,
|
||||
itemCount: postCache.itemCount,
|
||||
percentFull: percentFull,
|
||||
avgPostSize: avgPostSize
|
||||
avgPostSize: avgPostSize,
|
||||
},
|
||||
groupCache: {
|
||||
length: groupCache.length,
|
||||
max: groupCache.max,
|
||||
itemCount: groupCache.itemCount,
|
||||
percentFull: ((groupCache.length / groupCache.max) * 100).toFixed(2),
|
||||
dump: req.query.debug ? JSON.stringify(groupCache.dump(), null, 4) : false
|
||||
}
|
||||
dump: req.query.debug ? JSON.stringify(groupCache.dump(), null, 4) : false,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ var categoriesController = {};
|
||||
categoriesController.get = function (req, res, next) {
|
||||
async.parallel({
|
||||
category: async.apply(categories.getCategories, [req.params.category_id], req.user.uid),
|
||||
privileges: async.apply(privileges.categories.list, req.params.category_id)
|
||||
privileges: async.apply(privileges.categories.list, req.params.category_id),
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -32,7 +32,7 @@ categoriesController.get = function (req, res, next) {
|
||||
data.category.name = translator.escape(String(data.category.name));
|
||||
res.render('admin/manage/category', {
|
||||
category: data.category,
|
||||
privileges: data.privileges
|
||||
privileges: data.privileges,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -46,7 +46,7 @@ categoriesController.getAll = function (req, res, next) {
|
||||
categoriesController.getAnalytics = function (req, res, next) {
|
||||
async.parallel({
|
||||
name: async.apply(categories.getCategoryField, req.params.category_id, 'name'),
|
||||
analytics: async.apply(analytics.getCategoryAnalytics, req.params.category_id)
|
||||
analytics: async.apply(analytics.getCategoryAnalytics, req.params.category_id),
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
|
||||
@@ -20,18 +20,18 @@ dashboardController.get = function (req, res, next) {
|
||||
{
|
||||
done: !meta.reloadRequired,
|
||||
doneText: '[[admin/general/dashboard:restart-not-required]]',
|
||||
notDoneText:'[[admin/general/dashboard:restart-required]]'
|
||||
notDoneText:'[[admin/general/dashboard:restart-required]]',
|
||||
},
|
||||
{
|
||||
done: plugins.hasListeners('filter:search.query'),
|
||||
doneText: '[[admin/general/dashboard:search-plugin-installed]]',
|
||||
notDoneText:'[[admin/general/dashboard:search-plugin-not-installed]]',
|
||||
tooltip: '[[admin/general/dashboard:search-plugin-tooltip]]',
|
||||
link:'/admin/extend/plugins'
|
||||
}
|
||||
link:'/admin/extend/plugins',
|
||||
},
|
||||
];
|
||||
plugins.fireHook('filter:admin.notices', notices, next);
|
||||
}
|
||||
},
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -39,7 +39,7 @@ dashboardController.get = function (req, res, next) {
|
||||
res.render('admin/general/dashboard', {
|
||||
version: nconf.get('version'),
|
||||
notices: results.notices,
|
||||
stats: results.stats
|
||||
stats: results.stats,
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -57,7 +57,7 @@ function getStats(callback) {
|
||||
},
|
||||
function (next) {
|
||||
getStatsForSet('topics:tid', 'topicCount', next);
|
||||
}
|
||||
},
|
||||
], function (err, results) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
@@ -75,7 +75,7 @@ function getStatsForSet(set, field, callback) {
|
||||
var terms = {
|
||||
day: 86400000,
|
||||
week: 604800000,
|
||||
month: 2592000000
|
||||
month: 2592000000,
|
||||
};
|
||||
|
||||
var now = Date.now();
|
||||
@@ -91,7 +91,7 @@ function getStatsForSet(set, field, callback) {
|
||||
},
|
||||
alltime: function (next) {
|
||||
getGlobalField(field, next);
|
||||
}
|
||||
},
|
||||
}, callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ databaseController.get = function (req, res, next) {
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}
|
||||
},
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
|
||||
@@ -11,7 +11,7 @@ var errorsController = {};
|
||||
errorsController.get = function (req, res, next) {
|
||||
async.parallel({
|
||||
'not-found': async.apply(meta.errors.get, true),
|
||||
analytics: async.apply(analytics.getErrorAnalytics)
|
||||
analytics: async.apply(analytics.getErrorAnalytics),
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -24,7 +24,7 @@ errorsController.get = function (req, res, next) {
|
||||
errorsController.export = function (req, res, next) {
|
||||
async.waterfall([
|
||||
async.apply(meta.errors.get, false),
|
||||
async.apply(json2csv)
|
||||
async.apply(json2csv),
|
||||
], function (err, csv) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
|
||||
@@ -22,7 +22,7 @@ eventsController.get = function (req, res, next) {
|
||||
},
|
||||
events: function (next) {
|
||||
events.getEvents(start, stop, next);
|
||||
}
|
||||
},
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -33,7 +33,7 @@ eventsController.get = function (req, res, next) {
|
||||
res.render('admin/advanced/events', {
|
||||
events: results.events,
|
||||
pagination: pagination.create(page, pageCount),
|
||||
next: 20
|
||||
next: 20,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@ flagsController.get = function (req, res, next) {
|
||||
analytics: function (next) {
|
||||
analytics.getDailyStatsForSet('analytics:flags', Date.now(), 30, next);
|
||||
},
|
||||
assignees: async.apply(user.getAdminsandGlobalModsandModerators)
|
||||
assignees: async.apply(user.getAdminsandGlobalModsandModerators),
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -39,7 +39,7 @@ flagsController.get = function (req, res, next) {
|
||||
results.assignees = results.assignees.map(function (userObj) {
|
||||
return {
|
||||
uid: userObj.uid,
|
||||
username: userObj.username
|
||||
username: userObj.username,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -94,7 +94,7 @@ function getFlagData(req, res, callback) {
|
||||
}
|
||||
|
||||
posts.getFlags(sets, cid, req.uid, start, stop, next);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ groupsController.list = function (req, res, next) {
|
||||
},
|
||||
function (groupData, next) {
|
||||
next(null, {groups: groupData, pagination: pagination.create(page, pageCount)});
|
||||
}
|
||||
},
|
||||
], function (err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -44,7 +44,7 @@ groupsController.list = function (req, res, next) {
|
||||
res.render('admin/manage/groups', {
|
||||
groups: data.groups,
|
||||
pagination: data.pagination,
|
||||
yourid: req.uid
|
||||
yourid: req.uid,
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -60,7 +60,7 @@ groupsController.get = function (req, res, callback) {
|
||||
return callback();
|
||||
}
|
||||
groups.get(groupName, {uid: req.uid, truncateUserList: true, userListCount: 20}, next);
|
||||
}
|
||||
},
|
||||
], function (err, group) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
|
||||
@@ -25,11 +25,11 @@ homePageController.get = function (req, res, next) {
|
||||
categoryData = categoryData.map(function (category) {
|
||||
return {
|
||||
route: 'category/' + category.slug,
|
||||
name: 'Category: ' + category.name
|
||||
name: 'Category: ' + category.name,
|
||||
};
|
||||
});
|
||||
next(null, categoryData);
|
||||
}
|
||||
},
|
||||
], function (err, categoryData) {
|
||||
if (err || !categoryData) {
|
||||
categoryData = [];
|
||||
@@ -38,16 +38,16 @@ homePageController.get = function (req, res, next) {
|
||||
plugins.fireHook('filter:homepage.get', {routes: [
|
||||
{
|
||||
route: 'categories',
|
||||
name: 'Categories'
|
||||
name: 'Categories',
|
||||
},
|
||||
{
|
||||
route: 'recent',
|
||||
name: 'Recent'
|
||||
name: 'Recent',
|
||||
},
|
||||
{
|
||||
route: 'popular',
|
||||
name: 'Popular'
|
||||
}
|
||||
name: 'Popular',
|
||||
},
|
||||
].concat(categoryData)}, function (err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -55,7 +55,7 @@ homePageController.get = function (req, res, next) {
|
||||
|
||||
data.routes.push({
|
||||
route: '',
|
||||
name: 'Custom'
|
||||
name: 'Custom',
|
||||
});
|
||||
|
||||
res.render('admin/general/homepage', data);
|
||||
|
||||
@@ -49,7 +49,7 @@ function getNodeInfo(callback) {
|
||||
title: process.title,
|
||||
version: process.version,
|
||||
memoryUsage: process.memoryUsage(),
|
||||
uptime: process.uptime()
|
||||
uptime: process.uptime(),
|
||||
},
|
||||
os: {
|
||||
hostname: os.hostname(),
|
||||
@@ -57,8 +57,8 @@ function getNodeInfo(callback) {
|
||||
platform: os.platform(),
|
||||
arch: os.arch(),
|
||||
release: os.release(),
|
||||
load: os.loadavg().map(function (load) { return load.toFixed(2); }).join(', ')
|
||||
}
|
||||
load: os.loadavg().map(function (load) { return load.toFixed(2); }).join(', '),
|
||||
},
|
||||
};
|
||||
|
||||
async.parallel({
|
||||
@@ -67,7 +67,7 @@ function getNodeInfo(callback) {
|
||||
},
|
||||
gitInfo: function (next) {
|
||||
getGitInfo(next);
|
||||
}
|
||||
},
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
@@ -93,7 +93,7 @@ function getGitInfo(callback) {
|
||||
},
|
||||
branch: function (next) {
|
||||
get('git rev-parse --abbrev-ref HEAD', next);
|
||||
}
|
||||
},
|
||||
}, callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ languagesController.get = function (req, res, next) {
|
||||
});
|
||||
|
||||
res.render('admin/general/languages', {
|
||||
languages: languages
|
||||
languages: languages,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@ logsController.get = function (req, res, next) {
|
||||
}
|
||||
|
||||
res.render('admin/advanced/logs', {
|
||||
data: validator.escape(logs)
|
||||
data: validator.escape(logs),
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ pluginsController.get = function (req, res, next) {
|
||||
|
||||
next(null, plugins);
|
||||
});
|
||||
}
|
||||
},
|
||||
}, function (err, payload) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -48,7 +48,7 @@ pluginsController.get = function (req, res, next) {
|
||||
}),
|
||||
incompatible: payload.all.filter(function (plugin) {
|
||||
return compatiblePkgNames.indexOf(plugin.name) === -1;
|
||||
})
|
||||
}),
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -47,11 +47,11 @@ function renderEmail(req, res, next) {
|
||||
path: path,
|
||||
fullpath: email,
|
||||
text: text,
|
||||
original: original.toString()
|
||||
original: original.toString(),
|
||||
});
|
||||
});
|
||||
}, next);
|
||||
}
|
||||
},
|
||||
], function (err, emails) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -61,7 +61,7 @@ function renderEmail(req, res, next) {
|
||||
emails: emails,
|
||||
sendable: emails.filter(function (email) {
|
||||
return email.path.indexOf('_plaintext') === -1 && email.path.indexOf('partials') === -1;
|
||||
})
|
||||
}),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ socialController.get = function (req, res, next) {
|
||||
}
|
||||
|
||||
res.render('admin/general/social', {
|
||||
posts: posts
|
||||
posts: posts,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -12,12 +12,12 @@ soundsController.get = function (req, res, next) {
|
||||
|
||||
sounds = Object.keys(sounds).map(function (name) {
|
||||
return {
|
||||
name: name
|
||||
name: name,
|
||||
};
|
||||
});
|
||||
|
||||
res.render('admin/general/sounds', {
|
||||
sounds: sounds
|
||||
sounds: sounds,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -73,8 +73,8 @@ uploadsController.uploadTouchIcon = function (req, res, next) {
|
||||
path: path.join(nconf.get('upload_path'), 'system', 'touchicon-' + size + '.png'),
|
||||
extension: 'png',
|
||||
width: size,
|
||||
height: size
|
||||
})
|
||||
height: size,
|
||||
}),
|
||||
], next);
|
||||
}, function (err) {
|
||||
fs.unlink(uploadedFile.path, function (err) {
|
||||
|
||||
@@ -18,7 +18,7 @@ var userFields = ['uid', 'username', 'userslug', 'email', 'postcount', 'joindate
|
||||
usersController.search = function (req, res, next) {
|
||||
res.render('admin/manage/users', {
|
||||
search_display: '',
|
||||
users: []
|
||||
users: [],
|
||||
});
|
||||
};
|
||||
|
||||
@@ -97,14 +97,14 @@ usersController.registrationQueue = function (req, res, next) {
|
||||
invites.invitations = invites.invitations.map(function (email, i) {
|
||||
return {
|
||||
email: email,
|
||||
username: usernames[index][i] === '[[global:guest]]' ? '' : usernames[index][i]
|
||||
username: usernames[index][i] === '[[global:guest]]' ? '' : usernames[index][i],
|
||||
};
|
||||
});
|
||||
});
|
||||
next(null, invitations);
|
||||
}
|
||||
},
|
||||
], next);
|
||||
}
|
||||
},
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -142,9 +142,9 @@ function getUsers(set, section, min, max, req, res, next) {
|
||||
},
|
||||
function (uids, next) {
|
||||
user.getUsersWithFields(uids, userFields, req.uid, next);
|
||||
}
|
||||
},
|
||||
], next);
|
||||
}
|
||||
},
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -157,7 +157,7 @@ function getUsers(set, section, min, max, req, res, next) {
|
||||
var data = {
|
||||
users: results.users,
|
||||
page: page,
|
||||
pageCount: Math.max(1, Math.ceil(results.count / resultsPerPage))
|
||||
pageCount: Math.max(1, Math.ceil(results.count / resultsPerPage)),
|
||||
};
|
||||
data[section] = true;
|
||||
render(req, res, data);
|
||||
@@ -181,7 +181,7 @@ usersController.getCSV = function (req, res, next) {
|
||||
events.log({
|
||||
type: 'getUsersCSV',
|
||||
uid: req.user.uid,
|
||||
ip: req.ip
|
||||
ip: req.ip,
|
||||
});
|
||||
|
||||
user.getUsersCSV(function (err, data) {
|
||||
|
||||
Reference in New Issue
Block a user