新增自定义显示TG邮件消息内容

This commit is contained in:
eoao
2025-10-23 00:22:45 +08:00
parent 57638aa8e1
commit aded699314
10 changed files with 118 additions and 61 deletions

View File

@@ -87,16 +87,11 @@ function autoScale() {
if (!shadowContent) return
const parentWidth = parent.offsetWidth
const parentHeight = parent.offsetHeight
const childWidth = shadowContent.scrollWidth
const childHeight = shadowContent.scrollHeight
if (childWidth === 0 || childHeight === 0) return
if (childWidth === 0) return
const scaleX = parentWidth / childWidth
const scaleY = parentHeight / childHeight
const scale = Math.min(scaleX, scaleY)
const scale = parentWidth / childWidth
const hostElement = shadowRoot.host
hostElement.style.zoom = scale

View File

@@ -137,7 +137,7 @@ const en = {
websiteReg: 'Sign Up',
loginDomain: 'Sign-In Box Domain',
multipleEmail: 'Multiple Accounts',
multipleEmailDesc: 'Enable this feature to allow users to add multiple accounts.',
multipleEmailDesc: 'Enable this feature to allow users to add multiple accounts',
customization: 'Customization',
websiteTitle: 'Title',
loginBoxOpacity: 'Login Box Opacity',
@@ -145,7 +145,7 @@ const en = {
emailSetting: 'Email',
receiveEmail: 'Receive Email',
autoRefresh: 'Auto Refresh',
autoRefreshDesc: 'Automatically fetch the latest emails from the server.',
autoRefreshDesc: 'Automatically fetch the latest emails from the server',
sendEmail: 'Send Email',
resendToken: 'Resend Token',
oss: 'Object Storage',
@@ -165,7 +165,7 @@ const en = {
version: 'Version',
community: 'Community',
changeTitle: 'Change Title',
addResendTokenDesc: 'Input to add; leave empty to delete.',
addResendTokenDesc: 'Input to add; leave empty to delete',
addOsDomain: 'Add Domain',
domainDesc: 'Domain',
addTurnstileSecret: 'Add turnstile secret',
@@ -173,14 +173,14 @@ const en = {
tgBotDesc: 'Forward received emails to a Telegram bot',
tgBotToken: 'Bot token',
toBotTokenDesc: 'Multiple user chat_ids, separated by commas',
otherEmailDesc: 'emails can be forwarded to external email, but must be verified via cloudflare.',
otherEmailInputDesc: 'Separate multiple email addresses with commas.',
forwardingRulesDesc: 'Rule-based forwarding only forwards emails received by the specified address.',
ruleEmailsInputDesc: 'Separate multiple email addresses with commas.',
otherEmailDesc: 'emails can be forwarded to external email, but must be verified via cloudflare',
otherEmailInputDesc: 'Separate multiple email addresses with commas',
forwardingRulesDesc: 'Rule-based forwarding only forwards emails received by the specified address',
ruleEmailsInputDesc: 'Separate multiple email addresses with commas',
resendTokenList: 'Token List',
domain: 'Domain',
optional: 'Optional',
subjectInputDesc: 'Please enter the email subject.',
subjectInputDesc: 'Please enter the email subject',
changeUserName: 'Change Username',
sendSeparately: 'Separately',
send: 'Send',
@@ -251,14 +251,14 @@ const en = {
supportDesc: 'Buy me tea',
featDesc: 'Feature Description',
emailInterception: 'Email Interception',
emailInterceptionDesc: 'Enter a domain or email address to prevent users from receiving emails from certain websites (Enter * to block all).',
emailInterceptionDesc: 'Enter a domain or email address to prevent users from receiving emails from certain websites (Enter * to block all)',
availableDomains: 'Available Domains',
availableDomainsDesc: 'Restrict users to email domains specified. Domains not on the approved list will be blocked from registration, adding email addresses, and sending/receiving emails. If left blank, all domains will be allowed by default.',
availableDomainsDesc: 'Restrict users to email domains specified. Domains not on the approved list will be blocked from registration, adding email addresses, and sending/receiving emails. If left blank, all domains will be allowed by default',
backgroundUrlDesc: 'Image URL',
localUpload: ' Local upload',
imageLink: 'Image URL',
imageLinkErrorMsg: 'Invalid image URL',
backgroundWarning: 'Image file size affects website load speed.',
backgroundWarning: 'Image file size affects website load speed',
rulesVerify: 'Rules',
rulesVerifyTitle: 'Trigger After {count} Daily Uses per IP',
botVerifyMsg: 'Please verify that you are human',
@@ -278,7 +278,7 @@ const en = {
verifyModuleFailed: 'Verification module failed to load. Please refresh the page',
popUp: 'Pop Up',
noRecipientTitle: 'No Recipient',
noRecipientDesc: 'Emails can be received even without a registered email address.',
noRecipientDesc: 'Emails can be received even without a registered email address',
preview: 'Preview',
help: 'Help',
document: 'Document',
@@ -292,12 +292,17 @@ const en = {
include: 'Include',
delAllEmailConfirm: 'Do you really want to delete it?',
s3Configuration: 'S3 Configuration',
s3Desc: 'If another S3-compatible storage is configured, R2 will take priority if its already connected',
confirmDeletionOfContacts: 'Confirm clearing contacts?',
recentContacts: 'Recent contacts',
selectContacts: 'Select',
forcePathStyleDesc: 'Some self-hosted object storages require path-style access to be enabled.',
kvStorageDesc: 'Replace object storage with KV, and update the access domain to a Worker custom domain.',
kvStorage: 'KV Storage'
forcePathStyleDesc: 'Some self-hosted object storages require path-style access to be enabled',
kvStorageDesc: 'Replace object storage with KV, and update the access domain to a Worker custom domain',
kvStorage: 'KV Storage',
customDomainDesc: 'Worker custom domain',
show: 'Show',
hide: 'Hide',
onlyName: 'Only name'
}
export default en

View File

@@ -298,7 +298,10 @@ const zh = {
selectContacts: '选中',
forcePathStyleDesc: '路径样式访问,一些自建的对象存储需要打开',
kvStorageDesc: '使用KV替代对象存储访问域名改成worker自定义域',
kvStorage: 'KV存储',
customDomainDesc: 'Worker 自定义域'
kvStorage: 'KV 存储',
customDomainDesc: 'Worker 自定义域',
show: '显示',
hide: '隐藏',
onlyName: '仅名字'
}
export default zh

View File

@@ -96,7 +96,7 @@
fit="cover"
>
<template #error>
<div class="error-image" @click="openSetBackground">
<div class="error-image">
<Icon icon="ph:image" width="24" height="24"/>
</div>
</template>
@@ -486,6 +486,28 @@
<el-input-tag tag-type="warning" :placeholder="$t('toBotTokenDesc')" v-model="tgChatId"
@add-tag="addChatTag"></el-input-tag>
<el-input tag-type="warning" :placeholder="$t('customDomainDesc')" v-model="customDomain" ></el-input>
<div class="tg-msg-label">
<span>{{t('from')}}</span>
<el-select v-model="tgMsgFrom" >
<el-option
v-for="item in tgMsgFromOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
<div class="tg-msg-label">
<span>{{t('recipient')}}</span>
<el-select v-model="tgMsgTo" >
<el-option
v-for="item in tgMsgToOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</div>
<template #footer>
<div class="dialog-footer">
@@ -787,6 +809,12 @@ const emailColumnWidth = ref(0)
const tokenColumnWidth = ref(0)
const ruleType = ref(0)
const ruleEmail = ref([])
const tgMsgFrom = ref('')
const tgMsgTo = ref('')
const tgMsgFromOption = [{label: t('show'), value: 'show'}, {label: t('hide'), value: 'hide'}, {label: t('onlyName'), value:'only-name'}]
const tgMsgToOption = [{label: t('show'), value: 'show'}, {label: t('hide'), value: 'hide'}]
const tgMsgLabelWidth = computed(() => locale.value === 'en' ? '120px' : '100px');
getSettings()
getUpdate()
@@ -901,6 +929,8 @@ function openTgSetting() {
tgBotStatus.value = setting.value.tgBotStatus
tgBotToken.value = setting.value.tgBotToken
customDomain.value = setting.value.customDomain
tgMsgFrom.value = setting.value.tgMsgFrom
tgMsgTo.value = setting.value.tgMsgTo
tgChatId.value = []
if (setting.value.tgChatId) {
const list = setting.value.tgChatId.split(',')
@@ -1036,7 +1066,9 @@ function tgBotSave() {
tgBotToken: tgBotToken.value,
customDomain: customDomain.value,
tgBotStatus: tgBotStatus.value,
tgChatId: tgChatId.value + ''
tgChatId: tgChatId.value + '',
tgMsgFrom: tgMsgFrom.value,
tgMsgTo: tgMsgTo.value
}
editSetting(form)
}
@@ -1496,6 +1528,7 @@ function editSetting(settingForm, refreshStatus = true) {
.forward-set-title {
top: 1px;
padding-right: 5px;
position: relative;
font-size: 16px;
font-weight: bold;;
@@ -1548,11 +1581,24 @@ function editSetting(settingForm, refreshStatus = true) {
.forward-set-body {
display: flex;
flex-direction: column;
gap: 15px;
.el-switch {
align-self: end;
}
> *:nth-child(-n+2) {
margin-bottom: 15px;
}
.tg-msg-label {
margin-top: 10px;
display: flex;
align-items: center;
justify-content: space-between;
.el-select {
width: v-bind(tgMsgLabelWidth);
}
}
}
.forward {