homepage fixes for dead board

merge-requests/208/head
fatchan 5 years ago
parent fdc3946dff
commit 8cf217b7bb
  1. 7
      helpers/build.js
  2. 1
      schedules.js
  3. 1
      views/pages/home.pug

@ -200,8 +200,9 @@ module.exports = {
}
}
});
const totalActiveUsers = activeUsers.totalActiveUsers[0].ips;
await Boards.db.bulkWrite(bulkWrites);
if (bulkWrites.length > 0) {
await Boards.db.bulkWrite(bulkWrites);
}
const [ totalPosts, boards, fileStats ] = await Promise.all([
Boards.totalPosts(), //overall total posts ever made
Boards.frontPageSortLimit(), //boards sorted by users, pph, total posts
@ -209,7 +210,7 @@ module.exports = {
]);
const html = render('index.html', 'home.pug', {
totalPosts: totalPosts,
totalActiveUsers,
activeUsers,
boards,
fileStats,
});

@ -16,6 +16,7 @@ const msTime = require(__dirname+'/helpers/mstime.js')
console.log('Starting schedules');
await buildHomepage();
setInterval(async () => {
try {
await buildHomepage();

@ -43,6 +43,7 @@ block content
th Active Content
tr
td #{totalPosts}
- const totalActiveUsers = activeUsers.totalActiveUsers.length > 0 ? activeUsers.totalActiveUsers[0].ips : 0;
td #{totalActiveUsers}
td #{fileStats.totalSizeString}
.table-container.flex-center.mv-10

Loading…
Cancel
Save