邮件详情样式优化和查询优化
This commit is contained in:
@@ -55,7 +55,7 @@ function updateContent() {
|
|||||||
'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #13181D;
|
color: #13181D;
|
||||||
overflow-wrap: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shadow-content {
|
.shadow-content {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-scrollbar class="htm-scrollbar" :class="email.attList.length === 0 ? 'bottom-distance' : ''">
|
<el-scrollbar class="htm-scrollbar" :class="email.attList.length === 0 ? 'bottom-distance' : ''">
|
||||||
<ShadowHtml :html="formatImage(email.content)" v-if="email.content" />
|
<ShadowHtml :html="formatImage(email.content)" v-if="email.content" />
|
||||||
<span v-else style="white-space: pre-wrap">{{email.text}}</span>
|
<span v-else class="email-text" >{{email.text}}</span>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
<div class="att" v-if="email.attList.length > 0">
|
<div class="att" v-if="email.attList.length > 0">
|
||||||
<div class="att-title">
|
<div class="att-title">
|
||||||
@@ -375,6 +375,11 @@ const handleDelete = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.email-text {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
.bottom-distance {
|
.bottom-distance {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
mail-worker/dist/index.html
vendored
4
mail-worker/dist/index.html
vendored
@@ -6,8 +6,8 @@
|
|||||||
<title></title>
|
<title></title>
|
||||||
<link rel="icon" href="/assets/favicon-C5dAZutX.svg" type="image/svg+xml">
|
<link rel="icon" href="/assets/favicon-C5dAZutX.svg" type="image/svg+xml">
|
||||||
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
|
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
|
||||||
<script type="module" crossorigin src="/assets/index-cUTOO-6m.js"></script>
|
<script type="module" crossorigin src="/assets/index-DDsmLAr5.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-CaUbyCK1.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-p2lTpkGZ.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="loading-first">
|
<div id="loading-first">
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export async function email(message, env, ctx) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const account = await accountService.selectByEmailIncludeDel({ env: env }, message.to);
|
const account = await accountService.selectByEmailIncludeDelNoCase({ env: env }, message.to);
|
||||||
|
|
||||||
const reader = message.raw.getReader();
|
const reader = message.raw.getReader();
|
||||||
let content = '';
|
let content = '';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import orm from '../entity/orm';
|
import orm from '../entity/orm';
|
||||||
import email from '../entity/email';
|
import email from '../entity/email';
|
||||||
import { emailConst, isDel, settingConst } from '../const/entity-const';
|
import { emailConst, isDel, settingConst } from '../const/entity-const';
|
||||||
import { and, desc, eq, gt, inArray, lt, count, asc, like, ne } from 'drizzle-orm';
|
import { and, desc, eq, gt, inArray, lt, count, asc, sql, ne } from 'drizzle-orm';
|
||||||
import { star } from '../entity/star';
|
import { star } from '../entity/star';
|
||||||
import settingService from './setting-service';
|
import settingService from './setting-service';
|
||||||
import accountService from './account-service';
|
import accountService from './account-service';
|
||||||
@@ -13,7 +13,6 @@ import { parseHTML } from 'linkedom';
|
|||||||
import userService from './user-service';
|
import userService from './user-service';
|
||||||
import roleService from './role-service';
|
import roleService from './role-service';
|
||||||
import user from '../entity/user';
|
import user from '../entity/user';
|
||||||
import account from '../entity/account';
|
|
||||||
import starService from './star-service';
|
import starService from './star-service';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import kvConst from '../const/kv-const';
|
import kvConst from '../const/kv-const';
|
||||||
@@ -509,19 +508,19 @@ const emailService = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (userEmail) {
|
if (userEmail) {
|
||||||
conditions.push(like(user.email, `${userEmail}%`));
|
conditions.push(sql`${user.email} COLLATE NOCASE LIKE ${userEmail + '%'}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (accountEmail) {
|
if (accountEmail) {
|
||||||
conditions.push(like(email.toEmail, `${accountEmail}%`));
|
conditions.push(sql`${email.toEmail} COLLATE NOCASE LIKE ${accountEmail + '%'}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
conditions.push(like(email.name, `${name}%`));
|
conditions.push(sql`${email.name} COLLATE NOCASE LIKE ${name + '%'}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subject) {
|
if (subject) {
|
||||||
conditions.push(like(email.subject, `${subject}%`));
|
conditions.push(sql`${email.subject} COLLATE NOCASE LIKE ${subject + '%'}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
conditions.push(ne(email.status, emailConst.status.SAVING));
|
conditions.push(ne(email.status, emailConst.status.SAVING));
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ const userService = {
|
|||||||
await c.env.kv.delete(kvConst.AUTH_INFO + userId);
|
await c.env.kv.delete(kvConst.AUTH_INFO + userId);
|
||||||
},
|
},
|
||||||
|
|
||||||
async list(c, params, userId) {
|
async list(c, params) {
|
||||||
|
|
||||||
let { num, size, email, timeSort, status } = params;
|
let { num, size, email, timeSort, status } = params;
|
||||||
|
|
||||||
@@ -130,9 +130,10 @@ const userService = {
|
|||||||
|
|
||||||
|
|
||||||
if (email) {
|
if (email) {
|
||||||
conditions.push(like(user.email, `${email}%`));
|
conditions.push(sql`${user.email} COLLATE NOCASE LIKE ${email + '%'}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (params.isDel) {
|
if (params.isDel) {
|
||||||
conditions.push(eq(user.isDel, params.isDel));
|
conditions.push(eq(user.isDel, params.isDel));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user