トップページを強化

This commit is contained in:
syuilo 2020-12-05 18:18:37 +09:00
parent feca9940bc
commit 97165fbaf5
3 changed files with 107 additions and 10 deletions

View file

@ -1,5 +1,5 @@
import define from '../define';
import { Notes, Users } from '../../../models';
import { NoteReactions, Notes, Users } from '../../../models';
import { federationChart, driveChart } from '../../../services/chart';
export const meta = {
@ -48,10 +48,13 @@ export const meta = {
};
export default define(meta, async () => {
const [notesCount,
const [
notesCount,
originalNotesCount,
usersCount,
originalUsersCount,
reactionsCount,
//originalReactionsCount,
instances,
driveUsageLocal,
driveUsageRemote
@ -60,6 +63,8 @@ export default define(meta, async () => {
Notes.count({ where: { userHost: null }, cache: 3600000 }),
Users.count({ cache: 3600000 }),
Users.count({ where: { host: null }, cache: 3600000 }),
NoteReactions.count({ cache: 3600000 }), // 1 hour
//NoteReactions.count({ where: { userHost: null }, cache: 3600000 }),
federationChart.getChart('hour', 1, null).then(chart => chart.instance.total[0]),
driveChart.getChart('hour', 1, null).then(chart => chart.local.totalSize[0]),
driveChart.getChart('hour', 1, null).then(chart => chart.remote.totalSize[0]),
@ -70,6 +75,8 @@ export default define(meta, async () => {
originalNotesCount,
usersCount,
originalUsersCount,
reactionsCount,
//originalReactionsCount,
instances,
driveUsageLocal,
driveUsageRemote