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

Add uno custom icon rules

albertc9fe0a36d987
diff --git a/core/frontend/src/api/modules/domain.ts b/core/frontend/src/api/modules/domain.ts
index 38b7d6d9..104626e8 100644
--- a/core/frontend/src/api/modules/domain.ts
+++ b/core/frontend/src/api/modules/domain.ts
@@ -84,3 +84,13 @@ export const setDefaultDomain = (params: { domain: string }) => {
},
})
}
+
+
+export const initAiConfiguration = (params: { domain: string, urls: string[] }) => {
+ return instance.post("/askai/project/create", params, {
+ fetchOptions: {
+ loading: 'Setting Default Domain, please wait...',
+ successMessage: true,
+ }
+ })
+}
\ No newline at end of file
diff --git a/core/frontend/src/assets/icons/ai/test.svg b/core/frontend/src/assets/icons/ai/test.svg
new file mode 100644
index 00000000..dedd91b9
--- /dev/null
+++ b/core/frontend/src/assets/icons/ai/test.svg
@@ -0,0 +1 @@
+<svg t="1751944801595" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1402" width="256" height="256"><path d="M723.42810792 267.58370352V213.26218163h-54.32152189V267.58370352H397.53971261V213.26218163H343.21819071V267.58370352H234.59551496v543.15411485h597.45526873V267.58370352h-108.62267577zM777.74962981 756.41629648H288.91703685V430.52790117h488.83259295v325.88839531z" fill="#ffffff" p-id="1403"></path><path d="M343.23855874 484.84942306h81.47209883v81.47209883h-81.47209883v-81.47209883zM492.59728393 484.84942306h81.4720988v81.47209883h-81.47209881v-81.47209883zM641.95600909 484.84942306h81.47209883v81.47209883h-81.47209883v-81.47209883zM343.23855874 620.62267576h81.47209883v81.47209883h-81.47209883v-81.47209883zM492.59728393 620.62267576h81.4720988v81.47209883h-81.47209881v-81.47209883zM641.95600909 620.62267576h81.47209883v81.47209883h-81.47209883v-81.47209883z" fill="#ffffff" p-id="1404"></path></svg>
\ No newline at end of file
diff --git a/core/frontend/src/views/domain/components/DomainForm.vue b/core/frontend/src/views/domain/components/DomainForm.vue
index dc680094..bf3f8cb2 100644
--- a/core/frontend/src/views/domain/components/DomainForm.vue
+++ b/core/frontend/src/views/domain/components/DomainForm.vue
@@ -44,7 +44,7 @@
<n-form-item label="Automatically create brand information">
- <n-switch></n-switch>
+ <n-switch v-model:value="initAi"></n-switch>
</n-form-item>
<n-alert style="margin: 0 0 15px 0;" type="warning" :show-icon="false">
<div class="w-100% flex justify-between items-center">
@@ -64,8 +64,10 @@
</bt-tips>
<n-form-item label="Specify a domain name">
<div class="w-100% flex flex-col gap-2.5">
- <n-input placeholder=""></n-input>
- <n-button type="primary" ghost>
+ <n-input placeholder="" v-model:value="urls[index]" v-for="(item, index) in urls"
+ :key="index"></n-input>
+
+ <n-button type="primary" ghost @click="addUrl">
<template #icon>
<i class="i-material-symbols:add-circle-outline"></i>
</template>
@@ -74,7 +76,6 @@
</div>
</n-form-item>
</bt-form>
-
</div>
</modal>
</template>
@@ -83,7 +84,7 @@
import { FormRules } from 'naive-ui'
import { getByteUnit, getNumber } from '@/utils'
import { useModal } from '@/hooks/modal/useModal'
- import { createDomain, updateDomain } from '@/api/modules/domain'
+ import { createDomain, initAiConfiguration, updateDomain } from '@/api/modules/domain'
import type { MailDomain } from '../interface'
const { t } = useI18n()
@@ -95,7 +96,8 @@
})
const formRef = useTemplateRef('formRef')
-
+ const initAi = ref(false)
+ const urls = ref([""])
const form = reactive({
domain: '',
a_record: '',
@@ -178,9 +180,23 @@
mailboxes: form.mailboxes,
email: form.email,
})
+ // Init Ai configuration (via. src\api\modules\domain.ts)
+ if (initAi.value) {
+ await initAiConfiguration({
+ domain: form.domain,
+ urls: urls.value
+ })
+ }
}
const state = modalApi.getState<{ refresh: Function }>()
state.refresh()
},
})
+
+ /**
+ * @description Add url to urls
+ */
+ function addUrl() {
+ urls.value.push("")
+ }
</script>
diff --git a/core/frontend/src/views/domain/pages/editDomain/components/AISettings.vue b/core/frontend/src/views/domain/pages/editDomain/components/AISettings.vue
index 30808659..e9feef62 100644
--- a/core/frontend/src/views/domain/pages/editDomain/components/AISettings.vue
+++ b/core/frontend/src/views/domain/pages/editDomain/components/AISettings.vue
@@ -36,7 +36,7 @@
</template>
<script setup lang="ts">
- import { getAisettingsInfo,updateAisettingsInfo } from "../controller/aiSettings.controller"
+ import { getAisettingsInfo, updateAisettingsInfo } from "../controller/aiSettings.controller"
import { getEditDomainStoreData } from '../store';
const { prompt } = getEditDomainStoreData()
const route = useRoute()
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 d813c732..2c8556e8 100644
--- a/core/frontend/src/views/domain/pages/editDomain/components/DomainConfiguration.vue
+++ b/core/frontend/src/views/domain/pages/editDomain/components/DomainConfiguration.vue
@@ -41,7 +41,7 @@
<n-card class="mt-5">
<n-form-item label="Automatically create brand information">
- <n-switch></n-switch>
+ <n-switch v-model:value="initAi"></n-switch>
</n-form-item>
<n-alert style="margin: 0 0 15px 0;" type="warning" :show-icon="false">
<div class="w-100% flex justify-between items-center">
@@ -61,8 +61,9 @@
</bt-tips>
<n-form-item label="Specify a domain name">
<div class="w-100% flex flex-col gap-2.5">
- <n-input placeholder=""></n-input>
- <n-button type="primary" ghost>
+ <n-input placeholder="" v-for="(_, index) in urls" :key="index"
+ v-model:value="urls[index]"></n-input>
+ <n-button type="primary" ghost @click="addUrl">
<template #icon>
<i class="i-material-symbols:add-circle-outline"></i>
</template>
@@ -73,7 +74,7 @@
</n-card>
</div>
-
+
<!-- <n-card class="my-5">
<div class="switch-settings">
<div class="switch-item">
@@ -122,7 +123,9 @@
quota,
unit,
mailboxes,
- catch_email
+ catch_email,
+ initAi,
+ urls
} = getEditDomainStoreData()
const route = useRoute()
const domain = route.params.domain as string
@@ -151,6 +154,13 @@
getDomainDetail(domain)
+ /**
+ * @description Add url to urls
+ */
+ function addUrl() {
+ urls.value.push("")
+ }
+
</script>
<style scoped lang="scss">
diff --git a/core/frontend/src/views/domain/pages/editDomain/index.vue b/core/frontend/src/views/domain/pages/editDomain/index.vue
index bea9631c..32e7ccdf 100644
--- a/core/frontend/src/views/domain/pages/editDomain/index.vue
+++ b/core/frontend/src/views/domain/pages/editDomain/index.vue
@@ -17,7 +17,9 @@
</div>
</div>
<div class="dynamic-content">
- <component :is="contentMap.get(activeTab)" />
+ <n-scrollbar style="height: 100%;">
+ <component :is="contentMap.get(activeTab)" />
+ </n-scrollbar>
</div>
@@ -186,7 +188,7 @@
// Dynamic content
.dynamic-content {
- height: 100%;
+ height: calc(100vh - 240px);
box-sizing: border-box;
padding: 20px;
}
diff --git a/core/frontend/src/views/domain/pages/editDomain/store/index.ts b/core/frontend/src/views/domain/pages/editDomain/store/index.ts
index 22dd40fe..9969e2b3 100644
--- a/core/frontend/src/views/domain/pages/editDomain/store/index.ts
+++ b/core/frontend/src/views/domain/pages/editDomain/store/index.ts
@@ -8,6 +8,8 @@ const editDomainStore = defineStore("editDomainStoroe", () => {
const unit = ref("B")
const mailboxes = ref(0)
const catch_email = ref("")
+ const initAi = ref(false)
+ const urls = ref([""])
// Project detail
const hasGotProjectDetail = ref(false)
@@ -74,6 +76,8 @@ const editDomainStore = defineStore("editDomainStoroe", () => {
unit,
mailboxes,
catch_email,
+ initAi,
+ urls,
hasGotProjectDetail,
domain,
diff --git a/core/frontend/src/views/settings/ai-model/index.vue b/core/frontend/src/views/settings/ai-model/index.vue
index 8e8347fc..2cba6bba 100644
--- a/core/frontend/src/views/settings/ai-model/index.vue
+++ b/core/frontend/src/views/settings/ai-model/index.vue
@@ -1,6 +1,35 @@
<template>
- <div>
+ <div class="max-w-4xl mx-auto px-4 py-8">
+ <n-card class="mb-5">
+ <div class="page-tit" style="margin: 0;">
+ <div class="left-tit">
+ <div class="back-tool">
+ <i class="i-ri:apps-fill text-6"></i>
+ </div>
+ <span class="tit-content">
+ AI Model
+ </span>
+ </div>
+ <div class="right-tit">
+ <n-button type="primary">
+ <template #icon>
+ <i class="i-ai:test w-5 h-5"></i>
+ </template>
+ Add model
+ </n-button>
+ </div>
+ </div>
+ </n-card>
+ <n-card>
+ <div class="model-item">
+ <div>
+
+ <span>Deep Seek</span>
+ <span></span>
+ </div>
+ </div>
+ </n-card>
</div>
</template>
@@ -8,6 +37,9 @@
</script>
-<style scoped>
-
+<style scoped lang="scss">
+ @use "@/views/domain/pages/editDomain/components/mixin.scss";
+ .page-tit {
+ @include mixin.page-tit;
+ }
</style>
\ No newline at end of file
diff --git a/core/frontend/uno.config.ts b/core/frontend/uno.config.ts
index 43b960b7..19052360 100644
--- a/core/frontend/uno.config.ts
+++ b/core/frontend/uno.config.ts
@@ -4,6 +4,31 @@ import presetIcons from '@unocss/preset-icons'
import presetAttributify from '@unocss/preset-attributify'
import transformerDirectives from '@unocss/transformer-directives'
+import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
+import path from 'node:path'
+import { globSync } from 'glob'
+
+function getIcons() {
+ const icons = {}
+ const files = globSync('src/assets/icons/**/*.svg', { nodir: true })
+ files.forEach((filePath) => {
+ const fileName = path.basename(filePath) // 获取文件名,包括后缀
+ const fileNameWithoutExt = path.parse(fileName).name // 获取去除后缀的文件名
+ const folderName = path.basename(path.dirname(filePath)) // 获取文件夹名
+ if (!icons[folderName]) {
+ icons[folderName] = []
+ }
+ icons[folderName].push(`i-${folderName}:${fileNameWithoutExt}`)
+ })
+ return icons
+}
+
+const icons = getIcons()
+const collections = Object.fromEntries(
+ Object.keys(icons).map((item) => [item, FileSystemIconLoader(`src/assets/icons/${item}`)])
+)
+
+
export default defineConfig({
presets: [
presetUno({ preflight: false }),
@@ -14,6 +39,7 @@ export default defineConfig({
display: 'inline-flex',
},
collections: {
+ ...collections,
custom: {
help: '<svg aria-hidden="true" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M6.886 4.923c-.232.25-.386.63-.386 1.122a.75.75 0 1 1-1.5 0c0-.803.254-1.57.788-2.144C6.33 3.32 7.1 3 8 3c.9 0 1.67.32 2.212.901.534.574.788 1.341.788 2.144 0 1.234-.869 1.922-1.436 2.332-.094.068-.178.127-.255.181-.19.134-.33.233-.449.343a.64.64 0 0 0-.11.121V9.5a.75.75 0 0 1-1.5 0V9c0-.563.326-.956.593-1.202.198-.183.457-.364.672-.516l.17-.121c.559-.404.815-.693.815-1.116 0-.492-.154-.872-.386-1.122C8.888 4.68 8.533 4.5 8 4.5c-.533 0-.888.18-1.114.423Z"></path><path d="M9 12a1.001 1.001 0 0 1-2 0 1.001 1.001 0 0 1 2 0Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8 14.5A6.5 6.5 0 1 0 1.5 8c0 1.022.179 1.608.603 2.399.316.59.407 1.313.178 2.003l-.66 1.976 1.977-.659a2.541 2.541 0 0 1 2.004.178c.79.424 1.376.603 2.398.603ZM8 16a8 8 0 1 0-8-8c0 1.29.25 2.117.78 3.107.136.252.168.549.078.82l-.807 2.42a1 1 0 0 0-.051.315V15a1 1 0 0 0 1 1h.338a1 1 0 0 0 .316-.051l2.419-.807c.271-.09.568-.057.82.078.99.53 1.817.78 3.107.78Z"></path></svg>',
smtp: '<svg t="1747640620453" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3817" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M841.142857 73.142857a109.714286 109.714286 0 0 1 109.202286 99.181714L950.857143 182.857143v294.107428a36.571429 36.571429 0 0 1-72.557714 6.582858L877.714286 476.964571V194.340571L569.051429 459.776c-32.182857 19.529143-71.826286 21.211429-108.909715 2.121143l-10.020571-5.705143L146.285714 194.56v573.44a36.571429 36.571429 0 0 0 29.988572 35.986286L182.857143 804.571429h221.842286a36.571429 36.571429 0 0 1 6.582857 72.557714l-6.582857 0.585143H182.857143a109.714286 109.714286 0 0 1-109.202286-99.181715L73.142857 768v-585.142857a109.714286 109.714286 0 0 1 99.181714-109.202286L182.857143 73.142857h658.285714z m-19.675428 73.142857H202.24L492.982857 397.238857a40.740571 40.740571 0 0 0 29.257143 5.046857l3.949714-1.462857L821.467429 146.285714z" fill="currentColor" p-id="3818"></path><path d="M857.526857 626.395429l5.632 3.510857 146.651429 109.421714a36.571429 36.571429 0 0 1 5.558857 53.613714l-5.266286 4.827429-142.482286 108.544a36.571429 36.571429 0 0 1-49.225142-53.76l4.900571-4.388572 56.32-43.008-257.755429 0.073143a36.571429 36.571429 0 0 1-6.582857-72.557714l6.582857-0.585143H877.714286l-58.294857-43.593143a36.571429 36.571429 0 0 1 38.107428-62.098285z" fill="currentColor" p-id="3819"></path></svg>',