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
+4 -4
View File
@@ -5,7 +5,7 @@ import { useI18n } from 'vue-i18n'
import { useGlobalState } from '../../store' import { useGlobalState } from '../../store'
import { api } from '../../api' import { api } from '../../api'
const { localeCache, settings, adminAuth, adminSendBoxTabAddress } = useGlobalState() const { localeCache, adminAuth, adminSendBoxTabAddress } = useGlobalState()
const message = useMessage() const message = useMessage()
const { t } = useI18n({ const { t } = useI18n({
@@ -129,9 +129,9 @@ onMounted(async () => {
</script> </script>
<template> <template>
<div v-if="settings.address"> <div>
<n-modal v-model:show="showModal" preset="dialog"> <n-modal v-model:show="showModal" preset="dialog" style="width: 100%;">
<pre>{{ curRow.raw }}</pre> <pre style="overflow: auto;">{{ curRow.raw }}</pre>
</n-modal> </n-modal>
<n-input-group> <n-input-group>
<n-input v-model:value="adminSendBoxTabAddress" /> <n-input v-model:value="adminSendBoxTabAddress" />
+2 -2
View File
@@ -128,8 +128,8 @@ onMounted(async () => {
<template> <template>
<div v-if="settings.address"> <div v-if="settings.address">
<n-modal v-model:show="showModal" preset="dialog"> <n-modal v-model:show="showModal" preset="dialog" style="width: 100%;">
<pre>{{ curRow.raw }}</pre> <pre style="overflow: auto;">{{ curRow.raw }}</pre>
</n-modal> </n-modal>
<div style="display: inline-block;"> <div style="display: inline-block;">
<n-pagination v-model:page="page" v-model:page-size="pageSize" :item-count="count" <n-pagination v-model:page="page" v-model:page-size="pageSize" :item-count="count"
+1 -1
View File
@@ -91,7 +91,7 @@ const send = async () => {
message.error(error.message || "error"); message.error(error.message || "error");
} finally { } finally {
message.success(t("successSend")); message.success(t("successSend"));
router.push('/sendbox'); router.push('/user');
} }
} }
+2
View File
@@ -120,6 +120,8 @@ api.post('/api/send_mail', async (c) => {
if (body?.personalizations?.[0]?.dkim_private_key) { if (body?.personalizations?.[0]?.dkim_private_key) {
delete 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( const { success: success2 } = await c.env.DB.prepare(
`INSERT INTO sendbox (address, raw) VALUES (?, ?)` `INSERT INTO sendbox (address, raw) VALUES (?, ?)`
).bind(address, JSON.stringify(body)).run(); ).bind(address, JSON.stringify(body)).run();