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)"> @click="getAttachments(curMail.attachments)">
{{ t('attachments') }} {{ t('attachments') }}
</n-button> </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)"> :href="getDownloadEmlUrl(curMail)">
{{ t('downloadMail') }} {{ t('downloadMail') }}
<n-icon :component="CloudDownloadRound" /> <n-icon :component="CloudDownloadRound" />
@@ -260,7 +260,7 @@ onMounted(async () => {
</template> </template>
</n-thing> </n-thing>
<template #suffix> <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"> :href="row.url">
<n-icon :component="CloudDownloadRound" /> <n-icon :component="CloudDownloadRound" />
</n-button> </n-button>

View File

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