fix: button size && admin statistics (#105)

This commit is contained in:
Dream Hunter
2024-04-09 18:30:50 +08:00
committed by GitHub
parent def400eb09
commit 796d72badb
2 changed files with 7 additions and 4 deletions

View File

@@ -232,7 +232,7 @@ onMounted(async () => {
@click="getAttachments(curMail.attachments)">
{{ t('attachments') }}
</n-button>
<n-button tag="a" target="_blank" tertiary type="info" size="small'" :download="curMail.id + '.eml'"
<n-button tag="a" target="_blank" tertiary type="info" size="small" :download="curMail.id + '.eml'"
:href="getDownloadEmlUrl(curMail)">
{{ t('downloadMail') }}
<n-icon :component="CloudDownloadRound" />
@@ -260,7 +260,7 @@ onMounted(async () => {
</template>
</n-thing>
<template #suffix>
<n-button tag="a" target="_blank" tertiary type="info" size="small'" :download="row.filename"
<n-button tag="a" target="_blank" tertiary type="info" size="small" :download="row.filename"
:href="row.url">
<n-icon :component="CloudDownloadRound" />
</n-button>

View File

@@ -139,9 +139,12 @@ api.get('/admin/mails_unknow', async (c) => {
});
api.get('/admin/statistics', async (c) => {
const { count: mailCount } = await c.env.DB.prepare(`
const { count: mailCountV1 } = await c.env.DB.prepare(`
SELECT count(*) as count FROM mails`
).first();
const { count: mailCount } = await c.env.DB.prepare(`
SELECT count(*) as count FROM raw_mails`
).first();
const { count: addressCount } = await c.env.DB.prepare(`
SELECT count(*) as count FROM address`
).first();
@@ -149,7 +152,7 @@ api.get('/admin/statistics', async (c) => {
SELECT count(*) as count FROM address where updated_at > datetime('now', '-7 day')`
).first();
return c.json({
mailCount: mailCount,
mailCount: (mailCountV1 || 0) + (mailCount || 0),
userCount: addressCount,
activeUserCount7days: activeUserCount7days
})