Skip to content

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

Create new enviroment file and mode

albertb8b5074eb4e6
diff --git a/core/frontend/.env.operation b/core/frontend/.env.operation
new file mode 100644
index 00000000..35d3ecfe
--- /dev/null
+++ b/core/frontend/.env.operation
@@ -0,0 +1,9 @@
+NODE_ENV = 'development'
+
+# API Prefix
+API_URL_PREFIX = '/api'
+
+SERVER_NAME = '192.168.10.35'
+
+# 35机器账户:Pm5XFO5M
+# 35机器密码:rjmieOH3
\ No newline at end of file
diff --git a/core/frontend/package.json b/core/frontend/package.json
index 0ee1b687..d7cd3458 100644
--- a/core/frontend/package.json
+++ b/core/frontend/package.json
@@ -6,6 +6,7 @@
"scripts": {
"build": "rsbuild build && node deploy.js",
"dev": "rsbuild dev --open",
+ "operation": "rsbuild dev RSBUILD_MODE=operation --open --mode=development",
"preview": "rsbuild preview",
"format": "prettier --write .",
"lint": "eslint . --ext .vue,.ts,.tsx",
diff --git a/core/frontend/src/views/domain/index.vue b/core/frontend/src/views/domain/index.vue
index 9591307e..ea34a2fd 100644
--- a/core/frontend/src/views/domain/index.vue
+++ b/core/frontend/src/views/domain/index.vue
@@ -15,11 +15,8 @@
</n-data-table>
</template>
<template #pageRight>
- <bt-table-page
- v-model:page="tableParams.page"
- v-model:page-size="tableParams.page_size"
- :item-count="tableTotal"
- @refresh="getTableData">
+ <bt-table-page v-model:page="tableParams.page" v-model:page-size="tableParams.page_size"
+ :item-count="tableTotal" @refresh="getTableData">
</bt-table-page>
</template>
<template #modal>
@@ -32,273 +29,284 @@
</template>
<script lang="tsx" setup>
-import { DataTableColumns, NFlex, NButton, NTag } from 'naive-ui'
-import { confirm, getByteUnit } from '@/utils'
-import { useModal } from '@/hooks/modal/useModal'
-import { useTableData } from '@/hooks/useTableData'
-import { deleteDomain, getDomainList, setDefaultDomain } from '@/api/modules/domain'
-import type { MailDomain, MailDomainParams } from './interface'
+ import { DataTableColumns, NFlex, NButton, NTag } from 'naive-ui'
+ import { confirm, getByteUnit } from '@/utils'
+ import { useModal } from '@/hooks/modal/useModal'
+ import { useTableData } from '@/hooks/useTableData'
+ import { deleteDomain, getDomainList, setDefaultDomain } from '@/api/modules/domain'
+ import type { MailDomain, MailDomainParams } from './interface'
-import DomainForm from './components/DomainForm.vue'
-import DomainSsl from './components/DomainSsl/index.vue'
-import DomainDns from './components/DomainDns.vue'
+ import DomainForm from './components/DomainForm.vue'
+ import DomainSsl from './components/DomainSsl/index.vue'
+ import DomainDns from './components/DomainDns.vue'
-const { t } = useI18n()
+ const { t } = useI18n()
-const { tableParams, tableList, loading, tableTotal, getTableData } = useTableData<
- MailDomain,
- MailDomainParams
->({
- immediate: true,
- params: {
- page: 1,
- page_size: 10,
- keyword: '',
- },
- fetchFn: getDomainList,
-})
+ const { tableParams, tableList, loading, tableTotal, getTableData } = useTableData<
+ MailDomain,
+ MailDomainParams
+ >({
+ immediate: true,
+ params: {
+ page: 1,
+ page_size: 10,
+ keyword: '',
+ },
+ fetchFn: getDomainList,
+ })
-const router = useRouter()
+ const router = useRouter()
-// Table columns
-const columns = ref<DataTableColumns<MailDomain>>([
- {
- key: 'domain',
- title: t('domain.columns.domain'),
- minWidth: 130,
- ellipsis: {
- tooltip: true,
+ // Table columns
+ const columns = ref<DataTableColumns<MailDomain>>([
+ {
+ key: 'domain',
+ title: t('domain.columns.domain'),
+ minWidth: 130,
+ ellipsis: {
+ tooltip: true,
+ },
+ render: row => {
+ return (
+ <>
+ <NButton
+ text
+ type="primary"
+ onClick={() => {
+ router.push({
+ path: '/mailbox',
+ state: { domain: row.domain },
+ })
+ }}>
+ {row.domain}
+ </NButton>
+ {row.default ? (
+ <NTag size="small" class="ml-8px" bordered={false}>
+ Default
+ </NTag>
+ ) : (
+ ''
+ )}
+ </>
+ )
+ },
+ },
+ {
+ key: 'quota',
+ title: t('domain.columns.quota'),
+ render: row => getByteUnit(row.quota),
+ },
+ {
+ key: 'mailboxes',
+ title: t('domain.columns.mailboxes'),
+ },
+ {
+ key: 'mailbox_quota',
+ title: t('domain.columns.defaultMailboxSize'),
+ render: row => getByteUnit(row.mailbox_quota),
},
- render: row => {
- return (
- <>
+ // {
+ // key: 'catch_all',
+ // title: 'Catch All',
+ // render: row => (
+ // <NSwitch
+ // value={row.catch_all}
+ // size="small"
+ // onUpdateValue={(val: boolean) => {
+ // if (val) {
+ // handleOpenCatch(row)
+ // } else {
+ // handleCloseCatch(row)
+ // }
+ // }}
+ // />
+ // ),
+ // },
+ {
+ key: 'ssl',
+ title: 'SSL',
+ render: row => {
+ if (row.cert_info && row.cert_info.endtime) {
+ const ssl = row.cert_info
+ const day = Math.floor((ssl.endtime * 1000 - Date.now()) / 1000 / 60 / 60 / 24)
+ return (
+ <NButton
+ type={day < 0 ? 'error' : 'primary'}
+ text
+ onClick={() => {
+ handleShowSsl(row)
+ }}>
+ {day < 0 ? t('domain.ssl.expired') : t('domain.ssl.daysLeft', { days: day })}
+ </NButton>
+ )
+ }
+ return (
<NButton
+ type="warning"
text
- type="primary"
onClick={() => {
- router.push({
- path: '/mailbox',
- state: { domain: row.domain },
- })
+ handleShowSsl(row)
}}>
- {row.domain}
+ {t('domain.ssl.notSet')}
</NButton>
- {row.default ? (
- <NTag size="small" class="ml-8px" bordered={false}>
- Default
- </NTag>
- ) : (
- ''
- )}
- </>
- )
+ )
+ },
},
- },
- {
- key: 'quota',
- title: t('domain.columns.quota'),
- render: row => getByteUnit(row.quota),
- },
- {
- key: 'mailboxes',
- title: t('domain.columns.mailboxes'),
- },
- {
- key: 'mailbox_quota',
- title: t('domain.columns.defaultMailboxSize'),
- render: row => getByteUnit(row.mailbox_quota),
- },
- // {
- // key: 'catch_all',
- // title: 'Catch All',
- // render: row => (
- // <NSwitch
- // value={row.catch_all}
- // size="small"
- // onUpdateValue={(val: boolean) => {
- // if (val) {
- // handleOpenCatch(row)
- // } else {
- // handleCloseCatch(row)
- // }
- // }}
- // />
- // ),
- // },
- {
- key: 'ssl',
- title: 'SSL',
- render: row => {
- if (row.cert_info && row.cert_info.endtime) {
- const ssl = row.cert_info
- const day = Math.floor((ssl.endtime * 1000 - Date.now()) / 1000 / 60 / 60 / 24)
- return (
+ {
+ title: t('domain.columns.actions'),
+ key: 'actions',
+ align: 'right',
+ width: 260,
+ render: row => (
+ <NFlex inline={true}>
<NButton
- type={day < 0 ? 'error' : 'primary'}
- text
+ type="primary"
+ text={true}
onClick={() => {
- handleShowSsl(row)
+ handleDNSRecord(row)
}}>
- {day < 0 ? t('domain.ssl.expired') : t('domain.ssl.daysLeft', { days: day })}
+ {t('domain.actions.dnsRecord')}
</NButton>
- )
- }
- return (
- <NButton
- type="warning"
- text
- onClick={() => {
- handleShowSsl(row)
- }}>
- {t('domain.ssl.notSet')}
- </NButton>
- )
+ <NButton
+ type="primary"
+ text={true}
+ onClick={() => {
+ handleEdit(row)
+ }}>
+ {t('common.actions.edit')}
+ </NButton>
+ <NButton
+ type="primary"
+ text={true}
+ disabled={row.default === 1}
+ onClick={() => {
+ handleSetDefault(row)
+ }}>
+ Set Default
+ </NButton>
+ <NButton
+ type="error"
+ text={true}
+ onClick={() => {
+ handleDelete(row)
+ }}>
+ {t('common.actions.delete')}
+ </NButton>
+ </NFlex>
+ ),
},
- },
- {
- title: t('domain.columns.actions'),
- key: 'actions',
- align: 'right',
- width: 260,
- render: row => (
- <NFlex inline={true}>
- <NButton
- type="primary"
- text={true}
- onClick={() => {
- handleDNSRecord(row)
- }}>
- {t('domain.actions.dnsRecord')}
- </NButton>
- <NButton
- type="primary"
- text={true}
- onClick={() => {
- handleEdit(row)
- }}>
- {t('common.actions.edit')}
- </NButton>
- <NButton
- type="primary"
- text={true}
- disabled={row.default === 1}
- onClick={() => {
- handleSetDefault(row)
- }}>
- Set Default
- </NButton>
- <NButton
- type="error"
- text={true}
- onClick={() => {
- handleDelete(row)
- }}>
- {t('common.actions.delete')}
- </NButton>
- </NFlex>
- ),
- },
-])
-
-const [FormModal, formModalApi] = useModal({
- component: DomainForm,
- state: {
- isEdit: false,
- refresh: getTableData,
- },
-})
+ ])
-// Handle add domain
-const handleAddDomain = () => {
- formModalApi.setState({
- row: null,
- isEdit: false,
+ const [FormModal, formModalApi] = useModal({
+ component: DomainForm,
+ state: {
+ isEdit: false,
+ refresh: getTableData,
+ },
})
- formModalApi.open()
-}
-// Handle open catch all
-// const handleOpenCatch = (row: MailDomain) => {
-// catchModalApi.setState({ row })
-// catchModalApi.open()
-// }
-
-// Handle close catch all
-// const handleCloseCatch = (row: MailDomain) => {
-// console.log(row)
-// }
-
-const [SslModal, sslModalApi] = useModal({
- component: DomainSsl,
- state: {
- refresh: getTableData,
- },
-})
-
-// Handle show ssl
-const handleShowSsl = (row: MailDomain) => {
- sslModalApi.setState({ row })
- sslModalApi.open()
-}
+ // Handle add domain
+ const handleAddDomain = () => {
+ formModalApi.setState({
+ row: null,
+ isEdit: false,
+ })
+ formModalApi.open()
+ }
-const [DnsModal, dnsModalApi] = useModal({
- component: DomainDns,
- state: {
- refresh: getTableData,
- },
-})
+ // Handle open catch all
+ // const handleOpenCatch = (row: MailDomain) => {
+ // catchModalApi.setState({ row })
+ // catchModalApi.open()
+ // }
-// Handle DNS records
-const handleDNSRecord = (row: MailDomain) => {
- dnsModalApi.setState({ row })
- dnsModalApi.open()
-}
+ // Handle close catch all
+ // const handleCloseCatch = (row: MailDomain) => {
+ // console.log(row)
+ // }
-const handleSetDefault = (row: MailDomain) => {
- confirm({
- title: `Set Default [${row.domain}]`,
- content: 'Are you sure to set this domain as default?',
- onConfirm: async () => {
- await setDefaultDomain({ domain: row.domain })
- getTableData()
+ const [SslModal, sslModalApi] = useModal({
+ component: DomainSsl,
+ state: {
+ refresh: getTableData,
},
})
-}
-// Handle edit
-const handleEdit = (row: MailDomain) => {
- formModalApi.setState({
- row,
- isEdit: true,
- })
- formModalApi.open()
-}
+ // Handle show ssl
+ const handleShowSsl = (row: MailDomain) => {
+ sslModalApi.setState({ row })
+ sslModalApi.open()
+ }
-// Handle delete
-const handleDelete = (row: MailDomain) => {
- confirm({
- title: t('domain.delete.title'),
- content: t('domain.delete.confirm', { domain: row.domain }),
- confirmText: t('common.actions.delete'),
- confirmType: 'error',
- onConfirm: async () => {
- await deleteDomain({ domain: row.domain })
- getTableData()
+ const [DnsModal, dnsModalApi] = useModal({
+ component: DomainDns,
+ state: {
+ refresh: getTableData,
},
})
-}
+
+ // Handle DNS records
+ const handleDNSRecord = (row: MailDomain) => {
+ dnsModalApi.setState({ row })
+ dnsModalApi.open()
+ }
+
+ const handleSetDefault = (row: MailDomain) => {
+ confirm({
+ title: `Set Default [${row.domain}]`,
+ content: 'Are you sure to set this domain as default?',
+ onConfirm: async () => {
+ await setDefaultDomain({ domain: row.domain })
+ getTableData()
+ },
+ })
+ }
+
+ // Handle edit
+ const handleEdit = (row: MailDomain) => {
+ /**
+ * formModalApi.setState({
+ row,
+ isEdit: true,
+ })
+ formModalApi.open()
+ */
+
+ router.push({
+ name: "EditDomain",
+ params: {
+ domain: row.domain
+ }
+ })
+
+
+ }
+
+ // Handle delete
+ const handleDelete = (row: MailDomain) => {
+ confirm({
+ title: t('domain.delete.title'),
+ content: t('domain.delete.confirm', { domain: row.domain }),
+ confirmText: t('common.actions.delete'),
+ confirmType: 'error',
+ onConfirm: async () => {
+ await deleteDomain({ domain: row.domain })
+ getTableData()
+ },
+ })
+ }
</script>
<style lang="scss" scoped>
-.domain-container {
- padding: 16px;
- background-color: #fff;
- border-radius: 3px;
+ .domain-container {
+ padding: 16px;
+ background-color: #fff;
+ border-radius: 3px;
- .action-bar {
- display: flex;
- justify-content: space-between;
- margin-bottom: 16px;
+ .action-bar {
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 16px;
+ }
}
-}
</style>
diff --git a/core/frontend/src/views/domain/pages/editDomain/components/DomainConfiguration.vue b/core/frontend/src/views/domain/pages/editDomain/components/DomainConfiguration.vue
index e5333b5c..8e1ec499 100644
--- a/core/frontend/src/views/domain/pages/editDomain/components/DomainConfiguration.vue
+++ b/core/frontend/src/views/domain/pages/editDomain/components/DomainConfiguration.vue
@@ -1,16 +1,19 @@
<template>
<div class="content-wrapper">
- <n-card>
+ <n-card class="mb-5">
<!-- title -->
<div class="page-tit">
- <div class="back-tool">
- <i class="i-cuida:mail-outline text-7"></i>
+ <div class="left-tit">
+ <div class="back-tool">
+ <i class="i-cuida:mail-outline text-7"></i>
+ </div>
+ <span class="tit-content">
+ Mail Domain Configuration
+ </span>
</div>
- <span class="tit-content">
- Mail Domain Configuration
- </span>
</div>
-
+ </n-card>
+ <n-card>
<!-- form data -->
<n-form>
<n-form-item>
@@ -46,13 +49,15 @@
<n-card>
<!-- title -->
- <div class="page-tit">
- <div class="back-tool">
- <i class="i-ri:rss-fill text-6"></i>
+ <div class="page-tit mb-5">
+ <div class="left-tit">
+ <div class="back-tool">
+ <i class="i-ri:rss-fill text-6"></i>
+ </div>
+ <span class="tit-content">
+ Subscription Management
+ </span>
</div>
- <span class="tit-content">
- Subscription Management
- </span>
</div>
<div class="switch-settings">
@@ -92,6 +97,7 @@
.content-wrapper {
@include mixin.content-wrapper;
+
// title
.page-tit {
@include mixin.page-tit;
diff --git a/core/frontend/yarn.lock b/core/frontend/yarn.lock
index 820e7b97..e88496a2 100644
--- a/core/frontend/yarn.lock
+++ b/core/frontend/yarn.lock
@@ -2966,6 +2966,11 @@ giget@^2.0.0:
nypm "^0.6.0"
pathe "^2.0.3"
+github-markdown-css@^5.8.1:
+ version "5.8.1"
+ resolved "https://registry.yarnpkg.com/github-markdown-css/-/github-markdown-css-5.8.1.tgz#2a53cf17f0c9bde5ff9e83710a3310a02f5278a7"
+ integrity sha512-8G+PFvqigBQSWLQjyzgpa2ThD9bo7+kDsriUIidGcRhXgmcaAWUIpCZf8DavJgc+xifjbCG+GvMyWr0XMXmc7g==
+
glob-parent@^5.1.2, glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
@@ -3472,6 +3477,11 @@ markdown-it@^14.1.0:
punycode.js "^2.3.1"
uc.micro "^2.1.0"
+marked@^16.0.0:
+ version "16.0.0"
+ resolved "https://registry.yarnpkg.com/marked/-/marked-16.0.0.tgz#0c48e79782f26224f8ce34878644d8c320ad599f"
+ integrity sha512-MUKMXDjsD/eptB7GPzxo4xcnLS6oo7/RHimUMHEDRhUooPwmN9BEpMl7AEOJv3bmso169wHI2wUF9VQgL7zfmA==
+
math-intrinsics@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9"