feat: optimize email filtering with frontend-only search (#787)

* 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>
This commit is contained in:
Dream Hunter
2025-12-15 02:55:50 +08:00
committed by GitHub
parent 1836f931ee
commit e5f62d4713
17 changed files with 489 additions and 546 deletions

View File

@@ -19,7 +19,7 @@ res = requests.get(
## Admin Mail API
Supports `address` filter and `keyword` filter
Supports `address` filter
```python
import requests
@@ -29,9 +29,8 @@ url = "https://<your-worker-address>/admin/mails"
querystring = {
"limit":"20",
"offset":"0",
# address and keyword are optional parameters
"address":"xxxx@awsl.uk",
"keyword":"xxxx"
# address is optional parameter
"address":"xxxx@awsl.uk"
}
headers = {"x-admin-auth": "<your-Admin-password>"}
@@ -41,9 +40,11 @@ response = requests.get(url, headers=headers, params=querystring)
print(response.json())
```
**Note**: Keyword filtering has been removed from the backend API. If you need to filter emails by content, please use the frontend filter input in the UI, which filters the currently displayed page.
## User Mail API
Supports `address` filter and `keyword` filter
Supports `address` filter
```python
import requests
@@ -53,9 +54,8 @@ url = "https://<your-worker-address>/user_api/mails"
querystring = {
"limit":"20",
"offset":"0",
# address and keyword are optional parameters
"address":"xxxx@awsl.uk",
"keyword":"xxxx"
# address is optional parameter
"address":"xxxx@awsl.uk"
}
headers = {"x-admin-auth": "<your-Admin-password>"}
@@ -64,3 +64,5 @@ response = requests.get(url, headers=headers, params=querystring)
print(response.json())
```
**Note**: Keyword filtering has been removed from the backend API. If you need to filter emails by content, please use the frontend filter input in the UI, which filters the currently displayed page.