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

fix: Optimized the logic for the domain and template components.

albert4cf38e442cf7
diff --git a/core/frontend/src/api/modules/domain.ts b/core/frontend/src/api/modules/domain.ts
index 87924bea..592c9933 100644
--- a/core/frontend/src/api/modules/domain.ts
+++ b/core/frontend/src/api/modules/domain.ts
@@ -17,6 +17,7 @@ type DomainParams = {
mailboxes: number
email: string
urls: string[]
+ hasbrandinfo?: number
}
export const createDomain = (params: DomainParams) => {
diff --git a/core/frontend/src/i18n/lang/en.json b/core/frontend/src/i18n/lang/en.json
index 4285554c..1e0c7b8f 100644
--- a/core/frontend/src/i18n/lang/en.json
+++ b/core/frontend/src/i18n/lang/en.json
@@ -583,7 +583,18 @@
"aRecordFailed": "A record resolution failed. Please check if the A record domain is resolved to the server IP",
"dnsSetup": "You need to add an A record in your DNS provider's console",
"cloudflare": "If using CloudFlare, please select [DNS only] when adding records"
- }
+ },
+ "createBrandInfo":"Automatically create brand information",
+ "modelNotice":"To use this feature, you need to integrate an AI model first.",
+ "integrateImmediately": "Integrate immediately",
+ "modelDescription": "AI-driven information import automatically analyzes and creates brand information from email domains. After creation, you can modify it at your discretion.",
+ "extractBrand": "Extract brand and color",
+ "analyzeStructure": "Analyze content structure",
+ "importContent": "Import images and content",
+ "customLogo": "Use a custom logo (optional)",
+ "specifyDomain": "Specify a domain name",
+ "addMoreUrls": "Add more URLs",
+ "maxUrl":"Maximum of 3 URLs can be filled in."
},
"dns": {
"title": "DNS Records",
@@ -673,7 +684,11 @@
"customLogo": "Use a custom logo (optional)"
},
"specifyDomain": "Specify a domain name",
- "addMoreUrls": "Add more URLs"
+ "addMoreUrls": "Add more URLs",
+ "createNow":"Create Immediately",
+ "brandInfo":"Brand information",
+ "noBrandInfo":"No brand information available.",
+ "fillDomain":"Please fill in the domain name"
},
"projectDetails": {
"title": "Project Details",
@@ -750,7 +765,8 @@
"instructionsDescription": "These instructions will be used as default guidelines when generating new emails. You can override these instructions for individual emails as needed."
},
"common": {
- "daysAgo": "days ago"
+ "daysAgo": "days ago",
+ "noBrandInfo":"There is no brand information for the current domain."
}
},
"api": {
diff --git a/core/frontend/src/i18n/lang/zh.json b/core/frontend/src/i18n/lang/zh.json
index 5c106ef7..cd35b1dc 100644
--- a/core/frontend/src/i18n/lang/zh.json
+++ b/core/frontend/src/i18n/lang/zh.json
@@ -572,7 +572,7 @@
"urlsPlacement": "请输入域名,例如:http://billionmail.com",
"aRecord": "A记录",
"aRecordPlaceholder": "请输入A记录,例如:mailAapanelCom",
- "quota": "域名配额",
+ "quota": "域名配额",
"mailboxCount": "邮箱数量",
"globalCatch": "Catch All",
"globalCatchPlaceholder": "捕获不存在的邮件,转发至此邮件",
@@ -583,7 +583,22 @@
"aRecordFailed": "提示A记录解析失败。请检查填写的A记录域名是否已解析到服务器 IP",
"dnsSetup": "需要在您的DNS服务提供商控制台添加A记录",
"cloudflare": "如果使用CloudFlare,请在添加记录时选择【仅DNS】"
- }
+ },
+ "createBrandInfo":"自动创建品牌信息",
+ "modelNotice":"要使用此功能,您需要先进行大模型配置",
+ "integrateImmediately": "立即配置",
+ "modelDescription": "AI驱动的信息导入会自动分析并从邮件域名创建品牌信息。创建后,您可以根据需要进行修改",
+ "extractBrand": "提取品牌和颜色",
+ "analyzeStructure": "分析内容结构",
+ "importContent": "导入图片和内容",
+ "customLogo": "使用自定义徽标(可选)",
+ "specifyDomain": "指定域名",
+ "addMoreUrls": "添加更多URL",
+ "maxUrl":"最多只能填写3个URL",
+ "createImmediately":"立即创建",
+ "brandInfo":"品牌信息",
+ "noBrandInfo":"暂无品牌信息",
+ "fillDomain":"请填写域名"
},
"dns": {
"title": "DNS 记录",
@@ -751,7 +766,8 @@
"instructionsDescription": "这些指令将用作生成新邮件时的默认指南。您可以根据需要为单个邮件覆盖这些指令。"
},
"common": {
- "daysAgo": "天前"
+ "daysAgo": "天前",
+ "noBrandInfo":"当前域名没有品牌信息."
}
},
"api": {
diff --git a/core/frontend/src/views/domain/components/DomainForm.vue b/core/frontend/src/views/domain/components/DomainForm.vue
index 19cdb2ba..0ca7c183 100644
--- a/core/frontend/src/views/domain/components/DomainForm.vue
+++ b/core/frontend/src/views/domain/components/DomainForm.vue
@@ -46,47 +46,47 @@
<template #label>
<div class="flex justify-start items-center ">
<i class="i-domain:brand-info w-5 h-5 mr-1.25 "></i>
- <span>Automatically create brand information</span>
+ <span>{{ $t("domain.form.createBrandInfo") }}</span>
</div>
</template>
- <n-switch v-model:value="initAi"></n-switch>
+ <n-switch v-model:value="initAi" :disabled="!aiConfigurationStatus"></n-switch>
</n-form-item>
<n-alert v-if="!aiConfigurationStatus" style="margin: 0 0 15px 0" type="warning" :show-icon="false">
<div class="w-100% flex justify-between items-center">
- <span class="mr-5">To use this feature, you need to integrate an AI model first.</span>
- <n-button type="primary">Integrate immediately</n-button>
+ <span class="mr-5">{{ $t("domain.form.modelNotice") }}</span>
+ <n-button type="primary" @click="goIntegrate">{{ $t("domain.form.integrateImmediately") }}</n-button>
</div>
</n-alert>
<div class="text-[#777] flex justify-start">
<span><i class="i-domain:brand-info w-5 h-5 mr-1.25"></i></span>
- <span>AI-driven information import automatically analyzes and creates brand information from
- email domains. After creation, you can modify it at your discretion.</span>
+ <span>{{ $t("domain.form.modelDescription") }}</span>
</div>
<bt-tips style="margin-bottom: 15px">
- <li>Extract brand and color</li>
- <li>Analyze content structure</li>
- <li>Import images and content</li>
- <li>Use a custom logo (optional)</li>
+ <li>{{ $t("domain.form.extractBrand") }}</li>
+ <li>{{ $t("domain.form.analyzeStructure") }}</li>
+ <li>{{ $t("domain.form.importContent") }}</li>
+ <li>{{ $t("domain.form.customLogo") }}</li>
</bt-tips>
- <n-form-item label="Specify a domain name">
+ <n-form-item :label="$t('domain.form.specifyDomain')">
<div class="w-100% flex flex-col gap-2.5">
<!-- <n-input v-for="(item, index) in urls" :key="index" v-model:value="urls[index]" placeholder="">
</n-input> -->
<div v-for="(_, index) in urls" :key="index" class="flex justify-start items-center gap-2.5">
<n-input v-model:value="urls[index]"
- :placeholder="t('domain.form.urlsPlacement')"></n-input>
+ :placeholder="t('domain.form.urlsPlacement')" :disabled="!aiConfigurationStatus"></n-input>
<div v-if="index != 0" class="close" @click="removeUrl(index)">
<i class="i-material-symbols:close-rounded text-5"></i>
</div>
<!-- <div v-else class="w-34px h-34px"></div> -->
</div>
+ <!-- <div class="text-[#777]">{{ $t("domain.form.maxUrl") }}</div> -->
- <n-button type="primary" ghost @click="addUrl">
+ <!-- <n-button type="primary" :disabled="!aiConfigurationStatus || urls.length == 3" ghost @click="addUrl">
<template #icon>
<i class="i-material-symbols:add-circle-outline"></i>
</template>
- Add more URLs
- </n-button>
+ {{ $t("domain.form.addMoreUrls") }}
+ </n-button> -->
</div>
</n-form-item>
</bt-form>
@@ -95,176 +95,190 @@
<!-- Wait for init brand info -->
<WaitAndCheckDomainStatus ref="waitAndCheckDomainStatusRef" />
-
+
</template>
<script lang="ts" setup>
- import WaitAndCheckDomainStatus from './WaitAndCheckDomainStatus.vue'
- import { FormRules } from 'naive-ui'
- import { getByteUnit, getNumber } from '@/utils'
- import { useModal } from '@/hooks/modal/useModal'
- import {
- createDomain,
- initAiConfiguration,
- updateDomain,
- checkAiConfiguration,
- } from '@/api/modules/domain'
- import type { MailDomain } from '../interface'
-
- const { t } = useI18n()
+import WaitAndCheckDomainStatus from './WaitAndCheckDomainStatus.vue'
+import { FormRules } from 'naive-ui'
+import { getByteUnit, getNumber } from '@/utils'
+import { useModal } from '@/hooks/modal/useModal'
+import {
+ createDomain,
+ initAiConfiguration,
+ updateDomain,
+ checkAiConfiguration,
+} from '@/api/modules/domain'
+import type { MailDomain } from '../interface'
+import router from '@/router'
+import { useGlobalStore } from '@/store'
- const isEdit = ref(false)
- const waitAndCheckDomainStatusRef = ref()
+const { t } = useI18n()
- const title = computed(() => {
- return isEdit.value ? t('domain.form.editTitle') : t('domain.form.addTitle')
- })
+const isEdit = ref(false)
+const waitAndCheckDomainStatusRef = ref()
- const aiConfigurationStatus = ref(false)
+const title = computed(() => {
+ return isEdit.value ? t('domain.form.editTitle') : t('domain.form.addTitle')
+})
- const formRef = useTemplateRef('formRef')
- const initAi = ref(false)
- const urls = ref(['https://'])
- const form = reactive({
- domain: '',
- a_record: '',
- quota: 5,
- quota_unit: 'GB',
- mailboxes: 50,
- email: '',
- })
+const aiConfigurationStatus = ref(false)
+const globalStore = useGlobalStore()
+const formRef = useTemplateRef('formRef')
+const initAi = ref(false)
+const urls = ref(['https://'])
+const form = reactive({
+ domain: '',
+ a_record: '',
+ quota: 5,
+ quota_unit: 'GB',
+ mailboxes: 50,
+ email: '',
+})
- const unitOptions = [
- { label: 'GB', value: 'GB' },
- { label: 'MB', value: 'MB' },
- ]
+const unitOptions = [
+ { label: 'GB', value: 'GB' },
+ { label: 'MB', value: 'MB' },
+]
- const rules: FormRules = {
- domain: {
- trigger: ['blur', 'input'],
- validator: () => {
- if (form.domain.trim() === '') {
- return new Error(t('domain.form.validation.domainRequired'))
- }
- return true
- },
+const rules: FormRules = {
+ domain: {
+ trigger: ['blur', 'input'],
+ validator: () => {
+ if (form.domain.trim() === '') {
+ return new Error(t('domain.form.validation.domainRequired'))
+ }
+ return true
},
- }
+ },
+}
- /**
- * @description Calculate the byte number based on the domain quota and unit
- * @param quota
- * @param quota_unit
- */
- const getQuotaByte = (quota: number, quota_unit: string) => {
- switch (quota_unit) {
- case 'GB':
- return quota * 1024 * 1024 * 1024
- case 'MB':
- return quota * 1024 * 1024
- default:
- return quota
- }
+/**
+ * @description Calculate the byte number based on the domain quota and unit
+ * @param quota
+ * @param quota_unit
+ */
+const getQuotaByte = (quota: number, quota_unit: string) => {
+ switch (quota_unit) {
+ case 'GB':
+ return quota * 1024 * 1024 * 1024
+ case 'MB':
+ return quota * 1024 * 1024
+ default:
+ return quota
}
+}
- /**
- * @description Sync domain to urls
- */
- const syncToUrls = (domainVal: string) => {
- const httpStr = urls.value[0].match(/http:\/\/?/g)
- const httpsStr = urls.value[0].match(/https:\/\/?/g)
- if (httpStr) {
- urls.value[0] = httpStr[0] + domainVal
- }
-
- if (httpsStr) {
- urls.value[0] = httpsStr[0] + domainVal
- }
+/**
+ * @description Sync domain to urls
+ */
+const syncToUrls = (domainVal: string) => {
+ const httpStr = urls.value[0].match(/http:\/\/?/g)
+ const httpsStr = urls.value[0].match(/https:\/\/?/g)
+ if (httpStr) {
+ urls.value[0] = httpStr[0] + domainVal
+ }
- if (!httpStr && !httpsStr) {
- urls.value[0] = 'https://' + domainVal
- }
+ if (httpsStr) {
+ urls.value[0] = httpsStr[0] + domainVal
}
- /**
- * @description Remove url
- */
- const removeUrl = (index: number) => {
- urls.value.splice(index, 1)
+ if (!httpStr && !httpsStr) {
+ urls.value[0] = 'https://' + domainVal
}
+}
+
+/**
+ * @description Remove url
+ */
+const removeUrl = (index: number) => {
+ urls.value.splice(index, 1)
+}
- const [Modal, modalApi] = useModal({
- onChangeState: async isOpen => {
- if (isOpen) {
- const state = modalApi.getState<{ isEdit: boolean; row: MailDomain | null }>()
- isEdit.value = state.isEdit
- const res = (await checkAiConfiguration()) as Record<string, any>
- aiConfigurationStatus.value = res.is_configured
- if (state.row) {
- const { row } = state
- form.domain = row.domain
- form.a_record = row.a_record
- const quota = getByteUnit(row.quota)
- form.quota = getNumber(quota.split(' ')[0])
- form.quota_unit = quota.split(' ')[1]
- form.mailboxes = row.mailboxes
- form.email = row.email
- }
- } else {
- form.domain = ''
- form.a_record = ''
- form.quota = 5
- form.quota_unit = 'GB'
- form.mailboxes = 50
- form.email = ''
- urls.value = ['https://']
+const [Modal, modalApi] = useModal({
+ onChangeState: async isOpen => {
+ if (isOpen) {
+ const state = modalApi.getState<{ isEdit: boolean; row: MailDomain | null }>()
+ isEdit.value = state.isEdit
+ const res = (await checkAiConfiguration()) as Record<string, any>
+ aiConfigurationStatus.value = res.is_configured
+ if (state.row) {
+ const { row } = state
+ form.domain = row.domain
+ form.a_record = row.a_record
+ const quota = getByteUnit(row.quota)
+ form.quota = getNumber(quota.split(' ')[0])
+ form.quota_unit = quota.split(' ')[1]
+ form.mailboxes = row.mailboxes
+ form.email = row.email
}
- },
- onConfirm: async () => {
- await formRef.value?.validate()
- if (isEdit.value) {
- await updateDomain({
- domain: form.domain,
- quota: getQuotaByte(form.quota, form.quota_unit),
- mailboxes: form.mailboxes,
- email: form.email,
- urls: urls.value,
- })
- } else {
- await createDomain({
+ } else {
+ form.domain = ''
+ form.a_record = ''
+ form.quota = 5
+ form.quota_unit = 'GB'
+ form.mailboxes = 50
+ form.email = ''
+ urls.value = ['https://']
+ }
+ },
+ onConfirm: async () => {
+ await formRef.value?.validate()
+ if (isEdit.value) {
+ await updateDomain({
+ domain: form.domain,
+ quota: getQuotaByte(form.quota, form.quota_unit),
+ mailboxes: form.mailboxes,
+ email: form.email,
+ urls: urls.value,
+ })
+ } else {
+ await createDomain({
+ domain: form.domain,
+ quota: getQuotaByte(form.quota, form.quota_unit),
+ mailboxes: form.mailboxes,
+ email: form.email,
+ urls: urls.value,
+ hasbrandinfo:Number(initAi.value),
+ })
+ globalStore.domainSource = form.domain
+ // Init Ai configuration (via. src\api\modules\domain.ts)
+ if (initAi.value) {
+ await initAiConfiguration({
domain: form.domain,
- quota: getQuotaByte(form.quota, form.quota_unit),
- mailboxes: form.mailboxes,
- email: form.email,
urls: urls.value,
})
- // Init Ai configuration (via. src\api\modules\domain.ts)
- if (initAi.value) {
- await initAiConfiguration({
- domain: form.domain,
- urls: urls.value,
- })
- waitAndCheckDomainStatusRef.value.open(form.domain)
- }
+ waitAndCheckDomainStatusRef.value.open(form.domain)
}
- const state = modalApi.getState<{ refresh: Function }>()
- state.refresh()
- },
- })
- /**
- * @description Add url to urls
- */
- function addUrl() {
- urls.value.push('')
- }
+ }
+ const state = modalApi.getState<{ refresh: Function }>()
+ state.refresh()
+ },
+})
+
+/**
+ * @description Add url to urls
+ */
+function addUrl() {
+ urls.value.push('')
+}
+
+/**
+ * @description Go to integrate AI model
+ */
+function goIntegrate() {
+ router.push({
+ name: "AiModel"
+ })
+}
</script>
<style lang="scss" scoped>
- @use '@/views/domain/pages/editDomain/components/mixin.scss';
+@use '@/views/domain/pages/editDomain/components/mixin.scss';
- .close {
- @include mixin.operation-close;
- }
+.close {
+ @include mixin.operation-close;
+}
</style>
diff --git a/core/frontend/src/views/domain/components/WaitAndCheckDomainStatus.vue b/core/frontend/src/views/domain/components/WaitAndCheckDomainStatus.vue
index 16afcbad..a42440df 100644
--- a/core/frontend/src/views/domain/components/WaitAndCheckDomainStatus.vue
+++ b/core/frontend/src/views/domain/components/WaitAndCheckDomainStatus.vue
@@ -1,69 +1,71 @@
<template>
<n-modal v-model:show="show" :close-on-esc="false" :mask-closable="false">
<n-card style="width: auto;">
- <div class="flex justify-start gap-2.5 bg-transparent items-center" >
+ <div class="flex justify-start gap-2.5 bg-transparent items-center">
<i class="i-svg-spinners:bars-scale text-[var(--color-primary-1)] text-6"></i>
<span class="flex items-center text-4">{{ $t("domain.waitAndCheckDomainStatus.loading") }}</span>
</div>
</n-card>
</n-modal>
-
+
<!-- Create Ai template -->
- <CreateTplModal ref="createTplModal" :only-ai="true"/>
+ <CreateTplModal ref="createTplModal" :only-ai="true" />
</template>
<script setup lang="ts">
- import CreateTplModal from '@/views/template/components/CreateTplModal.vue'
- import { useGlobalStore } from '@/store';
- import { instance } from '@/api';
- import { Message } from '@/utils';
- const { t } = useI18n()
- const show = ref(false)
- const globalStore = useGlobalStore()
- const createTplModal = ref()
+import CreateTplModal from '@/views/template/components/CreateTplModal.vue'
+import { useGlobalStore } from '@/store';
+import { instance } from '@/api';
+import { Message } from '@/utils';
+const { t } = useI18n()
+const show = ref(false)
+const globalStore = useGlobalStore()
+const createTplModal = ref()
- function open(domain: string) {
- checkStatus(domain)
- globalStore.domainSource = domain
- show.value = true
- }
- function close() {
- show.value = false
- }
- async function checkStatus(domain: string) {
- let timer = setInterval(async () => {
- const statusFlag = await getBaseInfoAndCheckStatus(domain)
- if (statusFlag) {
- close()
- clearInterval(timer)
- Message.success(t("domain.waitAndCheckDomainStatus.success"))
- createTplModal.value.open()
- }
- }, 1000)
- }
+function open(domain: string, callback?: () => void) {
+ checkStatus(domain, callback)
+ globalStore.domainSource = domain
+ show.value = true
+}
+function close() {
+ show.value = false
+}
+function checkStatus(domain: string, callback?: () => void) {
+
+ let timer = setInterval(async () => {
+ const statusFlag = await getBaseInfoAndCheckStatus(domain)
+ if (statusFlag) {
+ Message.success(t("domain.waitAndCheckDomainStatus.success"))
+ callback && callback()
+ close()
+ clearInterval(timer)
+ createTplModal.value.open()
+ }
+ }, 1000)
+}
- /**
- * @description Get base info and check status
- */
- async function getBaseInfoAndCheckStatus(domain: string) {
- try {
- const res = await instance.post("/askai/project/get_base_info", { domain }) as Record<string, any>
- if (res.update_time) {
- return true
- } else {
- return false
- }
- } catch (error) {
- console.warn(error)
- Message.error(t("domain.waitAndCheckDomainStatus.error"))
+/**
+ * @description Get base info and check status
+ */
+async function getBaseInfoAndCheckStatus(domain: string) {
+ try {
+ const res = await instance.post("/askai/project/get_base_info", { domain }) as Record<string, any>
+ if (res.update_time) {
+ return true
+ } else {
return false
}
+ } catch (error) {
+ console.warn(error)
+ Message.error(t("domain.waitAndCheckDomainStatus.error"))
+ return false
}
- defineExpose({
- open,
- close,
- checkStatus
- })
+}
+defineExpose({
+ open,
+ close,
+ checkStatus,
+})
</script>
diff --git a/core/frontend/src/views/domain/index.vue b/core/frontend/src/views/domain/index.vue
index e101ae11..b3847a46 100644
--- a/core/frontend/src/views/domain/index.vue
+++ b/core/frontend/src/views/domain/index.vue
@@ -29,277 +29,281 @@
</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,
- },
- render: row => {
- return (
- <>
+// Table columns
+const columns = ref<DataTableColumns<MailDomain>>([
+ {
+ key: 'domain',
+ title: t('domain.columns.domain'),
+ minWidth: 130,
+ ellipsis: {
+ tooltip: true,
+ },
+ render: row => {
+ // <i class="i-domain:brand-info w-5 h-5 mr-1.25"></i>
+ return (
+ <>
+ <div class="flex items-center">
+ {row.hasbrandinfo == 1 && <i class="i-domain:brand-info w-4 h-4 mr-1.25"></i>}
<NButton
text
type="primary"
onClick={() => handleEdit(row)}>
{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),
+ </div>
+ {row.default ? (
+ <NTag size="small" class="ml-8px" bordered={false}>
+ Default
+ </NTag>
+ ) : (
+ ''
+ )}
+ </>
+ )
},
- {
- 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 (
- <NButton
- type={day < 0 ? 'error' : 'primary'}
- text
- onClick={() => {
- handleShowSsl(row)
- }}>
- {day < 0 ? t('domain.ssl.expired') : t('domain.ssl.daysLeft', { days: day })}
- </NButton>
- )
- }
+ },
+ {
+ 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 (
<NButton
- type="warning"
+ type={day < 0 ? 'error' : 'primary'}
text
onClick={() => {
handleShowSsl(row)
}}>
- {t('domain.ssl.notSet')}
+ {day < 0 ? t('domain.ssl.expired') : t('domain.ssl.daysLeft', { days: day })}
</NButton>
)
- },
- },
- {
- 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>
- ),
+ }
+ return (
+ <NButton
+ type="warning"
+ text
+ onClick={() => {
+ handleShowSsl(row)
+ }}>
+ {t('domain.ssl.notSet')}
+ </NButton>
+ )
},
- ])
+ },
+ {
+ 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,
- },
+const [FormModal, formModalApi] = useModal({
+ component: DomainForm,
+ state: {
+ isEdit: false,
+ refresh: getTableData,
+ },
+})
+
+// Handle add domain
+const handleAddDomain = () => {
+ formModalApi.setState({
+ row: null,
+ isEdit: false,
})
+ formModalApi.open()
+}
- // Handle add domain
- const handleAddDomain = () => {
- formModalApi.setState({
- row: null,
- isEdit: false,
- })
- formModalApi.open()
- }
+// Handle open catch all
+// const handleOpenCatch = (row: MailDomain) => {
+// catchModalApi.setState({ row })
+// catchModalApi.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)
+// }
- // Handle close catch all
- // const handleCloseCatch = (row: MailDomain) => {
- // console.log(row)
- // }
+const [SslModal, sslModalApi] = useModal({
+ component: DomainSsl,
+ state: {
+ refresh: getTableData,
+ },
+})
- const [SslModal, sslModalApi] = useModal({
- component: DomainSsl,
- state: {
- refresh: getTableData,
- },
- })
+// Handle show ssl
+const handleShowSsl = (row: MailDomain) => {
+ sslModalApi.setState({ row })
+ sslModalApi.open()
+}
- // Handle show ssl
- const handleShowSsl = (row: MailDomain) => {
- sslModalApi.setState({ row })
- sslModalApi.open()
- }
+const [DnsModal, dnsModalApi] = useModal({
+ component: DomainDns,
+ state: {
+ refresh: getTableData,
+ },
+})
+
+// Handle DNS records
+const handleDNSRecord = (row: MailDomain) => {
+ dnsModalApi.setState({ row })
+ dnsModalApi.open()
+}
- const [DnsModal, dnsModalApi] = useModal({
- component: DomainDns,
- state: {
- refresh: getTableData,
+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 DNS records
- const handleDNSRecord = (row: MailDomain) => {
- dnsModalApi.setState({ row })
- dnsModalApi.open()
- }
+// Handle edit
+const handleEdit = (row: MailDomain) => {
- 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()
- },
- })
- }
+ /* formModalApi.setState({
+ row,
+ isEdit: true,
+ })
+ formModalApi.open() */
- // Handle edit
- const handleEdit = (row: MailDomain) => {
-
- /* formModalApi.setState({
- row,
- isEdit: true,
- })
- formModalApi.open() */
-
- router.push({
- name: "EditDomain",
- params: {
- domain: row.domain
- }
- })
- }
+ 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()
- },
- })
- }
+// 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/interface.ts b/core/frontend/src/views/domain/interface.ts
index 146de8ac..b0555350 100644
--- a/core/frontend/src/views/domain/interface.ts
+++ b/core/frontend/src/views/domain/interface.ts
@@ -15,6 +15,7 @@ export interface MailDomain {
active: number
default: number
email: string
+ hasbrandinfo: number
dns_records: DomainDnsRecords
cert_info: DomainCertInfo
}
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 bd170ef7..91f37b07 100644
--- a/core/frontend/src/views/domain/pages/editDomain/components/DomainConfiguration.vue
+++ b/core/frontend/src/views/domain/pages/editDomain/components/DomainConfiguration.vue
@@ -1,9 +1,8 @@
<template>
<div class="content-wrapper">
<div>
- <n-card class="mb-5">
- <!-- title -->
- <div class="page-tit">
+ <n-card>
+ <div class="page-tit mb-5">
<div class="left-tit">
<div class="back-tool">
<i class="i-cuida:mail-outline text-7"></i>
@@ -11,8 +10,6 @@
<span class="tit-content">{{ $t('domain.edit.domainConfiguration.title') }}</span>
</div>
</div>
- </n-card>
- <n-card>
<!-- form data -->
<n-form>
<n-form-item>
@@ -45,11 +42,34 @@
</n-form>
</n-card>
- <n-card class="mt-5">
- <n-form-item :label="$t('domain.edit.domainConfiguration.autoCreateBrand')">
- <n-switch v-model:value="configurationStatus"></n-switch>
- </n-form-item>
- <n-alert v-if="!configurationStatus" type="warning" class="mb-15px" :show-icon="false">
+ <n-card v-if="createdBrandInfo" class="mt-5">
+ <div class="page-tit mb-5">
+ <div class="left-tit">
+ <div class="back-tool">
+ <i class="i-cuida:mail-outline text-7"></i>
+ </div>
+ <span class="tit-content">{{ $t("domain.edit.domainConfiguration.brandInfo") }}</span>
+ </div>
+ <div class="right-tit">
+ <n-switch v-model:value="brandInfo" @update:value="switchBrandInfo"></n-switch>
+ </div>
+ </div>
+
+ <div class="w-100% flex flex-col gap-2.5">
+ <div v-for="(_, index) in urls" :key="index" class="flex justify-start items-center gap-2.5">
+ <n-input v-model:value="urls[index]" :placeholder="$t('domain.form.urlsPlacement')"
+ :disabled="!supplierStatus" readonly>
+ </n-input>
+ <div v-if="index != 0" class="close" @click="removeUrl(index)">
+ <i class="i-material-symbols:close-rounded text-5"></i>
+ </div>
+ </div>
+ </div>
+ </n-card>
+
+ <n-card v-else class="mt-5">
+ <div class="fw-bold text-4 mb-5 text-[#777]">{{ $t("domain.edit.domainConfiguration.noBrandInfo") }}</div>
+ <n-alert v-if="!supplierStatus" type="warning" class="mb-15px" :show-icon="false">
<div class="w-100% flex justify-between items-center">
<span class="mr-5">{{
$t('domain.edit.domainConfiguration.aiIntegrationWarning')
@@ -71,140 +91,122 @@
<n-form-item :label="$t('domain.edit.domainConfiguration.specifyDomain')">
<div class="w-100% flex flex-col gap-2.5">
<div v-for="(_, index) in urls" :key="index" class="flex justify-start items-center gap-2.5">
- <n-input v-model:value="urls[index]" :placeholder="$t('domain.form.urlsPlacement')">
+ <n-input v-model:value="urls[index]" :placeholder="$t('domain.form.urlsPlacement')"
+ :disabled="!supplierStatus">
</n-input>
<div v-if="index != 0" class="close" @click="removeUrl(index)">
<i class="i-material-symbols:close-rounded text-5"></i>
</div>
- <!-- <div v-else class="w-34px h-34px"></div> -->
</div>
- <n-button type="primary" ghost @click="addUrl">
+ <!-- <div class="text-[#777]">{{ $t("domain.form.maxUrl") }}</div> -->
+ <!-- <n-button type="primary" :disabled="!supplierStatus" ghost @click="addUrl">
<template #icon>
<i class="i-material-symbols:add-circle-outline"></i>
</template>
{{ $t('domain.edit.domainConfiguration.addMoreUrls') }}
- </n-button>
+ </n-button> -->
</div>
</n-form-item>
+ <n-button type="primary" class="w-100%" @click="createBrandInfo">{{ $t("domain.edit.domainConfiguration.createNow") }}</n-button>
</n-card>
</div>
-
- <!-- <n-card class="my-5">
- <div class="switch-settings">
- <div class="switch-item">
- <div class="label">Track Email Opens</div>
- <n-switch></n-switch>
- </div>
- <div class="switch-item" style="margin-bottom: 0;">
- <div class="label">Track Link Clicks</div>
- <n-switch></n-switch>
- </div>
- </div>
- </n-card> -->
-
- <!-- <n-card>
- <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>
- </div>
-
- <div class="switch-settings">
- <div class="switch-item">
- <div class="label">Include Unsubscribe Link</div>
- <n-switch></n-switch>
- </div>
- <div class="switch-item" style="margin-bottom: 0;">
- <div class="label">Inlcude Preferences Link</div>
- <n-switch></n-switch>
- </div>
- </div>
- </n-card> -->
</div>
+
+ <!-- Wait for init brand info -->
+ <WaitAndCheckDomainStatus ref="waitAndCheckDomainStatusRef" />
</template>
<script setup lang="ts">
- import { getDomainDetail, syncToUrl, removeUrl } from '../controller/domainConfiguration.controller'
- import { getEditDomainStoreData } from '../store'
- const { domainTit, quota, unit, mailboxes, catch_email, urls, configurationStatus } =
- getEditDomainStoreData()
- const route = useRoute()
- const domain = route.params.domain as any
- const uinitOptions = ref([
- {
- label: 'B',
- value: 'B',
- },
- {
- label: 'KB',
- value: 'KB',
- },
- {
- label: 'MB',
- value: 'MB',
- },
- {
- label: 'GB',
- value: 'GB',
- },
- {
- label: 'TB',
- value: 'TB',
- },
- ])
-
- getDomainDetail(domain)
+import WaitAndCheckDomainStatus from '@/views/domain/components/WaitAndCheckDomainStatus.vue'
+import {
+ checkAiConfiguration,
+} from '@/api/modules/domain'
+import { getDomainDetail, syncToUrl, removeUrl, createBrandInfo,switchBrandInfo } from '../controller/domainConfiguration.controller'
+import { getEditDomainStoreData } from '../store'
+const supplierStatus = ref(false)
+const { domainTit, quota, unit, mailboxes, catch_email, urls, brandInfo, createdBrandInfo, waitAndCheckDomainStatusRef } = getEditDomainStoreData()
+const route = useRoute()
+const domain = route.params.domain as any
+const uinitOptions = ref([
+ {
+ label: 'B',
+ value: 'B',
+ },
+ {
+ label: 'KB',
+ value: 'KB',
+ },
+ {
+ label: 'MB',
+ value: 'MB',
+ },
+ {
+ label: 'GB',
+ value: 'GB',
+ },
+ {
+ label: 'TB',
+ value: 'TB',
+ },
+])
- /**
- * @description Add url to urls
- */
- function addUrl() {
- urls.value.push('')
+getDomainDetail(domain)
+/**
+ * @description Check AI configuration
+ */
+async function checkAiConfig() {
+ const res = await checkAiConfiguration() as Record<string, any>
+ if (res) {
+ supplierStatus.value = res.is_configured
}
+}
+checkAiConfig()
+
+/**
+ * @description Add url to urls
+ */
+// function addUrl() {
+// urls.value.push('')
+// }
</script>
<style scoped lang="scss">
- @use '@/styles/index' as base;
- @use './mixin.scss' as mixin;
+@use '@/styles/index' as base;
+@use './mixin.scss' as mixin;
- .content-wrapper {
- @include mixin.content-wrapper;
+.content-wrapper {
+ @include mixin.content-wrapper;
- // title
- .page-tit {
- @include mixin.page-tit;
- }
+ // title
+ .page-tit {
+ @include mixin.page-tit;
+ }
- .form-label {
- @include mixin.form-label;
- }
+ .form-label {
+ @include mixin.form-label;
+ }
- // Switch settings
- .switch-settings {
- @mixin settings-label {
- font-size: 14px;
- font-weight: bold;
- }
+ // Switch settings
+ .switch-settings {
+ @mixin settings-label {
+ font-size: 14px;
+ font-weight: bold;
+ }
- .switch-item {
- @include base.row-flex;
- justify-content: space-between;
- margin-bottom: 15px;
+ .switch-item {
+ @include base.row-flex;
+ justify-content: space-between;
+ margin-bottom: 15px;
- .label {
- color: var(--color-text-2);
- @include settings-label();
- }
+ .label {
+ color: var(--color-text-2);
+ @include settings-label();
}
}
+ }
- .close {
- @include mixin.operation-close;
- }
+ .close {
+ @include mixin.operation-close;
}
+}
</style>
diff --git a/core/frontend/src/views/domain/pages/editDomain/components/ProjectDetails.vue b/core/frontend/src/views/domain/pages/editDomain/components/ProjectDetails.vue
index 68d1ffa3..d8978fd8 100644
--- a/core/frontend/src/views/domain/pages/editDomain/components/ProjectDetails.vue
+++ b/core/frontend/src/views/domain/pages/editDomain/components/ProjectDetails.vue
@@ -108,7 +108,7 @@
<input v-show="false" ref="faviconUpload" type="file"
@change="event => faviconChange(event, 'favicon')" />
</div>
- <div class="operation-tools">
+ <!-- <div class="operation-tools">
<div class="tool-item">
<i class="i-carbon:copy text-4"></i>
</div>
@@ -121,7 +121,7 @@
<div class="tool-item">
<i class="i-material-symbols:delete-outline text-4"></i>
</div>
- </div>
+ </div> -->
</div>
</div>
</n-card>
@@ -151,7 +151,7 @@
<span class="info-sub-tit">{{ formatTimeDifference(item.update_time) }} {{ $t('domain.edit.projectDetails.ago') }}</span>
</div>
<div class="info-right" @click="handleDelete(item)">
- <i class="i-material-symbols:close-rounded text-5"></i>
+ <i class="i-material-symbols:delete-outline text-5"></i>
</div>
</div>
<div class="operation">
@@ -181,7 +181,7 @@
<template #footer>
<div class="flex justify-end gap-5">
- <n-button @click="closeKnowledgeModal">{{ $t('domain.edit.projectDetails.Cancel') }}</n-button>
+ <n-button @click="closeKnowledgeModal">{{ $t('domain.edit.projectDetails.cancel') }}</n-button>
<n-button type="primary" :disabled="!knowledgeTitle || !knowledgeContent"
@click="createOrUpdateKnowledge">
{{ $t('domain.edit.projectDetails.create') }}
diff --git a/core/frontend/src/views/domain/pages/editDomain/controller/aiSettings.controller.ts b/core/frontend/src/views/domain/pages/editDomain/controller/aiSettings.controller.ts
index 62eb8386..0368952b 100644
--- a/core/frontend/src/views/domain/pages/editDomain/controller/aiSettings.controller.ts
+++ b/core/frontend/src/views/domain/pages/editDomain/controller/aiSettings.controller.ts
@@ -11,7 +11,7 @@ export async function getAisettingsInfo(domain: string) {
const { prompt, hasGotAisettings } = getEditDomainStoreData()
if (hasGotAisettings.value) return
try {
- const res = await instance.post("/askai/project/get_prompt", { domain }, instanceOptions) as Record<string, string>
+ const res = await instance.post("/askai/project/get_prompt", { domain }) as Record<string, string>
prompt.value = res.prompt
hasGotAisettings.value = true
} catch (error) {
diff --git a/core/frontend/src/views/domain/pages/editDomain/controller/companyProfile.controller.ts b/core/frontend/src/views/domain/pages/editDomain/controller/companyProfile.controller.ts
index 3e6fa895..d674da9c 100644
--- a/core/frontend/src/views/domain/pages/editDomain/controller/companyProfile.controller.ts
+++ b/core/frontend/src/views/domain/pages/editDomain/controller/companyProfile.controller.ts
@@ -1,10 +1,10 @@
import { instance } from "@/api";
import { getEditDomainStoreData } from "../store";
export const instanceOptions = {
- // fetchOptions: {
- // loading: 'Loading... Please wait.',
- // successMessage: true,
- // }
+ fetchOptions: {
+ loading: 'Loading... Please wait.',
+ successMessage: true,
+ }
}
/**
* @description Get company profile
@@ -23,7 +23,7 @@ export async function getCompanuyProfile(domain: string) {
} = getEditDomainStoreData()
if (hasGotCompanyProfile.value) return
try {
- const res = await instance.post("/askai/project/get_company_profile", { domain }, instanceOptions) as Record<string, any>
+ const res = await instance.post("/askai/project/get_company_profile", { domain } ) as Record<string, any>
legal_company_name.value = res.legal_company_name
web_site.value = res.web_site
company_profile.value = res.company_profile
diff --git a/core/frontend/src/views/domain/pages/editDomain/controller/domainConfiguration.controller.ts b/core/frontend/src/views/domain/pages/editDomain/controller/domainConfiguration.controller.ts
index 021ca5ae..bf6a93b3 100644
--- a/core/frontend/src/views/domain/pages/editDomain/controller/domainConfiguration.controller.ts
+++ b/core/frontend/src/views/domain/pages/editDomain/controller/domainConfiguration.controller.ts
@@ -1,139 +1,223 @@
-import { instance } from "@/api"
-import { instanceOptions } from "./companyProfile.controller"
-import { getEditDomainStoreData } from "../store"
-import { getByteUnit } from '@/utils'
+import { instance } from '@/api'
+import { instanceOptions } from './companyProfile.controller'
+import { getEditDomainStoreData } from '../store'
+import { getByteUnit, Message } from '@/utils'
+import { initAiConfiguration } from '@/api/modules/domain'
+import { useGlobalStore } from '@/store'
+import i18n from '@/i18n'
+/**
+ * @description Check if this domain has brand info
+ */
+// export async function checkDomainBrandInfo(domain: string) {
+// try {
+// const res = (await instance.post('/askai/project/get_project_status', { domain })) as {
+// create_status: boolean
+// status: boolean
+// }
+// if (res.update_time != 0) {
+// return true
+// } else {
+// return false
+// }
+// } catch (error) {
+// console.warn(error)
+// return false
+// }
+// }
/**
* @description Get domain detail
*/
export async function getDomainDetail(domain: string) {
- const {
- domainTit,
- quota,
- unit,
- mailboxes,
- catch_email,
- hasGotDomainConfiguration,
- urls
- } = getEditDomainStoreData()
- if (hasGotDomainConfiguration.value) return
- try {
- const { list } = await instance.get("/domains/list", { params: { keyword: domain, page: 1, page_size: 1 }, ...instanceOptions }) as { total: number, list: Record<string, any>[] }
- const quotaAndUnit = getByteUnit(list[0].quota, true, 2).split(" ")
- domainTit.value = list[0].domain
- quota.value = quotaAndUnit[0]
- unit.value = quotaAndUnit[1]
- mailboxes.value = list[0].mailboxes
- catch_email.value = list[0].email
- urls.value = list[0].urls
- await configurationStatus()
- hasGotDomainConfiguration.value = true
- } catch (error) {
- console.warn(error)
- }
+ const { domainTit, quota, unit, mailboxes, catch_email, hasGotDomainConfiguration, urls } =
+ getEditDomainStoreData()
+ if (hasGotDomainConfiguration.value) return
+ try {
+ const { list } = (await instance.get('/domains/list', {
+ params: { keyword: domain, page: 1, page_size: 1 },
+ })) as { total: number; list: Record<string, any>[] }
+ const quotaAndUnit = getByteUnit(list[0].quota, true, 2).split(' ')
+ domainTit.value = list[0].domain
+ quota.value = quotaAndUnit[0]
+ unit.value = quotaAndUnit[1]
+ mailboxes.value = list[0].mailboxes
+ catch_email.value = list[0].email
+ urls.value = list[0].urls
+ await configurationStatus(domain)
+ hasGotDomainConfiguration.value = true
+ } catch (error) {
+ console.warn(error)
+ }
}
/**
* @description Configuration status
*/
-export async function configurationStatus() {
- const { configurationStatus } = getEditDomainStoreData()
- try {
- const res = await instance.post("/askai/supplier/status") as Record<string, boolean>
- configurationStatus.value = res.is_configured
- } catch (error) {
- console.warn(error)
- }
+export async function configurationStatus(domain: string) {
+ const { brandInfo, createdBrandInfo } = getEditDomainStoreData()
+ try {
+ const res = (await instance.post('/askai/project/get_project_status', { domain })) as {
+ create_status: boolean
+ status: boolean
+ }
+ brandInfo.value = res.status
+ createdBrandInfo.value = res.create_status
+ } catch (error) {
+ console.warn(error)
+ }
}
/**
- * @description Update aomain
+ * @description Update domain
*/
export async function updateDomain() {
- const {
- domainTit,
- quota,
- unit,
- urls,
- mailboxes,
- catch_email
- } = getEditDomainStoreData()
- const quotaParam = calcBaseUnits(Number(quota.value), unit.value)
- try {
- await instance.post("/domains/update", {
- domain: domainTit.value,
- mailboxes: mailboxes.value,
- mailboxQuota: quotaParam,
- quota: quotaParam,
- rateLimit: 1,
- active: 1,
- email: catch_email.value,
- urls: urls.value
- }, instanceOptions)
- } catch (error) {
- console.warn(error)
- }
+ const {
+ domainTit,
+ quota,
+ unit,
+ urls,
+ mailboxes,
+ catch_email,
+ // brandInfo,
+ // waitAndCheckDomainStatusRef,
+ // configurationStatus,
+ } = getEditDomainStoreData()
+ const quotaParam = calcBaseUnits(Number(quota.value), unit.value)
+
+ try {
+ await instance.post(
+ '/domains/update',
+ {
+ domain: domainTit.value,
+ mailboxes: mailboxes.value,
+ mailboxQuota: quotaParam,
+ quota: quotaParam,
+ rateLimit: 1,
+ active: 1,
+ email: catch_email.value,
+ urls: urls.value,
+ },
+ instanceOptions
+ )
+ } catch (error) {
+ console.warn(error)
+ }
+}
+/**
+ * @description Create brand info
+ */
+export async function createBrandInfo() {
+ const { waitAndCheckDomainStatusRef, domainTit, urls, hasGotDomainConfiguration } =
+ getEditDomainStoreData()
+ const globalStore = useGlobalStore()
+ hasGotDomainConfiguration.value = false
+ if (urls.value.length == 0 || urls.value[0] == '') {
+ Message.error(i18n.global.t("domain.edit.domainConfiguration.fillDomain"))
+ } else {
+ try {
+ await initAiConfiguration({
+ domain: domainTit.value,
+ urls: urls.value,
+ })
+ globalStore.domainSource = domainTit.value
+ waitAndCheckDomainStatusRef.value.open(domainTit.value, () =>
+ getDomainDetail(domainTit.value)
+ )
+ } catch (error) {
+ console.warn(error)
+ }
+ }
}
/**
* @description Calculate based on units
*/
function calcBaseUnits(quota: number, unit: string) {
- switch (unit) {
- case "KB":
- return quota * 1024
- case "MB":
- return quota * 1024 * 1024
- case "GB":
- return quota * 1024 * 1024 * 1024
- case "TB":
- return quota * 1024 * 1024 * 1024 * 1024
- default:
- return quota
- }
+ switch (unit) {
+ case 'KB':
+ return quota * 1024
+ case 'MB':
+ return quota * 1024 * 1024
+ case 'GB':
+ return quota * 1024 * 1024 * 1024
+ case 'TB':
+ return quota * 1024 * 1024 * 1024 * 1024
+ default:
+ return quota
+ }
}
/**
* @description Sync domain to url
*/
export function syncToUrl(domainVal: string) {
- const { urls } = getEditDomainStoreData()
- const httpStr = urls.value[0].match(/http:\/\/?/g)
- const httpsStr = urls.value[0].match(/https:\/\/?/g)
- if(httpStr){
- urls.value[0] = httpStr[0] + domainVal
- }
+ const { urls } = getEditDomainStoreData()
+ const httpStr = urls.value[0].match(/http:\/\/?/g)
+ const httpsStr = urls.value[0].match(/https:\/\/?/g)
+ if (httpStr) {
+ urls.value[0] = httpStr[0] + domainVal
+ }
- if(httpsStr){
- urls.value[0] = httpsStr[0] + domainVal
- }
+ if (httpsStr) {
+ urls.value[0] = httpsStr[0] + domainVal
+ }
- if(!httpStr && !httpsStr){
- urls.value[0] = 'https://' + domainVal
- }
+ if (!httpStr && !httpsStr) {
+ urls.value[0] = 'https://' + domainVal
+ }
}
/**
* @description Remove url
*/
export function removeUrl(index: number) {
- const { urls } = getEditDomainStoreData()
-
- urls.value.splice(index, 1)
+ const { urls } = getEditDomainStoreData()
+
+ urls.value.splice(index, 1)
}
/**
* @description Reset all api status
*/
export function resetAllApiStatus() {
- const { hasGotAisettings, hasGotCompanyProfile, hasGotDomainConfiguration, hasGotFootersettings, hasGotProjectDetail, hasGotSitemap, hasGotStyling } = getEditDomainStoreData()
- hasGotAisettings.value = false
- hasGotCompanyProfile.value = false
- hasGotDomainConfiguration.value = false
- hasGotFootersettings.value = false
- hasGotProjectDetail.value = false
- hasGotSitemap.value = false
- hasGotStyling.value = false
-}
\ No newline at end of file
+ const {
+ hasGotAisettings,
+ hasGotCompanyProfile,
+ hasGotDomainConfiguration,
+ hasGotFootersettings,
+ hasGotProjectDetail,
+ hasGotSitemap,
+ hasGotStyling,
+ } = getEditDomainStoreData()
+ hasGotAisettings.value = false
+ hasGotCompanyProfile.value = false
+ hasGotDomainConfiguration.value = false
+ hasGotFootersettings.value = false
+ hasGotProjectDetail.value = false
+ hasGotSitemap.value = false
+ hasGotStyling.value = false
+}
+
+/**
+ * @description Switch brand info
+ */
+export async function switchBrandInfo(value: boolean) {
+ const { brandInfo, domainTit } = getEditDomainStoreData()
+ try {
+ await instance.post(
+ '/askai/project/set_project_status',
+ { domain: domainTit.value, status: value },
+ instanceOptions
+ )
+ await instance.post('/domains/update', {
+ domain: domainTit.value,
+ active: 1,
+ hasbrandinfo: Number(value),
+ })
+ } catch (error) {
+ brandInfo.value = !value
+ console.warn(error)
+ }
+}
diff --git a/core/frontend/src/views/domain/pages/editDomain/controller/footerSettings.controller.ts b/core/frontend/src/views/domain/pages/editDomain/controller/footerSettings.controller.ts
index 7d8edb60..f72fad4a 100644
--- a/core/frontend/src/views/domain/pages/editDomain/controller/footerSettings.controller.ts
+++ b/core/frontend/src/views/domain/pages/editDomain/controller/footerSettings.controller.ts
@@ -14,7 +14,7 @@ export async function getFootersettingsInfo(domain: string) {
} = getEditDomainStoreData()
if (hasGotFootersettings.value) return
try {
- const res = await instance.post("/askai/project/get_footer", { domain }, instanceOptions) as Record<string, string>
+ const res = await instance.post("/askai/project/get_footer", { domain }) as Record<string, string>
copyright_text.value = res.copyright_text
disclaimer.value = res.disclaimer
hasGotFootersettings.value = true
diff --git a/core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts b/core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts
index 3ddbf42d..fa00238b 100644
--- a/core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts
+++ b/core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts
@@ -5,7 +5,7 @@ import { KnowledgeBase } from '../dto'
/**
* @description Get project detail
*/
-export async function getProjectDetail(domainStr: string, noOption?: boolean) {
+export async function getProjectDetail(domainStr: string) {
const {
project_name,
primary_logo,
@@ -20,8 +20,7 @@ export async function getProjectDetail(domainStr: string, noOption?: boolean) {
try {
const res = (await instance.post(
'/askai/project/get_base_info',
- { domain: domainStr },
- noOption ? {} : instanceOptions
+ { domain: domainStr }
)) as Record<string, any>
project_name.value = res.project_name
primary_logo.value = res.primary_logo
@@ -77,7 +76,7 @@ export async function createKnowledgeBase(domain: string) {
instanceOptions
)) as Record<string, any>
hasGotProjectDetail.value = false
- await getProjectDetail(domain, true)
+ await getProjectDetail(domain)
closeKnowledgeModal()
} catch (error) {
console.warn(error)
@@ -98,7 +97,7 @@ export async function updateKnowledgeBase(domain: string) {
kid: activeKnowledge.value.kid,
})
hasGotProjectDetail.value = false
- await getProjectDetail(domain, true)
+ await getProjectDetail(domain)
closeKnowledgeModal()
} catch (error) {
console.warn(error)
@@ -143,7 +142,7 @@ export async function deleteKnowledgeBase(domain: string, knowledge: KnowledgeBa
instanceOptions
)
hasGotProjectDetail.value = false
- getProjectDetail(domain, true)
+ getProjectDetail(domain)
} catch (error) {
console.warn(error)
}
diff --git a/core/frontend/src/views/domain/pages/editDomain/controller/styling.controller.ts b/core/frontend/src/views/domain/pages/editDomain/controller/styling.controller.ts
index 7cf2e1da..68c94092 100644
--- a/core/frontend/src/views/domain/pages/editDomain/controller/styling.controller.ts
+++ b/core/frontend/src/views/domain/pages/editDomain/controller/styling.controller.ts
@@ -20,7 +20,7 @@ export async function getStylingInfo(domain: string) {
} = getEditDomainStoreData()
if (hasGotStyling.value) return
try {
- const res = await instance.post("/askai/project/get_style_config", { domain }, instanceOptions) as Record<string, any>
+ const res = await instance.post("/askai/project/get_style_config", { domain }) as Record<string, any>
accent_color.value = res.accent_color
text_color.value = res.text_color
page_background.value = res.page_background
diff --git a/core/frontend/src/views/domain/pages/editDomain/controller/typography.controller.ts b/core/frontend/src/views/domain/pages/editDomain/controller/typography.controller.ts
index 61f87820..6e076b16 100644
--- a/core/frontend/src/views/domain/pages/editDomain/controller/typography.controller.ts
+++ b/core/frontend/src/views/domain/pages/editDomain/controller/typography.controller.ts
@@ -14,7 +14,7 @@ export async function updateTypography(domain: string) {
domain,
heading_font: heading_font.value,
body_font: body_font.value
- }, instanceOptions)
+ })
} catch (error) {
console.warn(error)
}
diff --git a/core/frontend/src/views/domain/pages/editDomain/index.vue b/core/frontend/src/views/domain/pages/editDomain/index.vue
index ee2eb5a1..73b9ba86 100644
--- a/core/frontend/src/views/domain/pages/editDomain/index.vue
+++ b/core/frontend/src/views/domain/pages/editDomain/index.vue
@@ -7,11 +7,8 @@
<!-- Content tabs -->
<div class="content-tabs">
- <div
- v-for="(item, index) in menuList"
- :key="index"
- :class="['tab-item', { active: activeTab == item }]"
- @click="activeTab = item">
+ <div v-for="(item, index) in menuList" :key="index" :class="['tab-item', { active: activeTab == item }]"
+ @click="switchToTab(item)">
<span>{{ getTabLabel(item) }}</span>
</div>
</div>
@@ -42,7 +39,9 @@ import { updateTypography } from './controller/typography.controller'
// import {} from "./controller/sitemap.controller"
import { updateFooterSettingsInfo } from './controller/footerSettings.controller'
import { updateAiSettingsInfo } from './controller/aiSettings.controller'
-
+import { getEditDomainStoreData } from './store'
+import { Message } from '@/utils'
+const { createdBrandInfo } = getEditDomainStoreData()
const DomainConfiguration = defineAsyncComponent(
() => import('./components/DomainConfiguration.vue')
)
@@ -66,6 +65,14 @@ const menuList = ref([
// 'AI Settings',
])
+const dynamicMenuList = computed(() => {
+ if (createdBrandInfo.value) {
+ return menuList.value
+ } else {
+ return menuList.value.filter(item => item == 'Domain Configuration')
+ }
+})
+
const activeTab = ref('Domain Configuration')
const contentMap = new Map([
@@ -132,6 +139,21 @@ function switchHanldeSave() {
* Reset all api status when router leave
*/
onBeforeRouteLeave(resetAllApiStatus)
+
+/**
+ * @description Switch to tab
+ */
+function switchToTab(tab: string) {
+ if(tab == "Domain Configuration"){
+ activeTab.value = tab
+ } else {
+ if(createdBrandInfo.value){
+ activeTab.value = tab
+ }else{
+ Message.info(t("domain.edit.common.noBrandInfo"))
+ }
+ }
+}
</script>
<style scoped lang="scss">
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 6ca09a7e..48c2bceb 100644
--- a/core/frontend/src/views/domain/pages/editDomain/store/index.ts
+++ b/core/frontend/src/views/domain/pages/editDomain/store/index.ts
@@ -10,7 +10,9 @@ const editDomainStore = defineStore("editDomainStore", () => {
const mailboxes = ref(0)
const catch_email = ref("")
const urls = ref(["https://"])
- const configurationStatus = ref(false)
+ const brandInfo = ref(false)
+ const waitAndCheckDomainStatusRef = ref()
+ const createdBrandInfo = ref(false)
@@ -84,7 +86,9 @@ const editDomainStore = defineStore("editDomainStore", () => {
mailboxes,
catch_email,
urls,
- configurationStatus,
+ brandInfo,
+ waitAndCheckDomainStatusRef,
+ createdBrandInfo,
hasGotProjectDetail,
domain,
diff --git a/core/frontend/src/views/settings/ai-model/components/AddModel.vue b/core/frontend/src/views/settings/ai-model/components/AddModel.vue
index f227a18c..c18e2e91 100644
--- a/core/frontend/src/views/settings/ai-model/components/AddModel.vue
+++ b/core/frontend/src/views/settings/ai-model/components/AddModel.vue
@@ -19,7 +19,7 @@
</n-select>
</n-form-item>
<n-form-item label="最大上下文长度" path="max_tokens">
- <n-input-number v-model:value="addModelFormData.max_tokens" class="w-100%"></n-input-number>
+ <n-input-number v-model:value="addModelFormData.max_tokens" :min="1" class="w-100%"></n-input-number>
</n-form-item>
</n-form>
<template #footer>
@@ -97,8 +97,8 @@ function open() {
*/
function close() {
show.value = false
- addModelFormData.value.capability = []
- addModelFormData.value.max_tokens = 0
+ addModelFormData.value.capability = ["llm"]
+ addModelFormData.value.max_tokens = 8192
addModelFormData.value.modelId = ''
addModelFormData.value.title = ''
}
diff --git a/core/frontend/src/views/settings/ai-model/components/AddProvider.vue b/core/frontend/src/views/settings/ai-model/components/AddProvider.vue
index 13e46f39..ff31112a 100644
--- a/core/frontend/src/views/settings/ai-model/components/AddProvider.vue
+++ b/core/frontend/src/views/settings/ai-model/components/AddProvider.vue
@@ -14,10 +14,10 @@
<n-form-item label="供应商名称" path="supplierName">
<n-input v-model:value="addProviderFormData.supplierName"></n-input>
</n-form-item>
- <n-form-item label="接口地址" path="baseUrl">
+ <n-form-item label="BaseURL" path="baseUrl">
<n-input v-model:value="addProviderFormData.baseUrl"></n-input>
</n-form-item>
- <n-form-item label="密钥" path="apiKey">
+ <n-form-item label="ApiKey" path="apiKey">
<n-input v-model:value="addProviderFormData.apiKey"></n-input>
</n-form-item>
</n-form>
diff --git a/core/frontend/src/views/settings/ai-model/components/ModelManager.vue b/core/frontend/src/views/settings/ai-model/components/ModelManager.vue
index 17ed54d9..6889d6e3 100644
--- a/core/frontend/src/views/settings/ai-model/components/ModelManager.vue
+++ b/core/frontend/src/views/settings/ai-model/components/ModelManager.vue
@@ -32,7 +32,9 @@
<div class="top-switch">
<div class="switch-info">
<!-- <i class="i-ic:baseline-error text-5"></i> -->
- <span class="tit">{{ currentProvider.supplierName[0].toUpperCase() + currentProvider.supplierName.slice(1) }}</span>
+ <span class="tit">{{ currentProvider.supplierName ? currentProvider.supplierName[0].toUpperCase()
+ +
+ currentProvider.supplierName.slice(1):"" }}</span>
<n-switch v-model:value="currentProvider.status"
@update:value="status => changeProviderStatus(status, modelStore)"></n-switch>
</div>
@@ -67,9 +69,9 @@
<span class="sub-tit">默认从/models获取所有模型</span>
</div>
<div class="add-model" @click="handleAddModel">
- <i class="i-ic:baseline-control-point text-4"></i>
- <span class="tit">新建模型</span>
- </div>
+ <i class="i-ic:baseline-control-point text-4"></i>
+ <span class="tit">添加模型</span>
+ </div>
</div>
<div v-for="item in modelList" :key="item.title" class="model-list">
<div class="model-item">
@@ -77,8 +79,9 @@
<span class="model-name">{{ item.title }}</span>
<div class="operation">
<n-switch v-model:value="item.status" @update:value="
- status => setModelStatus(item.modelId, status, modelStore)
+ status => setModelStatus(item, status, modelStore)
"></n-switch>
+ <i class="i-material-symbols:delete-outline text-5" @click="removeModel(item,modelStore)"></i>
</div>
</div>
</div>
@@ -95,220 +98,221 @@
</template>
<script setup lang="ts">
- import AddProvider from './AddProvider.vue'
- import AddModel from './AddModel.vue'
- import { ModelStore, Provider } from '../dto'
- import {
- getModelList,
- getProviderList,
- getProviderConfiguration,
- changeProviderStatus,
- checkProviderApiConfiguration,
- setProviderConfiguration,
- setModelStatus,
- removeProvider,
- } from '../controller'
- const modelStore = inject<ModelStore>('modelStore')!
- const {
- providerList,
- modelList,
- currentProvider,
- configurationLoading,
- addProviderRef,
- addModelRef,
- } = modelStore
- getProviderList(modelStore)
-
- /**
- * @description Get model list
- */
- function getModelListBySupplier(provider: Provider) {
- currentProvider.value = provider
- getModelList(provider.supplierName, modelStore)
- }
-
- /**
- * @description Handle add provider
- */
- function handleAddProvider() {
- addProviderRef.value.open()
- }
-
- /**
- * @description Handle add model
- */
- function handleAddModel() {
- addModelRef.value.open()
- }
+import AddProvider from './AddProvider.vue'
+import AddModel from './AddModel.vue'
+import { ModelStore, Provider } from '../dto'
+import {
+ getModelList,
+ getProviderList,
+ getProviderConfiguration,
+ changeProviderStatus,
+ checkProviderApiConfiguration,
+ setProviderConfiguration,
+ setModelStatus,
+ removeProvider,
+ removeModel
+} from '../controller'
+const modelStore = inject<ModelStore>('modelStore')!
+const {
+ providerList,
+ modelList,
+ currentProvider,
+ configurationLoading,
+ addProviderRef,
+ addModelRef,
+} = modelStore
+getProviderList(modelStore)
+
+/**
+ * @description Get model list
+ */
+function getModelListBySupplier(provider: Provider) {
+ currentProvider.value = provider
+ getModelList(provider.supplierName, modelStore)
+}
+
+/**
+ * @description Handle add provider
+ */
+function handleAddProvider() {
+ addProviderRef.value.open()
+}
+
+/**
+ * @description Handle add model
+ */
+function handleAddModel() {
+ addModelRef.value.open()
+}
</script>
<style scoped lang="scss">
- @use '@/styles/index.scss' as base;
+@use '@/styles/index.scss' as base;
- .manager-wrapper {
- // height: 480px;
- display: grid;
- grid-template-columns: 230px 1fr;
- /* border-top: 1px solid var(--color-border-2);
+.manager-wrapper {
+ // height: 480px;
+ display: grid;
+ grid-template-columns: 230px 1fr;
+ /* border-top: 1px solid var(--color-border-2);
border-bottom: 1px solid var(--color-border-2); */
- .left-provider {
- height: 100%;
- display: grid;
- grid-template-rows: 1fr 60px;
- border-right: 1px solid var(--color-border-2);
+ .left-provider {
+ height: 100%;
+ display: grid;
+ grid-template-rows: 1fr 60px;
+ border-right: 1px solid var(--color-border-2);
- .provider-list {
- @include base.col-flex;
- gap: 0;
+ .provider-list {
+ @include base.col-flex;
+ gap: 0;
- .provider-item {
- height: 50px;
- width: 100%;
- box-sizing: border-box;
- padding-left: 10px;
- border-bottom: 1px solid var(--color-border-1);
- @include base.row-flex-start;
- gap: 5px;
- align-items: center;
- transition: 0.15s all ease-in-out;
- cursor: pointer;
+ .provider-item {
+ height: 50px;
+ width: 100%;
+ box-sizing: border-box;
+ padding-left: 10px;
+ border-bottom: 1px solid var(--color-border-1);
+ @include base.row-flex-start;
+ gap: 5px;
+ align-items: center;
+ transition: 0.15s all ease-in-out;
+ cursor: pointer;
- .tit {
- font-size: 14px;
- font-weight: bold;
- }
+ .tit {
+ font-size: 14px;
+ font-weight: bold;
+ }
- &:hover {
- background: #eef9ee;
- }
+ &:hover {
+ background: #eef9ee;
+ }
- &.active {
- background: #eef9ee;
- }
+ &.active {
+ background: #eef9ee;
+ }
- .item-icon {
- width: 32px;
- @include base.row-flex-center;
- }
+ .item-icon {
+ width: 32px;
+ @include base.row-flex-center;
+ }
- .status {
- display: block;
- width: 8px;
- height: 8px;
- background: var(--color-text-3);
- border-radius: 50%;
+ .status {
+ display: block;
+ width: 8px;
+ height: 8px;
+ background: var(--color-text-3);
+ border-radius: 50%;
- &.active {
- background: var(--color-primary-1)
- }
+ &.active {
+ background: var(--color-primary-1)
}
}
}
+ }
- .add-privider {
- @include base.row-flex-center;
+ .add-privider {
+ @include base.row-flex-center;
+ }
+ }
+
+ .right-configuration {
+ padding: 0 15px 15px;
+
+ .top-switch {
+ height: 50px;
+ @include base.row-flex;
+ align-items: center;
+ justify-content: space-between;
+ border-bottom: 1px solid var(--color-border-2);
+
+ .switch-info {
+ @include base.row-flex-start;
+ align-items: center;
+ gap: 5px;
+
+ .tit {
+ font-size: 14px;
+ font-weight: bold;
+ }
}
}
- .right-configuration {
- padding: 0 15px 15px;
+ .center-api {
+ padding-bottom: 15px;
+ border-bottom: 1px solid var(--color-border-2);
+ }
+
+ .bottom-model-list {
+ margin-top: 15px;
- .top-switch {
- height: 50px;
+ .header-tit {
@include base.row-flex;
- align-items: center;
justify-content: space-between;
- border-bottom: 1px solid var(--color-border-2);
+ margin-bottom: 15px;
+
+ .tit {
+ font-weight: bold;
+ font-size: 14px;
+ margin-right: 5px;
+ }
+
+ .sub-tit {
+ color: var(--color-text-3);
+ }
- .switch-info {
+ .add-model {
@include base.row-flex-start;
- align-items: center;
gap: 5px;
+ align-items: center;
+ cursor: pointer;
.tit {
font-size: 14px;
- font-weight: bold;
}
}
}
- .center-api {
- padding-bottom: 15px;
- border-bottom: 1px solid var(--color-border-2);
- }
-
- .bottom-model-list {
- margin-top: 15px;
+ .model-list {
+ @include base.col-flex;
+ justify-content: flex-start;
- .header-tit {
+ .model-item {
@include base.row-flex;
justify-content: space-between;
- margin-bottom: 15px;
+ width: 100%;
+ align-items: center;
+ padding: 10px 5px;
+ transition: 0.15s all ease-in-out;
+ cursor: pointer;
- .tit {
+ i.active {
+ color: var(--color-primary-1);
+ }
+
+ .model-name {
font-weight: bold;
font-size: 14px;
- margin-right: 5px;
}
- .sub-tit {
- color: var(--color-text-3);
+ &:hover {
+ background: #eef9ee;
}
- .add-model {
+ .operation {
@include base.row-flex-start;
- gap: 5px;
- align-items: center;
- cursor: pointer;
-
- .tit {
- font-size: 14px;
- }
- }
- }
-
- .model-list {
- @include base.col-flex;
- justify-content: flex-start;
-
- .model-item {
- @include base.row-flex;
- justify-content: space-between;
- width: 100%;
- align-items: center;
- padding: 10px 5px;
- transition: 0.15s all ease-in-out;
- cursor: pointer;
-
- i.active {
- color: var(--color-primary-1);
- }
-
- .model-name {
- font-weight: bold;
- font-size: 14px;
- }
-
- &:hover {
- background: #eef9ee;
- }
-
- .operation {
- @include base.row-flex-start;
- gap: 10px;
- }
+ gap: 10px;
}
}
}
}
}
+}
</style>
<style>
- .customer-modal {
- .n-card__content {
- padding: 0 !important;
- }
+.customer-modal {
+ .n-card__content {
+ padding: 0 !important;
}
+}
</style>
diff --git a/core/frontend/src/views/settings/ai-model/controller/index.ts b/core/frontend/src/views/settings/ai-model/controller/index.ts
index 7a8cb0ce..df3d0e4b 100644
--- a/core/frontend/src/views/settings/ai-model/controller/index.ts
+++ b/core/frontend/src/views/settings/ai-model/controller/index.ts
@@ -1,5 +1,6 @@
import { instance } from '@/api'
import { Model, ModelStore, Provider } from '../dto'
+import { confirm } from '@/utils'
export const instanceOptions = {
fetchOptions: {
loading: 'Loading... Please wait.',
@@ -46,6 +47,8 @@ export async function getModelList(supplierName: string, modelStore: ModelStore)
export async function confirmAddProvider(modelStore: ModelStore) {
const { addProviderFormData, addProviderFormDataRef, addProviderRef } = modelStore
try {
+ const checkStatus = await checkProviderConfig(modelStore)
+ if (!checkStatus) return false
await addProviderFormDataRef.value?.validate()
await instance.post('/askai/supplier/add_supplier', addProviderFormData.value, instanceOptions)
addProviderRef.value.close()
@@ -158,19 +161,20 @@ export async function setProviderConfiguration(modelStore: ModelStore) {
/**
* @description Set model status
*/
-export async function setModelStatus(modelId: string, status: boolean, modelStore: ModelStore) {
+export async function setModelStatus(model: Model, status: boolean, modelStore: ModelStore) {
const { currentProvider } = modelStore
try {
await instance.post(
'/askai/supplier/set_model_status',
{
supplierName: currentProvider.value.supplierName,
- modelId,
+ modelId: model.modelId,
status,
},
instanceOptions
)
} catch (error) {
+ model.status = !status
console.warn(error)
}
}
@@ -180,14 +184,56 @@ export async function setModelStatus(modelId: string, status: boolean, modelStor
*/
export async function removeProvider(modelStore: ModelStore) {
const { currentProvider } = modelStore
+ confirm({
+ title: 'Notice',
+ content: `Are you sure to remove the provider "${currentProvider.value.supplierName}"?`,
+ onConfirm: async () => {
+ try {
+ await instance.post(
+ '/askai/supplier/remove_supplier',
+ { supplierName: currentProvider.value.supplierName },
+ instanceOptions
+ )
+ await getProviderList(modelStore)
+ } catch (error) {
+ console.warn(error)
+ }
+ },
+ })
+}
+
+/**
+ * @description Check provider configuration
+ */
+export async function checkProviderConfig(store: ModelStore) {
+ const { addProviderFormData } = store
try {
- await instance.post(
- '/askai/supplier/remove_supplier',
- { supplierName: currentProvider.value.supplierName },
- instanceOptions
- )
- await getProviderList(modelStore)
+ await instance.post('/askai/supplier/testing', addProviderFormData.value)
+ return true
} catch (error) {
console.warn(error)
+ return false
}
}
+
+/**
+ * @description Remove model
+ */
+export async function removeModel(model: Model, modelStore: ModelStore) {
+ confirm({
+ title: 'Notice',
+ content: `Are you sure to remove the Model "${model.title}"?`,
+ onConfirm: async () => {
+ try {
+ await instance.post(
+ '/askai/supplier/remove_model',
+ { supplierName: model.supplierName, modelId: model.modelId },
+ instanceOptions
+ )
+ await getModelList(model.supplierName,modelStore)
+ } catch (error) {
+ console.warn(error)
+ }
+ },
+ })
+}
diff --git a/core/frontend/src/views/settings/ai-model/store/index,.ts b/core/frontend/src/views/settings/ai-model/store/index,.ts
index 35a5acd1..c3063fc1 100644
--- a/core/frontend/src/views/settings/ai-model/store/index,.ts
+++ b/core/frontend/src/views/settings/ai-model/store/index,.ts
@@ -30,7 +30,7 @@ export function useModelManagerStore(): ModelStore {
title: "",
modelId: "",
max_tokens: 8192,
- capability: []
+ capability: ["llm"]
})
const addModelFormRef = ref<FormInst | null | undefined>()
const addModelRef = ref<any>()
diff --git a/core/frontend/src/views/template/components/CreateTplModal.vue b/core/frontend/src/views/template/components/CreateTplModal.vue
index d0af2015..0f9e7e6b 100644
--- a/core/frontend/src/views/template/components/CreateTplModal.vue
+++ b/core/frontend/src/views/template/components/CreateTplModal.vue
@@ -11,7 +11,7 @@
<div :class="['url-source', { hidden: choosedMethod !== 'AI' }]">
<span class="label">{{ $t("template.createTpl.sourceUrl") }}</span>
<n-select v-model:value="sourceDomain" class="flex-1" label-field="domain" value-field="domain"
- :options="domainList">
+ :options="domainListHasBrandInfo">
</n-select>
</div>
<div class="desc">
@@ -54,10 +54,15 @@
}
})
+ const domainListHasBrandInfo = computed(() => {
+ return domainList.value.filter((item: any) => item.hasbrandinfo == 1)
+ })
+
/**
* @description open modal
*/
function open() {
+ getDomainList()
if(globalStore.domainSource){
globalStore.domainSource = sourceDomain.value
}
@@ -108,7 +113,7 @@
}
}
- getDomainList()
+
</script>
<style scoped lang="scss">
diff --git a/core/frontend/src/views/template/pages/AITemplate/controller/index.ts b/core/frontend/src/views/template/pages/AITemplate/controller/index.ts
index 7007052f..ea0193c9 100644
--- a/core/frontend/src/views/template/pages/AITemplate/controller/index.ts
+++ b/core/frontend/src/views/template/pages/AITemplate/controller/index.ts
@@ -129,10 +129,25 @@ export async function stopChat(store: TemplateStore) {
}
}
+/***
+ * @description Check shift+enter
+ */
+function checkShiftEnter(e: KeyboardEvent, content: Ref<string>) {
+ if (e.shiftKey && e.key === 'Enter') {
+ e.preventDefault()
+ const textarea = e.target as HTMLTextAreaElement
+ const start = textarea.selectionStart
+ const end = textarea.selectionEnd
+ content.value = content.value.substring(0, start) + '\n' + content.value.substring(end)
+ textarea.selectionStart = textarea.selectionEnd = start + 1
+ return true
+ }
+}
+
/**
* Send chat and generate markdown
*/
-export async function sendChat(store: TemplateStore) {
+export async function sendChat(store: TemplateStore, e?: KeyboardEvent) {
const {
scrollable,
generateShow,
@@ -147,6 +162,7 @@ export async function sendChat(store: TemplateStore) {
} = store
if (isChat.value) return
if (!questionContent.value) return
+ if (e && checkShiftEnter(e, questionContent)) return
const chatRecordKey = `${questionContent.value}_+_${chatRecord.value.size}`
chatRecord.value.set(chatRecordKey, [])
currentChatRecordKey.value = chatRecordKey
@@ -159,7 +175,6 @@ export async function sendChat(store: TemplateStore) {
// Character pointer position
let strPos = 0
-
/**
* @description spliced content
*/
@@ -295,16 +310,16 @@ export function removeHtmlCodeBlockMarkers(content: string) {
* @description Remove sign code for "<<<<<search" and ">>>>>replace"
*/
export function removeSignCode(content: string) {
- const signCodeRegex = /<<<<<<<\s+SEARCH[\s\S]*?=======([\s\S]*?)>>>>>>>\s+REPLACE/g;
- return content.replace(signCodeRegex, "$1")
+ const signCodeRegex = /<<<<<<<\s+SEARCH[\s\S]*?=======([\s\S]*?)>>>>>>>\s+REPLACE/g
+ return content.replace(signCodeRegex, '$1')
}
/**
* @description Get content from title tags
*/
export function getContentFromTitleTags(content: string) {
- const match = content.match(/<title>(.*?)<\/title>/i);
- return match ? match[1] : '';
+ const match = content.match(/<title>(.*?)<\/title>/i)
+ return match ? match[1] : ''
}
/**
@@ -343,4 +358,5 @@ export async function saveCodeChange(store: TemplateStore) {
/**
* @description Duplicate template
*/
-export async function duplicateTemplate() { }
+export async function duplicateTemplate() {}
+
diff --git a/core/frontend/src/views/template/pages/AITemplate/index.vue b/core/frontend/src/views/template/pages/AITemplate/index.vue
index 2e7aeb67..88bb4f4c 100644
--- a/core/frontend/src/views/template/pages/AITemplate/index.vue
+++ b/core/frontend/src/views/template/pages/AITemplate/index.vue
@@ -66,10 +66,10 @@
<n-card style="height: 100%">
<n-input v-model:value="questionContent" type="textarea"
:placeholder="$t('template.ai.welcomeMessage', { domain: chatInfo.domain })"
- class="question-input" @keydown.enter="sendChat(store)"></n-input>
+ class="question-input" @keydown.enter="e => sendChat(store, e)"></n-input>
<div class="question-tools">
- <n-select v-model:value="currentModelTitle" :options="modelList"
- label-field="title" value-field="title" @update:value="changeModel">
+ <n-select v-model:value="currentModelTitle" :options="modelList" label-field="title"
+ value-field="title" @update:value="changeModel">
</n-select>
<div class="send-btn">
@@ -90,23 +90,25 @@
<n-card style="height: 100%">
<div style="height: calc(100vh - 165px)">
<div class="h-10 flex justify-between items-center gap-2.5 mb-5">
- <n-button-group size="small">
- <n-button :type="previewStatus == 'view' ? 'primary' : 'default'"
- @click="previewStatus = 'view'">
- <template #icon>
- <i class="i-mingcute:eye-2-fill text-5"></i>
- </template>
- {{ $t('template.ai.buttons.view') }}
- </n-button>
- <n-button :type="previewStatus == 'edit' ? 'primary' : 'default'"
- @click="previewStatus = 'edit'">
- <template #icon>
- <i class="i-tdesign:code text-5"></i>
- </template>
- {{ $t('template.ai.buttons.edit') }}
- </n-button>
- </n-button-group>
- <span v-if="previewStatus == 'edit'">{{ $t('template.ai.tips.saveShortcut') }}</span>
+ <div class="flex justify-start items-center gap-2.5">
+ <n-button-group size="small">
+ <n-button :type="previewStatus == 'view' ? 'primary' : 'default'"
+ @click="previewStatus = 'view'">
+ <template #icon>
+ <i class="i-mingcute:eye-2-fill text-5"></i>
+ </template>
+ {{ $t('template.ai.buttons.view') }}
+ </n-button>
+ <n-button :type="previewStatus == 'edit' ? 'primary' : 'default'"
+ @click="previewStatus = 'edit'">
+ <template #icon>
+ <i class="i-tdesign:code text-5"></i>
+ </template>
+ {{ $t('template.ai.buttons.edit') }}
+ </n-button>
+ </n-button-group>
+ <span v-if="previewStatus == 'edit'">{{ $t('template.ai.tips.saveShortcut') }}</span>
+ </div>
<span class="text-4 fw-bold">{{ previewTit }}</span>
<n-button style="width: 134px;" type="primary" :disabled="!previewCode"
@click="goToSendEmail">
@@ -118,8 +120,8 @@
</div>
<n-scrollbar style="height: calc(100% - 40px)">
<div v-if="previewStatus == 'view' && isChat" v-html="previewCode"></div>
- <iframe v-else-if="previewStatus == 'view' && !isChat" :srcdoc="previewCode" frameborder="0" class="w-100%"
- style="height: calc(100vh - 224px)"></iframe>
+ <iframe v-else-if="previewStatus == 'view' && !isChat" :srcdoc="previewCode" frameborder="0"
+ class="w-100%" style="height: calc(100vh - 224px)"></iframe>
<BtEditor v-else v-model:value="previewCode" style="height: calc(100vh - 217px)"
@save="saveCodeChange(store)">
</BtEditor>
@@ -132,254 +134,254 @@
</template>
<script setup lang="ts">
- import { useGlobalStore } from '@/store'
- import {
- initialTemplateInfo,
- sendChat,
- removeHtmlCodeBlockMarkers,
- getHtmlTemplateContent,
- saveCodeChange,
- stopChat,
- removeSignCode,
- getContentFromTitleTags
- } from './controller'
- import MarkdownRender from './components/MarkdownRender.vue'
- import { useTemplateStore } from './store'
- import { TemplateStore } from './dto'
- import BtEditor from '@/components/base/bt-editor/index.vue'
- const globalStore = useGlobalStore()
- const router = useRouter()
- const store = useTemplateStore()
- provide<TemplateStore>('modelStore', store)
- const {
- chatId,
- modelList,
- currentModelTitle,
- previewCode,
- questionContent,
- chatRecord,
- currentChatRecordKey,
- currentModel,
- isChat,
- chatScrollRef,
- scrollWrapperRef,
- scrollable,
- chatInfo,
- previewTit
- } = store
- const route = useRoute()
-
- const previewStatus = ref('view')
-
- chatId.value = route.params.chatId as string
-
- /**
- * @description Handle model select
- */
- function changeModel(_: string, options: any) {
- currentModel.value = options
- }
-
- /**
- * @description Get html template code content
- */
- getHtmlTemplateContent(store)
-
- /**
- * @description Initial chatInfo and modelList
- */
- initialTemplateInfo(store)
-
- /**
- * @description Render page code
- */
- function handleCodeRender(data: { code: string; key: string }) {
- if (data.key == currentChatRecordKey.value) {
- previewCode.value = removeSignCode(removeHtmlCodeBlockMarkers(data.code))
- previewTit.value = getContentFromTitleTags(previewCode.value)
- }
+import { useGlobalStore } from '@/store'
+import {
+ initialTemplateInfo,
+ sendChat,
+ removeHtmlCodeBlockMarkers,
+ getHtmlTemplateContent,
+ saveCodeChange,
+ stopChat,
+ removeSignCode,
+ getContentFromTitleTags
+} from './controller'
+import MarkdownRender from './components/MarkdownRender.vue'
+import { useTemplateStore } from './store'
+import { TemplateStore } from './dto'
+import BtEditor from '@/components/base/bt-editor/index.vue'
+const globalStore = useGlobalStore()
+const router = useRouter()
+const store = useTemplateStore()
+provide<TemplateStore>('modelStore', store)
+const {
+ chatId,
+ modelList,
+ currentModelTitle,
+ previewCode,
+ questionContent,
+ chatRecord,
+ currentChatRecordKey,
+ currentModel,
+ isChat,
+ chatScrollRef,
+ scrollWrapperRef,
+ scrollable,
+ chatInfo,
+ previewTit
+} = store
+const route = useRoute()
+
+const previewStatus = ref('view')
+
+chatId.value = route.params.chatId as string
+
+/**
+ * @description Handle model select
+ */
+function changeModel(_: string, options: any) {
+ currentModel.value = options
+}
+
+/**
+ * @description Get html template code content
+ */
+getHtmlTemplateContent(store)
+
+/**
+ * @description Initial chatInfo and modelList
+ */
+initialTemplateInfo(store)
+
+/**
+ * @description Render page code
+ */
+function handleCodeRender(data: { code: string; key: string }) {
+ if (data.key == currentChatRecordKey.value) {
+ previewCode.value = removeSignCode(removeHtmlCodeBlockMarkers(data.code))
+ previewTit.value = getContentFromTitleTags(previewCode.value)
}
-
- /**
- * @description Regenerate
- */
- function handleRegenerate(key: string) {
- questionContent.value = key.split('_+_')[0]
- sendChat(store)
+}
+
+/**
+ * @description Regenerate
+ */
+function handleRegenerate(key: string) {
+ questionContent.value = key.split('_+_')[0]
+ sendChat(store)
+}
+
+/**
+ * @description Listen scroll wrapper for height-change
+ */
+function scrollWrapperHeightChange(timer?: any, index = 0) {
+ let timeoutTimer = timer || null
+ let startIndex = index
+ if (startIndex >= 6) {
+ return
}
-
- /**
- * @description Listen scroll wrapper for height-change
- */
- function scrollWrapperHeightChange(timer?: any, index = 0) {
- let timeoutTimer = timer || null
- let startIndex = index
- if (startIndex >= 6) {
- return
- }
- if (timeoutTimer) {
- clearTimeout(timer)
- timeoutTimer = null
- }
- if (scrollWrapperRef.value.offsetHeight) {
- chatScrollRef.value.scrollTo({ left: 0, top: scrollWrapperRef.value.offsetHeight })
- startIndex++
- return
- } else {
- startIndex++
- timeoutTimer = setTimeout(() => {
- scrollWrapperHeightChange(timeoutTimer, startIndex)
- }, 100)
- }
+ if (timeoutTimer) {
+ clearTimeout(timer)
+ timeoutTimer = null
}
- /**
- * @description If user scroll then stop n-scrollbar behavior
- */
- function handleScroll(event: WheelEvent) {
- if (event.deltaY < 0) {
- scrollable.value = false
- }
+ if (scrollWrapperRef.value.offsetHeight) {
+ chatScrollRef.value.scrollTo({ left: 0, top: scrollWrapperRef.value.offsetHeight })
+ startIndex++
+ return
+ } else {
+ startIndex++
+ timeoutTimer = setTimeout(() => {
+ scrollWrapperHeightChange(timeoutTimer, startIndex)
+ }, 100)
}
-
- /**
- * @description Go to send email
- */
- async function goToSendEmail() {
- await saveCodeChange(store)
- globalStore.temp_subject = previewTit.value
- router.push({
- path: "/market/task/edit",
- query: {
- chat_id: chatInfo.value.chatId
- }
- })
+}
+/**
+ * @description If user scroll then stop n-scrollbar behavior
+ */
+function handleScroll(event: WheelEvent) {
+ if (event.deltaY < 0) {
+ scrollable.value = false
}
-
- onMounted(() => {
- scrollWrapperHeightChange()
+}
+
+/**
+ * @description Go to send email
+ */
+async function goToSendEmail() {
+ await saveCodeChange(store)
+ globalStore.temp_subject = previewTit.value
+ router.push({
+ path: "/market/task/edit",
+ query: {
+ chat_id: chatInfo.value.chatId
+ }
})
+}
+
+onMounted(() => {
+ scrollWrapperHeightChange()
+})
</script>
<style scoped lang="scss">
- @use '@/styles/index' as base;
- @use '../../mixin.scss';
+@use '@/styles/index' as base;
+@use '../../mixin.scss';
- .wrapper {
- @mixin content-card {
- border-radius: 5px;
- padding: 20px;
- }
+.wrapper {
+ @mixin content-card {
+ border-radius: 5px;
+ padding: 20px;
+ }
- @include mixin.wrapper;
+ @include mixin.wrapper;
- .page-tit {
- @include mixin.page-tit;
- }
+ .page-tit {
+ @include mixin.page-tit;
+ }
- .ai-container {
+ .ai-container {
+ display: grid;
+ grid-template-columns: minmax(400px, 2fr) 5fr;
+ gap: 15px;
+
+ .chat-area {
display: grid;
- grid-template-columns: minmax(400px,2fr) 5fr;
+ grid-template-rows: 1fr 230px;
gap: 15px;
- .chat-area {
- display: grid;
- grid-template-rows: 1fr 230px;
- gap: 15px;
+ .answer {
+ width: 100%;
- .answer {
- width: 100%;
+ .answer-container {
+ padding: 30px 10px;
- .answer-container {
- padding: 30px 10px;
-
- .ask-content,
- .answer-content {
- @include content-card();
- background: var(--color-bg-3);
- display: grid;
- grid-template-rows: 30px 1fr;
- gap: 10px;
- margin-bottom: 20px;
-
- .pic {
- @include base.row-flex;
- align-items: center;
- }
+ .ask-content,
+ .answer-content {
+ @include content-card();
+ background: var(--color-bg-3);
+ display: grid;
+ grid-template-rows: 30px 1fr;
+ gap: 10px;
+ margin-bottom: 20px;
+
+ .pic {
+ @include base.row-flex;
+ align-items: center;
+ }
- @mixin item-tool {
- @include base.row-flex-start;
- cursor: pointer;
- gap: 5px;
- padding: 5px 10px;
- align-items: center;
- font-size: 12px;
- border-radius: 3px;
- transition: 0.1s all ease-in-out;
-
- &:hover {
- background: var(--color-primary-1);
- color: #fff;
- }
-
- &:active {
- background: var(--color-primary-3);
- }
+ @mixin item-tool {
+ @include base.row-flex-start;
+ cursor: pointer;
+ gap: 5px;
+ padding: 5px 10px;
+ align-items: center;
+ font-size: 12px;
+ border-radius: 3px;
+ transition: 0.1s all ease-in-out;
+
+ &:hover {
+ background: var(--color-primary-1);
+ color: #fff;
}
- .text {
- font-size: 14px;
+ &:active {
+ background: var(--color-primary-3);
}
+ }
- .answer-tool {
- @include base.row-flex-end;
- border-top: 1px solid var(--color-border-1);
- height: 30px;
- padding-top: 20px;
+ .text {
+ font-size: 14px;
+ }
- .tool-item {
- @include item-tool();
- }
+ .answer-tool {
+ @include base.row-flex-end;
+ border-top: 1px solid var(--color-border-1);
+ height: 30px;
+ padding-top: 20px;
+
+ .tool-item {
+ @include item-tool();
}
}
+ }
- .answer-content {
- background: var(--color-bg-2);
- }
+ .answer-content {
+ background: var(--color-bg-2);
}
}
+ }
- .question {
- position: relative;
+ .question {
+ position: relative;
- .question-input {
- height: 100%;
- font-size: 14px;
- }
+ .question-input {
+ height: 100%;
+ font-size: 14px;
+ }
- .question-tools {
- position: absolute;
- padding: 5px 30px;
- @include base.row-flex;
- gap: 100px;
- bottom: 22px;
- left: 0;
- width: 100%;
+ .question-tools {
+ position: absolute;
+ padding: 5px 30px;
+ @include base.row-flex;
+ gap: 100px;
+ bottom: 22px;
+ left: 0;
+ width: 100%;
- justify-content: space-between;
+ justify-content: space-between;
- .send-btn {
- @include base.row-flex-start;
- gap: 10px;
+ .send-btn {
+ @include base.row-flex-start;
+ gap: 10px;
- i {
- cursor: pointer;
- }
+ i {
+ cursor: pointer;
}
}
}
}
+ }
- /* .view-area {
+ /* .view-area {
background: linear-gradient(-45deg, rgba(238, 152, 82, 0.3),rgba(35, 166, 213,.3), rgba(231, 60, 60, 0.3), rgba(35, 213, 171,.3));
background-size: 400% 400%;
animation: gradient 15s ease infinite;
@@ -398,6 +400,6 @@
}
}
} */
- }
}
+}
</style>