mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-26 06:23:35 -04:00
#220 [profile] card images - show admin stats
This commit is contained in:
parent
a5b0c8b866
commit
a7b8ed7c48
@ -84,6 +84,12 @@
|
||||
|
||||
<ChartSet name="users" :data="stats.users.chart" init="cumulative"/>
|
||||
|
||||
<section>
|
||||
<Icon v="id-card"/>
|
||||
Images generated:
|
||||
{{ stats.cards * 100 }}%
|
||||
</section>
|
||||
|
||||
<section v-if="$isGranted('users') && suspiciousUsers.length > 0">
|
||||
<h3>
|
||||
<Icon v="siren-on"/>
|
||||
|
@ -27,7 +27,7 @@ const modes = ['light', 'dark'];
|
||||
LEFT JOIN users on profiles.userId = users.id
|
||||
WHERE profiles.card IS NULL
|
||||
ORDER BY RANDOM()
|
||||
LIMIT 16
|
||||
LIMIT 8
|
||||
`)).filter(({locale}) => !isHighLoadTime(locale));
|
||||
|
||||
if (profiles.length === 0) {
|
||||
|
@ -108,5 +108,8 @@ module.exports.calculateStats = async (db, allLocales) => {
|
||||
};
|
||||
}
|
||||
|
||||
return { calculatedAt: parseInt(new Date() / 1000), users, locales };
|
||||
const cardsCount = (await db.get(`SELECT 1.0 * (SELECT count(*) FROM profiles WHERE card IS NOT NULL) / (SELECT count(*) FROM profiles) as c`)).c;
|
||||
const cards = Math.round(cardsCount * 1000) / 1000;
|
||||
|
||||
return { calculatedAt: parseInt(new Date() / 1000), users, locales, cards };
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user