BillionMail gives you open-source MailServer, NewsLetter, Email Marketing — fully self-hosted, dev-friendly, and free from monthly fees. Join the discord: https://discord.gg/asfXzBUhZr
Modify comment information
zdmeb2e1e975e93
diff --git a/core/frontend/src/components/base/bt-charts/index.vue b/core/frontend/src/components/base/bt-charts/index.vueindex f14943ea..58d1d629 100644--- a/core/frontend/src/components/base/bt-charts/index.vue+++ b/core/frontend/src/components/base/bt-charts/index.vue@@ -45,12 +45,12 @@ const props = defineProps({type: String,default: 'default',},- // 控制是否合并新旧配置+ // Control whether to merge new and old configurationsnotMerge: {type: Boolean,default: false,},- // 更新时是否不显示过渡动画+ // Whether to not display the transition animation when updatinglazyUpdate: {type: Boolean,default: false,@@ -68,16 +68,16 @@ let resizeObserver = nullconst initChart = () => {if (chartRef.value) {- // 使用主题并添加渲染器选项,提高渲染性能+ // Use theme and add renderer options to improve rendering performancechartInstance = echarts.init(chartRef.value, props.theme, {renderer: 'canvas',- useDirtyRect: true, // 使用脏矩形渲染提高性能+ useDirtyRect: true, // Use dirty rectangle rendering to improve performance})- // 初始设置选项+ // Initial set optionsupdateChart()- // 使用ResizeObserver代替window事件,提高性能+ // Use ResizeObserver instead of window event to improve performanceresizeObserver = new ResizeObserver(() => {requestAnimationFrame(() => {chartInstance?.resize()@@ -88,11 +88,11 @@ const initChart = () => {}}-// 更新图表的方法,与初始化分离+// Update chart method, separated from initializationconst updateChart = () => {if (!chartInstance || !props.options) return- // 使用notMerge和lazyUpdate提高更新性能+ // Use notMerge and lazyUpdate to improve update performancechartInstance.setOption(props.options, {notMerge: props.notMerge,lazyUpdate: props.lazyUpdate,@@ -104,7 +104,7 @@ onMounted(() => {})onUnmounted(() => {- // 清理所有资源+ // Clean up all resourcesresizeObserver?.disconnect()if (chartInstance) {chartInstance.dispose()@@ -112,7 +112,7 @@ onUnmounted(() => {}})-// 使用深度监听优化图表更新+// Use deep watch to optimize chart updateswatch(() => props.options,() => {@@ -121,7 +121,7 @@ watch({ deep: true })-// 主题变化时重新初始化图表+// When the theme changes, reinitialize the chartwatch(() => props.theme,() => {@@ -132,7 +132,7 @@ watch(})-// 导出图表实例,使父组件可以访问更多方法+// Export chart instance, so parent components can access more methodsdefineExpose({getChartInstance: () => chartInstance,resize: () => chartInstance?.resize(),diff --git a/core/frontend/src/components/base/bt-table-layout/index.vue b/core/frontend/src/components/base/bt-table-layout/index.vueindex c4aa259c..2aee1a49 100644--- a/core/frontend/src/components/base/bt-table-layout/index.vue+++ b/core/frontend/src/components/base/bt-table-layout/index.vue@@ -22,10 +22,10 @@</template><script lang="ts" setup>-// 判断<slot name="toolsLeft"/>是否有传值+// Check if <slot name="toolsLeft"/> has a valueconst slotLeft = !!useSlots().toolsLeft-// 判断<slot name="toolsRight"/>是否有传值+// Check if <slot name="toolsRight"/> has a valueconst slotRight = !!useSlots().toolsRight-// 判断<slot name="pageRight"/>是否有传值+// Check if <slot name="pageRight"/> has a valueconst slotPage = !!useSlots().pageLeft || !!useSlots().pageRight</script>diff --git a/core/frontend/src/components/ui/bt-modal/index.vue b/core/frontend/src/components/ui/bt-modal/index.vueindex ee09845e..b0d9fb99 100644--- a/core/frontend/src/components/ui/bt-modal/index.vue+++ b/core/frontend/src/components/ui/bt-modal/index.vue@@ -75,10 +75,10 @@ const props = defineProps({const show = defineModel<boolean>('show')-// 窗口高度+// Window heightconst { height } = useWindowSize()-// 最大滚动高度+// Maximum scroll heightconst maxScrollHeight = computed(() => {if (height.value) return `${height.value - 32}px`return 'auto'diff --git a/core/frontend/src/components/ui/bt-table-page/index.vue b/core/frontend/src/components/ui/bt-table-page/index.vueindex a9de5325..7523c411 100644--- a/core/frontend/src/components/ui/bt-table-page/index.vue+++ b/core/frontend/src/components/ui/bt-table-page/index.vue@@ -52,7 +52,7 @@ const updatePage = (val: number) => {emit('refresh')}-// 切换分页数量+// Switch page sizeconst updatePageSize = (size: number) => {page.value = 1pageSize.value = sizediff --git a/core/frontend/src/components/utils/confirm/method.tsx b/core/frontend/src/components/utils/confirm/method.tsxindex 02434e58..1382df8e 100644--- a/core/frontend/src/components/utils/confirm/method.tsx+++ b/core/frontend/src/components/utils/confirm/method.tsx@@ -6,8 +6,8 @@ import Modal from '@/components/ui/bt-modal/index.vue'import ConfigProvider from '@/components/ui/bt-config-provider/index.vue'/**- * @description 命令式调用确认对话框- * @param options 确认对话框选项+ * @description Command-style call confirm dialog+ * @param options Confirm dialog options*/export function confirm(options: ConfirmOptions) {const container = document.createElement('div')@@ -19,7 +19,7 @@ export function confirm(options: ConfirmOptions) {}}- // 创建虚拟节点+ // Create virtual nodeconst modalNode = createVNode(Modal,{@@ -39,7 +39,7 @@ export function confirm(options: ConfirmOptions) {})- // 创建配置提供者节点+ // Create configuration provider nodeconst configNode = createVNode(ConfigProvider,{},@@ -50,6 +50,6 @@ export function confirm(options: ConfirmOptions) {configNode.appContext = app._context- // 渲染到 Modal+ // Render to Modalrender(configNode, container)}diff --git a/core/frontend/src/components/utils/message/index.tsx b/core/frontend/src/components/utils/message/index.tsxindex 92ea4041..878d9a1f 100644--- a/core/frontend/src/components/utils/message/index.tsx+++ b/core/frontend/src/components/utils/message/index.tsx@@ -71,7 +71,7 @@ export default defineComponent({let timer = 0- // 关闭消息框+ // Close message boxconst handleClose = () => {emit('close')}@@ -90,7 +90,7 @@ export default defineComponent({}}- // 设置居中+ // Set to the centerconst setMsgCenter = () => {const dom = messageRef.valueif (!dom) return@@ -104,7 +104,7 @@ export default defineComponent({let first = true- // 添加窗口变化+ // Add window changeconst robserver = new ResizeObserver(() => {if (first) {first = false@@ -113,7 +113,7 @@ export default defineComponent({setMsgCenter()})- // 居中后显示消息+ // Show message after centeringconst showMsg = () => {nextTick(() => {const dom = messageRef.valuediff --git a/core/frontend/src/components/utils/message/interface.ts b/core/frontend/src/components/utils/message/interface.tsindex f6859fdd..bb1439af 100644--- a/core/frontend/src/components/utils/message/interface.ts+++ b/core/frontend/src/components/utils/message/interface.ts@@ -23,50 +23,50 @@ export type MessageItem = {}export type MessageMethod = {- // 显示信息提示+ // Show information promptinfo: (content: RenderContent | MessageConfig, config?: Partial<MessageConfig>) => MessageReturn- // 显示成功提示+ // Show success promptsuccess: (content: RenderContent | MessageConfig,config?: Partial<MessageConfig>) => MessageReturn- // 显示警告提示+ // Show warning promptwarning: (content: RenderContent | MessageConfig,config?: Partial<MessageConfig>) => MessageReturn- // 显示错误提示+ // Show error prompterror: (content: RenderContent | MessageConfig, config?: Partial<MessageConfig>) => MessageReturn- // 显示加载中提示+ // Show loading promptloading: (content: RenderContent | MessageConfig,config?: Partial<MessageConfig>) => MessageReturn- // 清空全部提示+ // Clear all promptsclear: () => void}export type MessageReturn = {- // 关闭当前消息+ // Close the current messageclose: () => void}export type MessageConfig = {- // 内容+ // Contentcontent: RenderContent- // 唯一id+ // Unique idid?: string- // 是否有背景遮罩+ // Whether to have a background maskmask?: boolean- // 是否关闭+ // Whether to closeclose?: boolean- // 消息显示的持续时间+ // Message display durationduration?: number- // 消息的位置+ // Message positionposition?: MessagePosition- // 是否为html+ // Whether to be htmlisHtml?: booleanmaxWidth?: number | string- // 关闭时的回调函数+ // Callback function when closingonClose?: (id: number | string) => void}diff --git a/core/frontend/src/hooks/modal/interface.ts b/core/frontend/src/hooks/modal/interface.tsindex 4fc2444c..a353e3b9 100644--- a/core/frontend/src/hooks/modal/interface.ts+++ b/core/frontend/src/hooks/modal/interface.ts@@ -1,26 +1,26 @@export interface ModalApiOptions {/**- * @description 共享状态数据+ * @description Shared state data*/state?: Record<string, unknown>/**- * @description 独立的弹窗组件+ * @description Independent modal component*/component?: Component/**- * @description 弹窗状态变化回调+ * @description Modal state change callback*/onChangeState?: (isOpen: boolean) => void/**- * @description 点击取消按钮的回调+ * @description Click cancel button callback*/onCancel?: () => void/**- * @description 点击确定按钮的回调+ * @description Click confirm button callback*/onConfirm?: () => void | Promise<unknown>/**- * @description 弹窗关闭结束的回调+ * @description Modal close end callback*/onClose?: () => void}diff --git a/core/frontend/src/hooks/useTableData.ts b/core/frontend/src/hooks/useTableData.tsindex 05ea5ff4..392f2444 100644--- a/core/frontend/src/hooks/useTableData.ts+++ b/core/frontend/src/hooks/useTableData.ts@@ -24,7 +24,7 @@ export const useTableData = <T, K extends TableParams>(options: UseTableDataOpticonst tableParams = ref<K>(params)- // 获取表格数据+ // Get table dataconst getTableData = async (resetPage = false) => {if (resetPage) {params.page = 1@@ -44,7 +44,7 @@ export const useTableData = <T, K extends TableParams>(options: UseTableDataOpti}}- // 如果设置了立即加载,则立即获取数据+ // If immediate is set, get data immediatelyif (immediate) {getTableData()}diff --git a/core/frontend/src/router/index.ts b/core/frontend/src/router/index.tsindex 92c6a25c..54f9efd1 100644--- a/core/frontend/src/router/index.ts+++ b/core/frontend/src/router/index.ts@@ -3,31 +3,31 @@ import { routes } from '@/router/router'import router from '@/router/router'import loadingBar from '@/config/loadingBar'-// 路由白名单+// Route white listconst whitePathList = ['/login']router.beforeEach(async (to, from, next) => {loadingBar.start()- // 判断访问的路由是否存在于注册的路由中+ // Check if the visited route exists in the registered routesconst routeExists = routes.some(route => route.path === to.path)- // 如果路由不存在,则直接通过+ // If the route does not exist, go directlyif (!routeExists) {next()return}const userStore = useUserStore()- // 用户已登录+ // User is logged inif (userStore.isLogin) {- // 如果访问的是白名单中的路由,则跳转到主页+ // If the visited route is in the white list, jump to the home pageif (whitePathList.includes(to.path)) {next('/')} else {next()}} else if (whitePathList.includes(to.path)) {- // 如果访问的是白名单中的路由,则直接跳转+ // If the visited route is in the white list, go directlynext()} else {next('/login')diff --git a/core/frontend/src/router/router.ts b/core/frontend/src/router/router.tsindex e561ee4d..3b1afb3f 100644--- a/core/frontend/src/router/router.ts+++ b/core/frontend/src/router/router.ts@@ -3,17 +3,17 @@ import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'import { is } from '@/utils'import { Layout } from '@/router/constant'-// 从模块中导入路由+// Import routes from modulesconst modules = import.meta.webpackContext('./modules', {- // 是否搜索子目录+ // Whether to search for subdirectoriesrecursive: false,regExp: /\.ts$/,})-// 模块路由+// Module routesexport const menuList: RouteRecordRaw[] = []-// 遍历模块列表生成模块路由+// Iterate through the module list to generate module routesfor (const path of modules.keys()) {const mod = modules(path)if (is<{ default: RouteRecordRaw }>(mod, 'Module')) {@@ -21,7 +21,7 @@ for (const path of modules.keys()) {}}-// 模块路由排序+// Sort module routesmenuList.sort((a, b) => {const aSort = get(a, 'meta.sort', 0) as numberconst bSort = get(b, 'meta.sort', 0) as numberdiff --git a/core/frontend/src/store/modules/user.ts b/core/frontend/src/store/modules/user.tsindex daa82d25..eb46069f 100644--- a/core/frontend/src/store/modules/user.ts+++ b/core/frontend/src/store/modules/user.ts@@ -11,20 +11,20 @@ export default defineStore(const login = ref({token: '', // Token- refresh_token: '', // 刷新Token- ttl: 0, // Token有效时间/秒- expire: 0, // Token到期时间+ refresh_token: '', // Refresh Token+ ttl: 0, // Token valid time/second+ expire: 0, // Token expiration time})/**- * @description 判断用户是否登录+ * @description Determine if the user is logged in*/const isLogin = computed(() => {return login.value.token && login.value.expire > Date.now()})/**- * @description 设置用户登录信息+ * @description Set user login information* @param userVal*/const setLoginInfo = (userVal: { token: string; refresh_token: string; ttl: number }) => {diff --git a/core/frontend/src/utils/data.ts b/core/frontend/src/utils/data.tsindex 2e8f5aeb..9180f6a2 100644--- a/core/frontend/src/utils/data.ts+++ b/core/frontend/src/utils/data.ts@@ -1,8 +1,8 @@import { toNumber } from 'lodash-es'/**- * @description 转化数字,将非数字转化为0- * @param val 值+ * @description Convert value to number, return 0 if not a number+ * @param val Value* @returns*/export const getNumber = (val: unknown) => {diff --git a/core/frontend/src/utils/is.ts b/core/frontend/src/utils/is.tsindex 8c590445..b307c074 100644--- a/core/frontend/src/utils/is.ts+++ b/core/frontend/src/utils/is.ts@@ -1,13 +1,13 @@/**- * @description: 判断值是否未某个类型+ * @description: Check if value is of a specific type*/export function is<T>(val: unknown, type: string): val is T {return Object.prototype.toString.call(val) === `[object ${type}]`}/**- * @description: 是否为对象- * @param { unknown } val 参数+ * @description: Check if value is an object+ * @param { unknown } val Parameter* @returns { boolean }*/export function isObject<T>(val: unknown): val is T {@@ -15,8 +15,8 @@ export function isObject<T>(val: unknown): val is T {}/**- * @description 是否为数字- * @param { unknown } val 参数+ * @description Check if value is a number+ * @param { unknown } val Parameter* @returns { boolean }*/export const isNumber = (val: unknown): val is number => {@@ -24,8 +24,8 @@ export const isNumber = (val: unknown): val is number => {}/**- * @description 是否为字符串- * @param { unknown } val 参数+ * @description Check if value is a string+ * @param { unknown } val Parameter* @returns { boolean }*/export const isString = (val: unknown): val is string => {@@ -33,8 +33,8 @@ export const isString = (val: unknown): val is string => {}/**- * @description 是否为函数- * @param { unknown } val 参数+ * @description Check if value is a function+ * @param { unknown } val Parameter* @returns { boolean }*/export const isFunction = <T = Function>(val: unknown): val is T => {@@ -42,8 +42,8 @@ export const isFunction = <T = Function>(val: unknown): val is T => {}/**- * @description 是否未定义- * @param { unknown } val 参数+ * @description Check if value is undefined+ * @param { unknown } val Parameter* @returns { boolean }*/export const isUndefined = (val: unknown): val is undefined => {@@ -51,8 +51,8 @@ export const isUndefined = (val: unknown): val is undefined => {}/**- * @description 是否为数组- * @param { unknown } val 参数+ * @description Check if value is an array+ * @param { unknown } val Parameter* @returns { boolean }*/export const isArray = <T = unknown>(val: unknown): val is T[] => {@@ -60,8 +60,8 @@ export const isArray = <T = unknown>(val: unknown): val is T[] => {}/**- * 判断是否为日期- * @param { unknown } val 参数+ * Check if value is a date+ * @param { unknown } val Parameter* @returns { boolean }*/export const isDate = (val: unknown): val is Date => {diff --git a/core/frontend/src/utils/storage.ts b/core/frontend/src/utils/storage.tsindex 9bcaa6e6..4d3adfb2 100644--- a/core/frontend/src/utils/storage.ts+++ b/core/frontend/src/utils/storage.ts@@ -1,8 +1,8 @@import { isObject } from './is'/**- * 获取数据- * @param { string } key 键名+ * Get data from localStorage+ * @param { string } key Key name* @return { string }*/export const getLocalStorage = <T = string>(key: string, defaultVal: T = '' as T): T => {@@ -15,9 +15,9 @@ export const getLocalStorage = <T = string>(key: string, defaultVal: T = '' as T}/**- * 存储数据- * @param { string } key 字段名- * @param { string } value 字段值+ * Store data in localStorage+ * @param { string } key Key name+ * @param { string } value Value* @return void*/export const setLocalStorage = (key: string, value?: string | number) => {@@ -25,8 +25,8 @@ export const setLocalStorage = (key: string, value?: string | number) => {}/**- * 删除数据或删除多个数据- * @param { string | string[] } key 键名+ * Delete one or multiple data from localStorage+ * @param { string | string[] } key Key name(s)* @return void*/export const delLocalStorage = (key: string | string[]) => {@@ -38,9 +38,9 @@ export const delLocalStorage = (key: string | string[]) => {}/**- * 设置cookie- * @param { string } key 键名- * @param { string } value 值+ * Set cookie+ * @param { string } key Key name+ * @param { string } value Value* @return void*/export const setCookie = (key: string, value: string) => {diff --git a/core/frontend/src/utils/time.ts b/core/frontend/src/utils/time.tsindex b9b0bcc0..46bd638c 100644--- a/core/frontend/src/utils/time.ts+++ b/core/frontend/src/utils/time.ts@@ -5,10 +5,10 @@ import { toNumber } from 'lodash-es'export type Time = Date | number | string/**- * @description 格式化时间格式- * @param time 时间戳 / 时间 Date / 时间字符串- * @param fmt 时间格式,可为空- * @returns { string } 格式化后的时间+ * @description Format time+ * @param time Timestamp / Date / Time string+ * @param fmt Time format, optional+ * @returns { string } Formatted time*/export const formatTime = (time?: Time, fmt = 'yyyy-MM-dd HH:mm:ss'): string => {if (isString(time)) {diff --git a/core/frontend/src/views/domain/components/DomainCatch.vue b/core/frontend/src/views/domain/components/DomainCatch.vuedeleted file mode 100644index 9378d314..00000000--- a/core/frontend/src/views/domain/components/DomainCatch.vue+++ /dev/null@@ -1,26 +0,0 @@-<template>- <modal title="捕获邮件" :width="540">- <div class="py-20px">- <bt-form :model="form">- <n-form-item label="转发邮件" :show-feedback="false">- <div class="w-290px">- <n-input v-model:value="form.email" placeholder="捕获不存在的邮件,转发至此邮件">- </n-input>- </div>- </n-form-item>- </bt-form>- </div>- </modal>-</template>--<script lang="ts" setup>-import { useModal } from '@/hooks/modal/useModal'--const form = reactive({- email: '',-})--const [Modal] = useModal({- onConfirm: async () => {},-})-</script>diff --git a/core/frontend/src/views/domain/components/DomainForm.vue b/core/frontend/src/views/domain/components/DomainForm.vueindex 8c3623cf..6550a060 100644--- a/core/frontend/src/views/domain/components/DomainForm.vue+++ b/core/frontend/src/views/domain/components/DomainForm.vue@@ -95,7 +95,7 @@ const rules: FormRules = {}/**- * @description 根据域名配额和单位,计算出字节数+ * @description Calculate the byte number based on the domain quota and unit* @param quota* @param quota_unit*/@@ -123,7 +123,6 @@ const [Modal, modalApi] = useModal({form.quota = getNumber(quota.split(' ')[0])form.quota_unit = quota.split(' ')[1]form.mailboxes = row.mailboxes- // form.email = row.email}} else {form.domain = ''@@ -131,7 +130,6 @@ const [Modal, modalApi] = useModal({form.quota = 5form.quota_unit = 'GB'form.mailboxes = 50- // form.email = ''}},onConfirm: async () => {diff --git a/core/frontend/src/views/domain/components/DomainSsl/OtherCert.vue b/core/frontend/src/views/domain/components/DomainSsl/OtherCert.vueindex 38ca0bb0..5a2832d8 100644--- a/core/frontend/src/views/domain/components/DomainSsl/OtherCert.vue+++ b/core/frontend/src/views/domain/components/DomainSsl/OtherCert.vue@@ -80,7 +80,6 @@ const certInfo = ref<DomainCertInfo>({cert_pem: '',})-// 数据const domains = computed(() => {return certInfo.value.dns || []})@@ -92,7 +91,7 @@ const getInfo = async () => {}}-// 保存证书+// Save certificateconst saveCertificate = async () => {await setSsl({domain: domain.domain,diff --git a/core/frontend/src/views/domain/index.vue b/core/frontend/src/views/domain/index.vueindex dc688893..d5f8d9bd 100644--- a/core/frontend/src/views/domain/index.vue+++ b/core/frontend/src/views/domain/index.vue@@ -18,7 +18,6 @@</template><template #modal><form-modal />- <catch-modal /><ssl-modal /><dns-modal /></template>@@ -35,7 +34,6 @@ import { deleteDomain, getDomainList } from '@/api/modules/domain'import type { MailDomain, MailDomainParams } from './interface'import DomainForm from './components/DomainForm.vue'-import DomainCatch from './components/DomainCatch.vue'import DomainSsl from './components/DomainSsl/index.vue'import DomainDns from './components/DomainDns.vue'@@ -177,10 +175,6 @@ const handleAddDomain = () => {formModalApi.open()}-const [CatchModal] = useModal({- component: DomainCatch,-})-// Handle open catch all// const handleOpenCatch = (row: MailDomain) => {// catchModalApi.setState({ row })diff --git a/core/frontend/src/views/mailbox/components/DomainSelect.vue b/core/frontend/src/views/mailbox/components/DomainSelect.vueindex 287a45b9..f13de7d1 100644--- a/core/frontend/src/views/mailbox/components/DomainSelect.vue+++ b/core/frontend/src/views/mailbox/components/DomainSelect.vue@@ -40,7 +40,7 @@ const getDomainSelect = async () => {label: item.domain,value: item.domain,}))- // 添加全部选项+ // Add all optionsif (isAll) {domainOptions.value.unshift({label: t('common.all.text'),diff --git a/core/frontend/src/views/mailbox/components/MailboxForm.vue b/core/frontend/src/views/mailbox/components/MailboxForm.vueindex 1aa575a4..7c250375 100644--- a/core/frontend/src/views/mailbox/components/MailboxForm.vue+++ b/core/frontend/src/views/mailbox/components/MailboxForm.vue@@ -118,7 +118,7 @@ const rules: FormRules = {}/**- * @description 根据域名配额和单位,计算出字节数+ * @description Calculate the byte number based on the domain quota and unit* @param quota* @param quota_unit*/