feat: add emoji count to admin panel

This commit is contained in:
ThatOneCalculator 2023-07-01 20:54:37 -07:00
parent 3d8fe32ef4
commit 592894dbb0
No known key found for this signature in database
GPG key ID: 8703CACD01000000

View file

@ -22,7 +22,7 @@
:value="usersComparedToThePrevDay"
></MkNumberDiff>
</div>
<div class="label">Users</div>
<div class="label">{{ i18n.ts.users }}</div>
</div>
</div>
<div class="item _panel notes">
@ -41,7 +41,7 @@
:value="notesComparedToThePrevDay"
></MkNumberDiff>
</div>
<div class="label">Posts</div>
<div class="label">{{ i18n.ts.notes }}</div>
</div>
</div>
<div class="item _panel instances">
@ -55,7 +55,7 @@
style="margin-right: 0.5em"
/>
</div>
<div class="label">Instances</div>
<div class="label">{{ i18n.ts.instances }}</div>
</div>
</div>
<div class="item _panel online">
@ -69,10 +69,24 @@
style="margin-right: 0.5em"
/>
</div>
<div class="label">Online</div>
<div class="label">{{ i18n.ts.online }}</div>
</div>
</div>
</div>
<div class="item _panel emojis">
<div class="icon">
<i class="ph-smiley ph-bold ph-xl"></i>
</div>
<div class="body">
<div class="value">
<MkNumber
:value="emojiCount"
style="margin-right: 0.5em"
/>
</div>
<div class="label">{{ i18n.ts.emojis }}</div>
</div>
</div>
</Transition>
</div>
</template>
@ -90,6 +104,7 @@ let stats: any = $ref(null);
let usersComparedToThePrevDay = $ref<number>();
let notesComparedToThePrevDay = $ref<number>();
let onlineUsersCount = $ref(0);
let emojiCount = $ref(0);
let fetching = $ref(true);
onMounted(async () => {
@ -110,6 +125,10 @@ onMounted(async () => {
stats.originalNotesCount - chart.local.total[1];
});
os.apiGet("meta").then((meta) => {
emojiCount = meta.emojis.length;
});
fetching = false;
});
</script>