feat: update sendbox UI (#199)

This commit is contained in:
Dream Hunter
2024-05-04 18:58:34 +08:00
committed by GitHub
parent 1d191a091a
commit 26969bebb8
4 changed files with 9 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ import { useI18n } from 'vue-i18n'
import { useGlobalState } from '../../store'
import { api } from '../../api'
const { localeCache, settings, adminAuth, adminSendBoxTabAddress } = useGlobalState()
const { localeCache, adminAuth, adminSendBoxTabAddress } = useGlobalState()
const message = useMessage()
const { t } = useI18n({
@@ -129,9 +129,9 @@ onMounted(async () => {
</script>
<template>
<div v-if="settings.address">
<n-modal v-model:show="showModal" preset="dialog">
<pre>{{ curRow.raw }}</pre>
<div>
<n-modal v-model:show="showModal" preset="dialog" style="width: 100%;">
<pre style="overflow: auto;">{{ curRow.raw }}</pre>
</n-modal>
<n-input-group>
<n-input v-model:value="adminSendBoxTabAddress" />

View File

@@ -128,8 +128,8 @@ onMounted(async () => {
<template>
<div v-if="settings.address">
<n-modal v-model:show="showModal" preset="dialog">
<pre>{{ curRow.raw }}</pre>
<n-modal v-model:show="showModal" preset="dialog" style="width: 100%;">
<pre style="overflow: auto;">{{ curRow.raw }}</pre>
</n-modal>
<div style="display: inline-block;">
<n-pagination v-model:page="page" v-model:page-size="pageSize" :item-count="count"

View File

@@ -91,7 +91,7 @@ const send = async () => {
message.error(error.message || "error");
} finally {
message.success(t("successSend"));
router.push('/sendbox');
router.push('/user');
}
}

View File

@@ -120,6 +120,8 @@ api.post('/api/send_mail', async (c) => {
if (body?.personalizations?.[0]?.dkim_private_key) {
delete body.personalizations[0].dkim_private_key;
}
const reqIp = c.req.raw.headers.get("cf-connecting-ip")
body.reqIp = reqIp;
const { success: success2 } = await c.env.DB.prepare(
`INSERT INTO sendbox (address, raw) VALUES (?, ?)`
).bind(address, JSON.stringify(body)).run();