mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-31 21:20:07 +08:00
* feat: optimize email filtering with frontend-only search - Remove backend keyword parameter from mail APIs (breaking change) - Implement frontend filtering on current page (20-100 items) - Add message_id database index for UPDATE performance - Support desktop and mobile responsive layouts - Update API documentation and CHANGELOG BREAKING CHANGE: /admin/mails and /user_api/mails no longer accept keyword parameter 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: restore Mail ID query input in Index.vue - Keep showMailIdQuery UI input for querying specific mail by ID - Triggered when URL contains mail_id parameter 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
59 lines
1.7 KiB
Vue
59 lines
1.7 KiB
Vue
<script setup>
|
|
import { ref, onMounted, watch } from 'vue';
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
import { useGlobalState } from '../../store'
|
|
import { api } from '../../api'
|
|
import MailBox from '../../components/MailBox.vue';
|
|
|
|
const { adminMailTabAddress } = useGlobalState()
|
|
|
|
const { t } = useI18n({
|
|
messages: {
|
|
en: {
|
|
addressQueryTip: 'Leave blank to query all addresses',
|
|
query: 'Query',
|
|
},
|
|
zh: {
|
|
addressQueryTip: '留空查询所有地址',
|
|
query: '查询',
|
|
}
|
|
}
|
|
});
|
|
|
|
const mailBoxKey = ref("")
|
|
|
|
const queryMail = () => {
|
|
adminMailTabAddress.value = adminMailTabAddress.value.trim();
|
|
mailBoxKey.value = Date.now();
|
|
}
|
|
|
|
const fetchMailData = async (limit, offset) => {
|
|
return await api.fetch(
|
|
`/admin/mails`
|
|
+ `?limit=${limit}`
|
|
+ `&offset=${offset}`
|
|
+ (adminMailTabAddress.value ? `&address=${adminMailTabAddress.value}` : '')
|
|
);
|
|
}
|
|
|
|
const deleteMail = async (curMailId) => {
|
|
await api.fetch(`/admin/mails/${curMailId}`, { method: 'DELETE' });
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div style="margin-top: 10px;">
|
|
<n-input-group>
|
|
<n-input v-model:value="adminMailTabAddress" :placeholder="t('addressQueryTip')"
|
|
@keydown.enter="queryMail" clearable />
|
|
<n-button @click="queryMail" type="primary" tertiary>
|
|
{{ t('query') }}
|
|
</n-button>
|
|
</n-input-group>
|
|
<div style="margin-top: 10px;"></div>
|
|
<MailBox :key="mailBoxKey" :enableUserDeleteEmail="true" :fetchMailData="fetchMailData"
|
|
:deleteMail="deleteMail" :showFilterInput="true" />
|
|
</div>
|
|
</template>
|