homepage fixes for dead board

merge-requests/208/head
fatchan 5 years ago
parent fdc3946dff
commit 8cf217b7bb
  1. 5
      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; if (bulkWrites.length > 0) {
await Boards.db.bulkWrite(bulkWrites); await Boards.db.bulkWrite(bulkWrites);
}
const [ totalPosts, boards, fileStats ] = await Promise.all([ const [ totalPosts, boards, fileStats ] = await Promise.all([
Boards.totalPosts(), //overall total posts ever made Boards.totalPosts(), //overall total posts ever made
Boards.frontPageSortLimit(), //boards sorted by users, pph, total posts Boards.frontPageSortLimit(), //boards sorted by users, pph, total posts
@ -209,7 +210,7 @@ module.exports = {
]); ]);
const html = render('index.html', 'home.pug', { const html = render('index.html', 'home.pug', {
totalPosts: totalPosts, totalPosts: totalPosts,
totalActiveUsers, activeUsers,
boards, boards,
fileStats, fileStats,
}); });

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

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

Loading…
Cancel
Save