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
Add Overview and Login page
zdmc22f76aa1f85
diff --git a/core/frontend/index.html b/core/frontend/index.htmlindex f4bc227a..9605869c 100644--- a/core/frontend/index.html+++ b/core/frontend/index.html@@ -7,7 +7,7 @@<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" /><link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /><meta name="naive-ui-style" />- <title>aaPanel Linux Panel</title>+ <title>Billion Mail</title></head><body><div id="root"></div>diff --git a/core/frontend/package.json b/core/frontend/package.jsonindex 57678c0f..f1557594 100644--- a/core/frontend/package.json+++ b/core/frontend/package.json@@ -15,6 +15,7 @@"@unocss/reset": "66.1.0-beta.7","@vueuse/core": "^13.0.0","date-fns": "^4.1.0",+ "echarts": "^5.6.0","lodash-es": "^4.17.21","pinia": "^3.0.1","pinia-plugin-persistedstate": "^4.2.0",diff --git a/core/frontend/pnpm-lock.yaml b/core/frontend/pnpm-lock.yamlindex db28fdd9..9809a2c7 100644--- a/core/frontend/pnpm-lock.yaml+++ b/core/frontend/pnpm-lock.yaml@@ -17,6 +17,9 @@ importers:date-fns:specifier: ^4.1.0version: 4.1.0+ echarts:+ specifier: ^5.6.0+ version: 5.6.0lodash-es:specifier: ^4.17.21version: 4.17.21@@ -1392,6 +1395,9 @@ packages:resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==}+ resolution: {integrity: sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==}+resolution: {integrity: sha512-refir3NlutEZqlKaBLK0tzlVLe5P2wDKS7UQt/3SpibizgsRAPOsqQC3ffw1nlv3ze5gjRQZYHoPymgVZkplFA==}@@ -2293,6 +2299,9 @@ packages:peerDependencies:typescript: '>=4.8.4'+ resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==}+resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}@@ -2538,6 +2547,9 @@ packages:resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}engines: {node: '>=10'}+ resolution: {integrity: sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==}+snapshots:'@ampproject/[email protected]':@@ -3955,6 +3967,11 @@ snapshots:+ dependencies:+ tslib: 2.3.0+ zrender: 5.6.1+@@ -4814,6 +4831,8 @@ snapshots:dependencies:typescript: 5.8.2+ [email protected]: {}+@@ -5093,3 +5112,7 @@ snapshots:++ dependencies:+ tslib: 2.3.0diff --git a/core/frontend/src/App.vue b/core/frontend/src/App.vueindex 497d4700..090138af 100644--- a/core/frontend/src/App.vue+++ b/core/frontend/src/App.vue@@ -1,3 +1,5 @@<template>- <router-view></router-view>+ <config-provider>+ <router-view></router-view>+ </config-provider></template>diff --git a/core/frontend/src/components/config-provider/index.vue b/core/frontend/src/components/config-provider/index.vueindex 1ee70c9d..562fb0a2 100644--- a/core/frontend/src/components/config-provider/index.vue+++ b/core/frontend/src/components/config-provider/index.vue@@ -1,5 +1,31 @@<template>- <n-config-provider abstract inline-theme-disabled>+ <n-config-provider abstract inline-theme-disabled :theme-overrides="themeOverrides"><slot></slot></n-config-provider></template>++<script lang="ts" setup>+const themeOverrides = {+ common: {+ lineHeight: 'normal',+ fontSize: '12px',+ fontSizeSmall: '12px',+ fontSizeMedium: '12px',+ fontSizeLarge: '14px',+ borderRadius: '4px',+ primaryColor: '#20A53A',+ primaryColorHover: '#1D9534',+ successColor: '#20A53A',+ successColorHover: '#1D9534',+ },+ Layout: {+ color: '#f4f7fa',+ textColor: '#333',+ headerColor: 'rgba(244, 247, 250, 0.7)',+ headerTextColor: '#5b6b79',+ },+ Menu: {+ fontSize: '14px',+ },+}+</script>diff --git a/core/frontend/src/components/v-charts/index.vue b/core/frontend/src/components/v-charts/index.vuenew file mode 100644index 00000000..f14943ea--- /dev/null+++ b/core/frontend/src/components/v-charts/index.vue@@ -0,0 +1,140 @@+<template>+ <div ref="chartRef" :style="{ width: '100%', height: chartHeight }"></div>+</template>++<script setup>+// 按需引入echarts核心模块+import * as echarts from 'echarts/core'+// 按需引入图表类型,以下是常用图表示例,请根据实际需要修改+import { BarChart, LineChart } from 'echarts/charts'+// 引入提示框、标题、直角坐标系、数据集等组件+import {+ TitleComponent,+ TooltipComponent,+ GridComponent,+ DatasetComponent,+ TransformComponent,+ LegendComponent,+} from 'echarts/components'+// 引入Canvas渲染器+import { CanvasRenderer } from 'echarts/renderers'++// 注册必须的组件+echarts.use([+ TitleComponent,+ TooltipComponent,+ GridComponent,+ DatasetComponent,+ TransformComponent,+ LegendComponent,+ BarChart,+ LineChart,+ CanvasRenderer,+])++const props = defineProps({+ options: {+ type: Object,+ required: true,+ },+ height: {+ type: [String, Number],+ default: '100%',+ },+ theme: {+ type: String,+ default: 'default',+ },+ // 控制是否合并新旧配置+ notMerge: {+ type: Boolean,+ default: false,+ },+ // 更新时是否不显示过渡动画+ lazyUpdate: {+ type: Boolean,+ default: false,+ },+})++const chartRef = ref(null)++const chartHeight = computed(() => {+ return typeof props.height === 'number' ? `${props.height}px` : props.height+})++let chartInstance = null+let resizeObserver = null++const initChart = () => {+ if (chartRef.value) {+ // 使用主题并添加渲染器选项,提高渲染性能+ chartInstance = echarts.init(chartRef.value, props.theme, {+ renderer: 'canvas',+ useDirtyRect: true, // 使用脏矩形渲染提高性能+ })++ // 初始设置选项+ updateChart()++ // 使用ResizeObserver代替window事件,提高性能+ resizeObserver = new ResizeObserver(() => {+ requestAnimationFrame(() => {+ chartInstance?.resize()+ })+ })++ resizeObserver.observe(chartRef.value)+ }+}++// 更新图表的方法,与初始化分离+const updateChart = () => {+ if (!chartInstance || !props.options) return++ // 使用notMerge和lazyUpdate提高更新性能+ chartInstance.setOption(props.options, {+ notMerge: props.notMerge,+ lazyUpdate: props.lazyUpdate,+ })+}++onMounted(() => {+ initChart()+})++onUnmounted(() => {+ // 清理所有资源+ resizeObserver?.disconnect()+ if (chartInstance) {+ chartInstance.dispose()+ chartInstance = null+ }+})++// 使用深度监听优化图表更新+watch(+ () => props.options,+ () => {+ updateChart()+ },+ { deep: true }+)++// 主题变化时重新初始化图表+watch(+ () => props.theme,+ () => {+ if (chartInstance) {+ chartInstance.dispose()+ initChart()+ }+ }+)++// 导出图表实例,使父组件可以访问更多方法+defineExpose({+ getChartInstance: () => chartInstance,+ resize: () => chartInstance?.resize(),+})+</script>diff --git a/core/frontend/src/layout/components/AppHeader.vue b/core/frontend/src/layout/components/AppHeader.vuenew file mode 100644index 00000000..d2c195e9--- /dev/null+++ b/core/frontend/src/layout/components/AppHeader.vue@@ -0,0 +1,82 @@+<template>+ <n-layout-header ref="headerRef" :style="{ top: `${top}px` }">+ <div class="header-left">+ <n-button class="icon-btn" :bordered="false">+ <i class="icon i-mdi-menu-open"></i>+ </n-button>+ <div class="text-16px">{{ routeTitle }}</div>+ </div>++ <div class="header-right">+ <n-button class="icon-btn" :bordered="false">+ <i class="icon i-mdi-language"></i>+ </n-button>+ <n-dropdown :options="userOptions" @select="handleUserAction">+ <n-button class="icon-btn" :bordered="false">+ <i class="icon i-mdi-user-outline"></i>+ </n-button>+ </n-dropdown>+ </div>+ </n-layout-header>+</template>++<script lang="ts" setup>+defineProps({+ top: {+ type: Number,+ default: 0,+ },+})++const route = useRoute()++const routeTitle = computed(() => {+ return `${route.meta.title}`+})++const userOptions = [+ {+ label: 'Logout',+ key: 'logout',+ },+]++const handleUserAction = (key: string) => {+ switch (key) {+ case 'logout':+ break+ }+}+</script>++<style lang="scss" scoped>+.n-layout-header {+ position: absolute;+ top: 0;+ left: 0;+ right: 0;+ display: flex;+ justify-content: space-between;+ align-items: center;+ height: 72px;+ padding: 0 24px;+ backdrop-filter: blur(7px);+ z-index: 1000;+}++.header-left,+.header-right {+ display: flex;+ align-items: center;+ gap: 8px;+}++.icon-btn {+ --n-width: 44px;+ --n-height: 44px;+ --n-padding: 0;+ --n-font-size: 24px;+ --n-text-color: #5b6b79;+ --n-ripple-color: none;+}+</style>diff --git a/core/frontend/src/layout/components/AppMain.vue b/core/frontend/src/layout/components/AppMain.vueindex aa2e4a1f..4c53d1f5 100644--- a/core/frontend/src/layout/components/AppMain.vue+++ b/core/frontend/src/layout/components/AppMain.vue@@ -1,9 +1,7 @@<template>- <div>- <router-view :key="key" v-slot="{ Component, route }">- <component :is="Component" :key="route.path" />- </router-view>- </div>+ <router-view :key="key" v-slot="{ Component, route }">+ <component :is="Component" :key="route.path" />+ </router-view></template><script lang="ts" setup>diff --git a/core/frontend/src/layout/components/Header/index.vue b/core/frontend/src/layout/components/Header/index.vuedeleted file mode 100644index 42f9375d..00000000--- a/core/frontend/src/layout/components/Header/index.vue+++ /dev/null@@ -1,5 +0,0 @@-<template>- <div>aaaa</div>-</template>--<script lang="ts" setup></script>diff --git a/core/frontend/src/layout/components/Sidebar.vue b/core/frontend/src/layout/components/Sidebar.vueindex 05e4a311..b12d9fa2 100644--- a/core/frontend/src/layout/components/Sidebar.vue+++ b/core/frontend/src/layout/components/Sidebar.vue@@ -17,7 +17,7 @@<!-- 导航菜单 --><div class="nav-section">- <n-menu :value="activeMenuKey" :options="menuOptions" :root-indent="20"> </n-menu>+ <n-menu :value="activeMenuKey" :options="menuOptions" :root-indent="24"> </n-menu></div></n-layout-sider></template>@@ -53,8 +53,8 @@ const renderLabel = (route: RouteRecordRaw) => {const name = route.children?.[0]?.name || ''return (<RouterLink class="flex items-center" to={{ name }}>- <span class={`i-mdi-${route.meta?.icon || ''} text-22px`}></span>- <span class="ml-16px">{route.meta?.title || ''}</span>+ <span class={`${route.meta?.icon || ''} text-22px`}></span>+ <span class="ml-14px">{route.meta?.title || ''}</span></RouterLink>)}@@ -64,11 +64,12 @@ onMounted(() => {})</script>-<style scoped>+<style lang="scss" scoped>.n-layout-sider {--n-color: #3f4d67;--n-text-color: #fff;box-shadow: 1px 0 20px 0 #3f4d67;+ z-index: 1010;}.app-logo {@@ -107,8 +108,8 @@ onMounted(() => {:deep(.n-menu-item) {margin-top: 0;.n-menu-item-content {- padding-right: 20px;- line-height: 1;+ padding-right: 24px;+ line-height: inherit;&::before {left: 0;right: 0;@@ -126,7 +127,7 @@ onMounted(() => {&.n-menu-item-content--selected {font-weight: 500;&::after {- background-color: #04a9f5;+ background-color: #20a53a;}}}diff --git a/core/frontend/src/layout/components/index.ts b/core/frontend/src/layout/components/index.tsindex 68a1b814..5237387b 100644--- a/core/frontend/src/layout/components/index.ts+++ b/core/frontend/src/layout/components/index.ts@@ -1,3 +1,3 @@export { default as Sidebar } from './Sidebar.vue'export { default as AppMain } from './AppMain.vue'-export { default as AppHeader } from './Header/index.vue'+export { default as AppHeader } from './AppHeader.vue'diff --git a/core/frontend/src/layout/index.vue b/core/frontend/src/layout/index.vueindex c185673c..dc24508b 100644--- a/core/frontend/src/layout/index.vue+++ b/core/frontend/src/layout/index.vue@@ -1,15 +1,19 @@<template>- <config-provider>- <n-layout class="w-full h-full" has-sider>- <sidebar></sidebar>- <n-layout>- <app-header></app-header>- <app-main></app-main>- </n-layout>+ <n-layout class="w-full h-full" has-sider>+ <sidebar></sidebar>+ <n-layout :content-style="{ position: 'relative', paddingTop: '74px' }" @scroll="handleScroll">+ <app-header :top="scrollTop"></app-header>+ <app-main></app-main></n-layout>- </config-provider>+ </n-layout></template><script lang="ts" setup>import { Sidebar, AppHeader, AppMain } from './components'++const scrollTop = ref(0)++const handleScroll = (e: Event) => {+ scrollTop.value = (e.target as HTMLElement).scrollTop || 0+}</script>diff --git a/core/frontend/src/router/modules/automation.ts b/core/frontend/src/router/modules/automation.tsindex f660404d..bf8b501b 100644--- a/core/frontend/src/router/modules/automation.ts+++ b/core/frontend/src/router/modules/automation.ts@@ -4,7 +4,13 @@ import { Layout } from '@/router/constant'const route: RouteRecordRaw = {path: '/automation',component: Layout,- meta: { sort: 3, key: 'automation', title: 'Automation', icon: 'refresh-auto', hidden: true },+ meta: {+ sort: 3,+ key: 'automation',+ title: 'Automation',+ icon: 'i-mdi-refresh-auto',+ hidden: true,+ },children: [{path: '/automation',diff --git a/core/frontend/src/router/modules/contacts.ts b/core/frontend/src/router/modules/contacts.tsindex 94ccf903..09171882 100644--- a/core/frontend/src/router/modules/contacts.ts+++ b/core/frontend/src/router/modules/contacts.ts@@ -4,7 +4,7 @@ import { Layout } from '@/router/constant'const route: RouteRecordRaw = {path: '/contacts',component: Layout,- meta: { sort: 4, key: 'contacts', title: 'Contacts', icon: 'user-multiple-outline' },+ meta: { sort: 4, key: 'contacts', title: 'Contacts', icon: 'i-mdi-user-multiple-outline' },children: [{path: '/contacts',diff --git a/core/frontend/src/router/modules/domain.ts b/core/frontend/src/router/modules/domain.tsindex d3b5af69..1e9efd1f 100644--- a/core/frontend/src/router/modules/domain.ts+++ b/core/frontend/src/router/modules/domain.ts@@ -4,7 +4,7 @@ import { Layout } from '@/router/constant'const route: RouteRecordRaw = {path: '/domain',component: Layout,- meta: { sort: 5, key: 'domain', title: 'MailDomain', icon: 'web' },+ meta: { sort: 5, key: 'domain', title: 'MailDomain', icon: 'i-mdi-web' },children: [{path: '/domain',diff --git a/core/frontend/src/router/modules/mailbox.ts b/core/frontend/src/router/modules/mailbox.tsindex 92c48d73..6c0bcb4a 100644--- a/core/frontend/src/router/modules/mailbox.ts+++ b/core/frontend/src/router/modules/mailbox.ts@@ -4,7 +4,7 @@ import { Layout } from '@/router/constant'const route: RouteRecordRaw = {path: '/mailbox',component: Layout,- meta: { sort: 6, key: 'mailbox', title: 'MailBoxes', icon: 'at' },+ meta: { sort: 6, key: 'mailbox', title: 'MailBoxes', icon: 'i-mdi-at' },children: [{path: '/mailbox',diff --git a/core/frontend/src/router/modules/market.ts b/core/frontend/src/router/modules/market.tsindex ec0e5546..c22cf90d 100644--- a/core/frontend/src/router/modules/market.ts+++ b/core/frontend/src/router/modules/market.ts@@ -8,7 +8,7 @@ const route: RouteRecordRaw = {sort: 2,key: 'market',title: 'Email Marketing',- icon: 'email-fast-outline',+ icon: 'i-mdi-email-fast-outline',hidden: true,},children: [diff --git a/core/frontend/src/router/modules/settings.ts b/core/frontend/src/router/modules/settings.tsindex 00f2b0ca..b03dc4bf 100644--- a/core/frontend/src/router/modules/settings.ts+++ b/core/frontend/src/router/modules/settings.ts@@ -4,7 +4,7 @@ import { Layout } from '@/router/constant'const route: RouteRecordRaw = {path: '/settings',component: Layout,- meta: { sort: 7, key: 'settings', title: 'Settings', icon: 'settings-outline' },+ meta: { sort: 7, key: 'settings', title: 'Settings', icon: 'i-mdi-settings-outline' },children: [{path: '/settings',diff --git a/core/frontend/src/router/router.ts b/core/frontend/src/router/router.tsindex 8b61ddf5..afa6fab8 100644--- a/core/frontend/src/router/router.ts+++ b/core/frontend/src/router/router.ts@@ -1,6 +1,6 @@import { get } from 'lodash-es'import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'-import { is } from '@/utils/is'+import { is } from '@/utils'import { Layout } from '@/router/constant'// 从模块中导入路由@@ -36,7 +36,7 @@ const dashboardRouter: RouteRecordRaw = {keepAlive: true,key: 'overview',title: 'Overview',- icon: 'home-outline',+ icon: 'i-mdi-home-outline',},children: [{@@ -49,7 +49,14 @@ const dashboardRouter: RouteRecordRaw = {menuList.unshift(dashboardRouter)-export const routes: RouteRecordRaw[] = [...menuList]+export const routes: RouteRecordRaw[] = [+ {+ path: '/login',+ name: 'Login',+ component: () => import('@/views/login/index.vue'),+ },+ ...menuList,+]const router = createRouter({history: createWebHistory('/'),diff --git a/core/frontend/src/styles/index.scss b/core/frontend/src/styles/index.scssindex 052f41b2..d9edf1fa 100644--- a/core/frontend/src/styles/index.scss+++ b/core/frontend/src/styles/index.scss@@ -1,2 +1,3 @@@import './reset.scss';+@import './naive.scss';@import './public.scss';diff --git a/core/frontend/src/styles/naive.scss b/core/frontend/src/styles/naive.scssnew file mode 100644index 00000000..99d2251b--- /dev/null+++ b/core/frontend/src/styles/naive.scss@@ -0,0 +1,4 @@+div.n-card {+ --n-border-radius: 0px;+ box-shadow: 0 1px 20px 0 rgba(69, 90, 100, 0.08);+}diff --git a/core/frontend/src/styles/reset.scss b/core/frontend/src/styles/reset.scssindex 310ae976..50fcb8c9 100644--- a/core/frontend/src/styles/reset.scss+++ b/core/frontend/src/styles/reset.scss@@ -13,7 +13,7 @@ body,body {min-width: 1100px;margin: 0;- line-height: 1.4;+ line-height: 1.2;font-size: 12px;color: #333;font-family: 'Open Sans', sans-serif;@@ -26,3 +26,7 @@ input[type='password']::-ms-reveal {a {text-decoration: none;}++p {+ margin: 0;+}diff --git a/core/frontend/src/utils/index.ts b/core/frontend/src/utils/index.tsnew file mode 100644index 00000000..9e95a308--- /dev/null+++ b/core/frontend/src/utils/index.ts@@ -0,0 +1 @@+export * from './is'diff --git a/core/frontend/src/views/domain/index.vue b/core/frontend/src/views/domain/index.vueindex 575c2aa5..6f69fbd2 100644--- a/core/frontend/src/views/domain/index.vue+++ b/core/frontend/src/views/domain/index.vue@@ -1,5 +1,150 @@<template>- <div>aaaaa</div>+ <div class="py-16px px-24px">+ <n-card :bordered="false">+ <n-flex class="mb-16px" justify="space-between">+ <div>+ <n-button type="primary" @click="handleAddDomain">添加域名</n-button>+ </div>+ <div>+ <n-button class="refresh-btn" @click="refreshDomainRecord">刷新域名记录</n-button>+ </div>+ </n-flex>+ <n-data-table :columns="columns" :data="domainData"> </n-data-table>+ </n-card>+ </div></template>-<script lang="ts" setup></script>+<script lang="tsx" setup>+import { DataTableColumns, NFlex, NButton, NSwitch } from 'naive-ui'++// 域名数据+const domainData = ref([+ {+ name: 'lotkfc.cn',+ quota: '10.00 GB',+ mailboxes: 50,+ defaultSize: '5.00 GB',+ catchAll: false,+ ssl: { status: '过期于82天', type: 'warning' },+ id: 1,+ },+ {+ name: 'aaa.text',+ quota: '5.00 GB',+ mailboxes: 50,+ defaultSize: '5.00 GB',+ catchAll: false,+ ssl: { status: '未设置', type: 'error' },+ id: 2,+ },+ {+ name: 'aapanel.store',+ quota: '5.00 GB',+ mailboxes: 50000,+ defaultSize: '5.00 GB',+ catchAll: false,+ ssl: { status: '未设置', type: 'error' },+ id: 3,+ },+ {+ name: 'lootk.cn',+ quota: '20.00 MB',+ mailboxes: 50000,+ defaultSize: '5.00 GB',+ catchAll: false,+ ssl: { status: '过期于82天', type: 'warning' },+ id: 4,+ },+])++// 表格列定义+const columns = ref<DataTableColumns>([+ {+ key: 'name',+ title: '域名',+ },+ {+ title: '配额',+ key: 'quota',+ },+ {+ title: '邮箱数',+ key: 'mailboxes',+ },+ {+ title: '默认邮箱大小',+ key: 'defaultSize',+ },+ {+ title: 'Catch All',+ key: 'catchAll',+ render: () => <NSwitch size="small"></NSwitch>,+ },+ {+ key: 'ssl',+ title: 'SSL',+ },+ {+ title: '操作',+ key: 'actions',+ align: 'right',+ render: () => (+ <NFlex inline={true}>+ <NButton+ type="primary"+ text={true}+ onClick={() => {+ handleDNSRecord()+ }}>+ DNS记录+ </NButton>+ <NButton+ type="primary"+ text={true}+ onClick={() => {+ handleEdit()+ }}>+ 编辑+ </NButton>+ <NButton+ type="error"+ text={true}+ onClick={() => {+ handleDelete()+ }}>+ 删除+ </NButton>+ </NFlex>+ ),+ },+])++// 处理添加域名+const handleAddDomain = () => {}++// 刷新域名记录+const refreshDomainRecord = () => {}++// 处理DNS记录+const handleDNSRecord = () => {}++// 处理编辑+const handleEdit = () => {}++// 处理删除+const handleDelete = () => {}+</script>++<style lang="scss" scoped>+.domain-container {+ padding: 16px;+ background-color: #fff;+ border-radius: 3px;++ .action-bar {+ display: flex;+ justify-content: space-between;+ margin-bottom: 16px;+ }+}+</style>diff --git a/core/frontend/src/views/login/index.vue b/core/frontend/src/views/login/index.vuenew file mode 100644index 00000000..e813b56f--- /dev/null+++ b/core/frontend/src/views/login/index.vue@@ -0,0 +1,132 @@+<template>+ <div class="login-container">+ <div class="login-card">+ <div class="logo-container">+ <div class="logo">+ <svg viewBox="0 0 24 24" class="logo-icon">+ <path+ d="M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z"+ fill="currentColor" />+ </svg>+ </div>+ </div>++ <h2 class="login-title">Billion Mail</h2>++ <n-form size="large">+ <n-form-item :show-label="false">+ <n-input v-model:value="form.username" placeholder="Username"></n-input>+ </n-form-item>+ <n-form-item :show-label="false">+ <n-input+ v-model:value="form.password"+ type="password"+ placeholder="Password"+ show-password-on="click">+ </n-input>+ </n-form-item>++ <n-button type="primary" size="large" block @click="handleLogin">Login</n-button>+ </n-form>+ </div>+ </div>+</template>++<script setup>+const form = reactive({+ username: '',+ password: '',+})++const handleLogin = () => {}+</script>++<style lang="scss" scoped>+.login-container {+ --primary-color: #00b9f5;+ --primary-hover: #0095c8;+ --text-dark: #333;+ --text-light: #666;+ --accent-green: #25cdb1;+ --accent-purple: #7e6ed5;+ --border-light: #ddd;+}++.login-container {+ display: flex;+ justify-content: center;+ align-items: center;+ min-height: 100vh;+ background: linear-gradient(135deg, #f0f3ff 0%, #e5f8f7 100%);+ position: relative;+ overflow: hidden;+ &::before {+ content: '';+ position: absolute;+ width: 40vw;+ height: 40vw;+ border-radius: 50%;+ background-color: var(--accent-green);+ top: -15vh;+ right: -15vw;+ z-index: 0;+ }+ &::after {+ content: '';+ position: absolute;+ width: 40vw;+ height: 40vw;+ border-radius: 50%;+ background-color: var(--accent-purple);+ bottom: -15vh;+ left: -15vw;+ z-index: 0;+ }+}++.login-card {+ background-color: white;+ padding: 52px 32px 62px;+ border-radius: 8px;+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);+ width: 100%;+ max-width: 400px;+ z-index: 1;+}++.logo {+ display: flex;+ align-items: center;+ justify-content: center;+ width: 40px;+ height: 40px;+ background-color: var(--primary-color);+ border-radius: 5px;++ &-container {+ display: flex;+ align-items: center;+ justify-content: center;+ margin-bottom: 24px;+ }++ &-icon {+ width: 24px;+ height: 24px;+ color: white;+ }++ &-text {+ font-size: 20px;+ font-weight: 600;+ color: var(--text-dark);+ }+}++.login-title {+ margin-bottom: 32px;+ text-align: center;+ font-weight: 500;+ color: var(--text-dark);+}+</style>diff --git a/core/frontend/src/views/overview/components/BarChart.vue b/core/frontend/src/views/overview/components/BarChart.vuenew file mode 100644index 00000000..fb966316--- /dev/null+++ b/core/frontend/src/views/overview/components/BarChart.vue@@ -0,0 +1,44 @@+<template>+ <v-charts :options="chartOptions" />+</template>++<script setup lang="ts">+const props = defineProps({+ chartData: {+ type: Object,+ required: true,+ },+})++const chartOptions = computed(() => {+ return {+ grid: {+ top: '4%',+ left: '4%',+ right: '4%',+ bottom: '0',+ containLabel: true,+ },+ xAxis: {+ type: 'category',+ data: props.chartData.labels,+ axisTick: {+ alignWithLabel: true,+ },+ },+ yAxis: {+ type: 'value',+ },+ series: [+ {+ type: 'bar',+ barWidth: '60%',+ data: props.chartData.values,+ itemStyle: {+ color: '#6979F8',+ },+ },+ ],+ }+})+</script>diff --git a/core/frontend/src/views/overview/components/FilterBar.vue b/core/frontend/src/views/overview/components/FilterBar.vuenew file mode 100644index 00000000..42f780cb--- /dev/null+++ b/core/frontend/src/views/overview/components/FilterBar.vue@@ -0,0 +1,87 @@+<template>+ <div class="filter-bar">+ <div class="w-260px">+ <n-select v-model:value="selectedDomain" :options="domainOptions"></n-select>+ </div>++ <div class="date-filters">+ <n-radio-group v-model:value="activeFilter" @update:value="setFilter">+ <n-radio-button value="today">Today</n-radio-button>+ <n-radio-button value="yesterday">Yesterday</n-radio-button>+ <n-radio-button value="last7days">Last 7 Days</n-radio-button>+ </n-radio-group>+ <div class="w-240px">+ <n-date-picker+ :value="dateRange"+ type="daterange"+ :is-date-disabled="dateDisabled"+ @update:value="onUpdateTime">+ </n-date-picker>+ </div>+ </div>+ </div>+</template>++<script setup lang="ts">+import { addDays, startOfDay, endOfDay } from 'date-fns'++const selectedDomain = ref('all')++const domainOptions = ref([{ label: 'All Domains', value: 'all' }])++const activeFilter = ref('today')++const dateRange = ref(getTimeData())++function getTimeData(date = new Date()): [number, number] {+ const start = startOfDay(date)+ const end = endOfDay(date)+ return [start.getTime(), end.getTime()]+}++const dateDisabled = (ts: number) => {+ const today = new Date()+ const before = addDays(today, -30)+ return startOfDay(before).getTime() > ts || endOfDay(today).getTime() < ts+}++const setFilter = (filter: string) => {+ switch (filter) {+ case 'today':+ dateRange.value = getTimeData()+ break+ case 'yesterday':+ dateRange.value = getTimeData(addDays(new Date(), -1))+ break+ case 'last7days':+ dateRange.value = getSevenTime()+ break+ }+}++const getSevenTime = (): [number, number] => {+ const today = new Date()+ const end = endOfDay(today)+ const start = startOfDay(addDays(today, -6))++ return [start.getTime(), end.getTime()]+}++const onUpdateTime = (val: [number, number]) => {+ activeFilter.value = 'custom'+ dateRange.value = [startOfDay(val[0]).getTime(), endOfDay(val[1]).getTime()]+}+</script>++<style scoped>+.filter-bar {+ display: flex;+ justify-content: space-between;+ margin-bottom: 20px;+}++.date-filters {+ display: flex;+ gap: 10px;+}+</style>diff --git a/core/frontend/src/views/overview/components/LineChart.vue b/core/frontend/src/views/overview/components/LineChart.vuenew file mode 100644index 00000000..cd353dc3--- /dev/null+++ b/core/frontend/src/views/overview/components/LineChart.vue@@ -0,0 +1,69 @@+<template>+ <div class="h-180px">+ <v-charts :options="chartOptions" />+ </div>+</template>++<script setup lang="ts">+const props = defineProps({+ chartData: {+ type: Object,+ required: true,+ },+})++const chartOptions = computed(() => {+ return {+ title: {+ left: 'left',+ },+ grid: {+ top: '8%',+ left: '2%',+ right: '2%',+ bottom: '0',+ containLabel: true,+ },+ xAxis: {+ type: 'category',+ data: props.chartData.labels,+ boundaryGap: false,+ },+ yAxis: {+ type: 'value',+ },+ series: [+ {+ data: props.chartData.values,+ type: 'line',+ smooth: true,+ areaStyle: {+ color: {+ type: 'linear',+ x: 0,+ y: 0,+ x2: 0,+ y2: 1,+ colorStops: [+ {+ offset: 0,+ color: 'rgba(105, 121, 248, 0.3)',+ },+ {+ offset: 1,+ color: 'rgba(105, 121, 248, 0.1)',+ },+ ],+ },+ },+ itemStyle: {+ color: '#6979F8',+ },+ lineStyle: {+ color: '#6979F8',+ },+ },+ ],+ }+})+</script>diff --git a/core/frontend/src/views/overview/components/MetricCard.vue b/core/frontend/src/views/overview/components/MetricCard.vuenew file mode 100644index 00000000..f8e165cb--- /dev/null+++ b/core/frontend/src/views/overview/components/MetricCard.vue@@ -0,0 +1,38 @@+<template>+ <n-card class="metric-card" :bordered="false">+ <div class="title">{{ title }}</div>+ <div class="value">{{ value }}%</div>+ </n-card>+</template>++<script setup lang="ts">+defineProps({+ title: {+ type: String,+ default: '',+ },+ value: {+ type: Number,+ default: 0,+ },+})+</script>++<style scoped>+.metric-card {+ --n-padding-top: 24px;+ --n-padding-bottom: 24px;+ --n-text-color: #1d2630;+}++.title {+ margin-bottom: 15px;+ font-size: 18px;+ font-weight: 400;+}++.value {+ font-size: 20px;+ font-weight: 300;+}+</style>diff --git a/core/frontend/src/views/overview/components/ProviderTable.vue b/core/frontend/src/views/overview/components/ProviderTable.vuenew file mode 100644index 00000000..44301eb4--- /dev/null+++ b/core/frontend/src/views/overview/components/ProviderTable.vue@@ -0,0 +1,70 @@+<template>+ <div class="provider-table">+ <n-data-table :columns="columns" :data="tableData" :bordered="false"> </n-data-table>+ </div>+</template>++<script setup lang="ts">+import { NDataTable } from 'naive-ui'++const columns = [+ {+ title: '邮件提供商',+ key: 'provider',+ },+ {+ title: '送达率',+ key: 'delivered',+ },+ {+ title: '打开率',+ key: 'open',+ },+ {+ title: '点击率',+ key: 'click',+ },+ {+ title: '退回率',+ key: 'bounce',+ },+]++const tableData = [+ {+ provider: 'google',+ delivered: '99%',+ open: '98%',+ click: '20%',+ bounce: '1%',+ },+ {+ provider: 'outlook',+ delivered: '99%',+ open: '98%',+ click: '20%',+ bounce: '1%',+ },+ {+ provider: 'outlook',+ delivered: '99%',+ open: '98%',+ click: '20%',+ bounce: '1%',+ },+ {+ provider: 'outlook',+ delivered: '99%',+ open: '98%',+ click: '20%',+ bounce: '1%',+ },+ {+ provider: 'outlook',+ delivered: '99%',+ open: '98%',+ click: '20%',+ bounce: '1%',+ },+]+</script>diff --git a/core/frontend/src/views/overview/components/RateChartPanel.vue b/core/frontend/src/views/overview/components/RateChartPanel.vuenew file mode 100644index 00000000..34ed4f47--- /dev/null+++ b/core/frontend/src/views/overview/components/RateChartPanel.vue@@ -0,0 +1,34 @@+<template>+ <n-card title="打开率">+ <line-chart :chart-data="openRateData" />+ </n-card>+ <n-card title="点击率">+ <line-chart :chart-data="clickRateData" />+ </n-card>+ <n-card title="退回率">+ <line-chart :chart-data="bounceRateData" />+ </n-card>+</template>++<script setup lang="ts">+import LineChart from './LineChart.vue'++// 示例数据+const timeLabels = ['00:00', '01:00', '02:00', '03:00', '04:00']+const chartValues = [100, 150, 220, 100, 130]++const openRateData = {+ labels: timeLabels,+ values: chartValues,+}++const clickRateData = {+ labels: timeLabels,+ values: chartValues,+}++const bounceRateData = {+ labels: timeLabels,+ values: chartValues,+}+</script>diff --git a/core/frontend/src/views/overview/components/SendTodayStats.vue b/core/frontend/src/views/overview/components/SendTodayStats.vuenew file mode 100644index 00000000..f587ea3c--- /dev/null+++ b/core/frontend/src/views/overview/components/SendTodayStats.vue@@ -0,0 +1,59 @@+<template>+ <div class="send-today-stats">+ <div class="stats-header">+ <div class="stat-item">+ <div class="stat-label">成功率</div>+ <div class="stat-value">{{ successRate }}</div>+ </div>+ <div class="stat-item">+ <div class="stat-label">成功</div>+ <div class="stat-value">{{ successCount }}</div>+ </div>+ <div class="stat-item">+ <div class="stat-label">失败</div>+ <div class="stat-value">{{ failCount }}</div>+ </div>+ </div>+ <div class="h-180px">+ <bar-chart :chart-data="barChartData" />+ </div>+ </div>+</template>++<script setup lang="ts">+import BarChart from './BarChart.vue'++// 统计数据+const successRate = ref('99%')+const successCount = ref('9999')+const failCount = ref('9')++// 柱状图数据+const barChartData = {+ labels: ['00:00', '01:00', '02:00', '03:00', '04:00'],+ values: [100, 150, 220, 100, 150],+}+</script>++<style lang="scss" scoped>+.stats-header {+ display: flex;+ justify-content: space-around;+ margin-bottom: 20px;++ .stat-item {+ text-align: center;+ }++ .stat-label {+ font-size: 14px;+ color: #666;+ margin-bottom: 5px;+ }++ .stat-value {+ font-size: 18px;+ font-weight: bold;+ }+}+</style>diff --git a/core/frontend/src/views/overview/index.vue b/core/frontend/src/views/overview/index.vueindex 18e097c8..41662a64 100644--- a/core/frontend/src/views/overview/index.vue+++ b/core/frontend/src/views/overview/index.vue@@ -1,7 +1,72 @@<template>- <div>- <div class="i-mdi-email-fast-outline"></div>+ <div class="email-analytics-container">+ <!-- 顶部筛选区域 -->+ <filter-bar />++ <!-- 主要指标卡片 -->+ <div class="metrics-cards">+ <metric-card title="已送达" :value="99" />+ <metric-card title="已打开" :value="99" />+ <metric-card title="已点击" :value="99" />+ <metric-card title="已退回" :value="99" />+ </div>++ <!-- 数据详情区域 -->+ <div class="detail-row">+ <!-- 左侧邮件提供商表格 -->+ <n-card class="provider-table-card" title="邮件提供商">+ <provider-table />+ </n-card>++ <!-- 右侧今日发送统计 -->+ <n-card class="send-today-card" title="发送统计">+ <send-today-stats />+ </n-card>+ </div>++ <!-- 底部比率图表区域 -->+ <div class="rate-charts-card">+ <rate-chart-panel />+ </div></div></template>-<script lang="ts" setup></script>+<script lang="ts" setup>+import FilterBar from './components/FilterBar.vue'+import MetricCard from './components/MetricCard.vue'+import ProviderTable from './components/ProviderTable.vue'+import SendTodayStats from './components/SendTodayStats.vue'+import RateChartPanel from './components/RateChartPanel.vue'+</script>++<style lang="scss" scoped>+.email-analytics-container {+ padding: 20px;+}++.metrics-cards {+ display: flex;+ justify-content: space-between;+ gap: 20px;+ margin-bottom: 20px;+}++.detail-row {+ display: flex;+ gap: 20px;+ margin-bottom: 20px;+}++.provider-table-card {+ flex: 1;+}++.send-today-card {+ flex: 1;+}++.rate-charts-card {+ display: flex;+ gap: 20px;+}+</style>diff --git a/core/frontend/types/components.d.ts b/core/frontend/types/components.d.tsindex 66f3bdcb..074ebd43 100644--- a/core/frontend/types/components.d.ts+++ b/core/frontend/types/components.d.ts@@ -9,11 +9,25 @@ export {}declare module 'vue' {export interface GlobalComponents {ConfigProvider: typeof import('./../src/components/config-provider/index.vue')['default']+ NButton: typeof import('naive-ui')['NButton']+ NCard: typeof import('naive-ui')['NCard']NConfigProvider: typeof import('naive-ui')['NConfigProvider']+ NDataTable: typeof import('naive-ui')['NDataTable']+ NDatePicker: typeof import('naive-ui')['NDatePicker']+ NDropdown: typeof import('naive-ui')['NDropdown']+ NFlex: typeof import('naive-ui')['NFlex']+ NForm: typeof import('naive-ui')['NForm']+ NFormItem: typeof import('naive-ui')['NFormItem']+ NInput: typeof import('naive-ui')['NInput']NLayout: typeof import('naive-ui')['NLayout']+ NLayoutHeader: typeof import('naive-ui')['NLayoutHeader']NLayoutSider: typeof import('naive-ui')['NLayoutSider']NMenu: typeof import('naive-ui')['NMenu']+ NRadioButton: typeof import('naive-ui')['NRadioButton']+ NRadioGroup: typeof import('naive-ui')['NRadioGroup']+ NSelect: typeof import('naive-ui')['NSelect']RouterLink: typeof import('vue-router')['RouterLink']RouterView: typeof import('vue-router')['RouterView']+ VCharts: typeof import('./../src/components/v-charts/index.vue')['default']}}diff --git a/core/frontend/uno.config.ts b/core/frontend/uno.config.tsindex 76dfc78d..0317e6d0 100644--- a/core/frontend/uno.config.ts+++ b/core/frontend/uno.config.ts@@ -13,6 +13,9 @@ export default defineConfig({extraProperties: {display: 'inline-flex',},+ collections: {+ mdi: () => import('@iconify-json/mdi/icons.json').then(i => i.default),+ },}),],transformers: [transformerDirectives({ enforce: 'pre' })],