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

ajust sort schedule for route

albertc420b88ef21e
diff --git a/core/frontend/src/layout/components/Sidebar.vue b/core/frontend/src/layout/components/Sidebar.vue
index c234d021..755e519f 100644
--- a/core/frontend/src/layout/components/Sidebar.vue
+++ b/core/frontend/src/layout/components/Sidebar.vue
@@ -111,6 +111,7 @@ const iconMap: Record<string, VNodeChild> = {
mailbox: <i class="i-custom:mailbox"></i>,
smtp: <i class="i-custom:smtp"></i>,
settings: <i class="i-mdi-settings-outline"></i>,
+ template: <i class="i-mdi-settings-outline"></i>,
logout: <i class="i-mdi-logout"></i>,
}
diff --git a/core/frontend/src/router/modules/template.ts b/core/frontend/src/router/modules/template.ts
new file mode 100644
index 00000000..83c8d266
--- /dev/null
+++ b/core/frontend/src/router/modules/template.ts
@@ -0,0 +1,12 @@
+import type { RouteRecordRaw } from "vue-router";
+
+export default {
+ path: "/template",
+ meta: {
+ sort: 3,
+ title:"template",
+ key: 'template',
+ titleKey: 'layout.menu.template',
+ },
+ component: () => import("@/views/template/index.vue")
+} as RouteRecordRaw
\ No newline at end of file
diff --git a/core/frontend/src/router/router.ts b/core/frontend/src/router/router.ts
index cdde8bc1..52ba71c6 100644
--- a/core/frontend/src/router/router.ts
+++ b/core/frontend/src/router/router.ts
@@ -1,7 +1,20 @@
-import { get } from 'lodash-es'
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import { is, isDev } from '@/utils'
+// Routes reflect list
+const routesReflectList = [
+ 'Overview',
+ 'Email Marketing',
+ 'template',
+ 'Send API',
+ 'Contacts',
+ 'MailDomain',
+ 'MailBoxes',
+ 'SMTP',
+ 'Settings',
+ 'Automation',
+]
+
// Import routes from modules
const modules = import.meta.webpackContext('./modules', {
// Whether to search for subdirectories
@@ -10,7 +23,7 @@ const modules = import.meta.webpackContext('./modules', {
})
// Module routes
-export const menuList: RouteRecordRaw[] = []
+export let menuList: RouteRecordRaw[] = []
// Iterate through the module list to generate module routes
for (const path of modules.keys()) {
@@ -21,11 +34,11 @@ for (const path of modules.keys()) {
}
// Sort module routes
-menuList.sort((a, b) => {
- const aSort = get(a, 'meta.sort', 0) as number
- const bSort = get(b, 'meta.sort', 0) as number
- return aSort - bSort
-})
+menuList = menuList.reduce((p: RouteRecordRaw[], v: RouteRecordRaw) => {
+ const routeIndex = routesReflectList.findIndex(item => item == v.meta!.title)
+ p[routeIndex] = v
+ return p
+}, [] as RouteRecordRaw[])
const otherArray: RouteRecordRaw[] = []
diff --git a/core/frontend/src/views/domain/pages/editDomain/components/Styling.vue b/core/frontend/src/views/domain/pages/editDomain/components/Styling.vue
index 9f0484a1..b3ffb733 100644
--- a/core/frontend/src/views/domain/pages/editDomain/components/Styling.vue
+++ b/core/frontend/src/views/domain/pages/editDomain/components/Styling.vue
@@ -36,6 +36,7 @@
<template #label><span class="form-label">Container Background</span></template>
<div class="flex justify-between gap-2.5 w-100%">
<n-color-picker style="width: 50px;" :modes="['hex','rgb','hsl','hsv']" :render-label="colorRenderLabel"></n-color-picker>
+ <n-input></n-input>
</div>
</n-form-item>
</n-form>
diff --git a/core/frontend/src/views/template/index.vue b/core/frontend/src/views/template/index.vue
new file mode 100644
index 00000000..1ce1aabb
--- /dev/null
+++ b/core/frontend/src/views/template/index.vue
@@ -0,0 +1,13 @@
+<template>
+ <div>
+template
+ </div>
+</template>
+
+<script setup lang="ts">
+
+</script>
+
+<style scoped>
+
+</style>
\ No newline at end of file
diff --git a/core/frontend/types/components.d.ts b/core/frontend/types/components.d.ts
index 72ffe0fd..31592c88 100644
--- a/core/frontend/types/components.d.ts
+++ b/core/frontend/types/components.d.ts
@@ -55,7 +55,6 @@ declare module 'vue' {
NGi: typeof import('naive-ui')['NGi']
NGrid: typeof import('naive-ui')['NGrid']
NIcon: typeof import('naive-ui')['NIcon']
- NInpu: typeof import('naive-ui')['NInpu']
NInput: typeof import('naive-ui')['NInput']
NInputGroup: typeof import('naive-ui')['NInputGroup']
NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel']