fix(stats): no hard-coded stats
This commit is contained in:
parent
3f58ca2bda
commit
02335b24d8
3 changed files with 12 additions and 12 deletions
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
import { Injectable, Inject } from '@nestjs/common';
|
||||
import { Not, IsNull, DataSource } from 'typeorm';
|
||||
import { Not, IsNull, Like, DataSource } from 'typeorm';
|
||||
import type { MiUser } from '@/models/User.js';
|
||||
import { AppLockService } from '@/core/AppLockService.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
|
@ -37,7 +37,7 @@ export default class UsersChart extends Chart<typeof schema> { // eslint-disable
|
|||
|
||||
protected async tickMajor(): Promise<Partial<KVs<typeof schema>>> {
|
||||
const [localCount, remoteCount] = await Promise.all([
|
||||
this.usersRepository.countBy({ host: IsNull() }),
|
||||
this.usersRepository.countBy({ host: IsNull(), usernameLower: Like("%.%") }),
|
||||
this.usersRepository.countBy({ host: Not(IsNull()) }),
|
||||
]);
|
||||
|
||||
|
|
|
@ -71,12 +71,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
) {
|
||||
super(meta, paramDef, async () => {
|
||||
const notesChart = await this.notesChart.getChart('hour', 1, null);
|
||||
const notesCount = notesChart.local.total[0] + notesChart.remote.total[0];
|
||||
const originalNotesCount = notesChart.local.total[0];
|
||||
const notesCount = originalNotesCount + notesChart.remote.total[0];
|
||||
|
||||
const usersChart = await this.usersChart.getChart('hour', 1, null);
|
||||
const usersCount = usersChart.local.total[0] + usersChart.remote.total[0];
|
||||
const originalUsersCount = usersChart.local.total[0] - 2;
|
||||
const originalUsersCount = usersChart.local.total[0];
|
||||
const usersCount = originalUsersCount + usersChart.remote.total[0];
|
||||
|
||||
const [
|
||||
reactionsCount,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue