mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-12 17:40:54 +08:00
【新增】百度云DNS解析功能和宝塔waf部署功能
【新增】本机部署方式 【修复】已知问题
This commit is contained in:
@@ -281,7 +281,11 @@ export const useApiFormController = (props: { data: AccessItem }) => {
|
||||
trigger: 'input',
|
||||
validator: (rule: FormItemRule, value: string, callback: (error?: Error) => void) => {
|
||||
if (!isUrl(value)) {
|
||||
return callback(new Error($t('t_2_1745317314362')))
|
||||
const mapTips = {
|
||||
btpanel: $t('t_2_1745317314362'),
|
||||
btwaf: $t('t_0_1747271295174'),
|
||||
}
|
||||
return callback(new Error(mapTips[param.value.type as keyof typeof mapTips]))
|
||||
}
|
||||
callback()
|
||||
},
|
||||
@@ -290,11 +294,12 @@ export const useApiFormController = (props: { data: AccessItem }) => {
|
||||
trigger: 'input',
|
||||
validator: (rule: FormItemRule, value: string, callback: (error?: Error) => void) => {
|
||||
if (!value.length) {
|
||||
if (param.value.type === 'cloudflare') {
|
||||
return callback(new Error($t('t_0_1747042966820')))
|
||||
} else if (param.value.type === 'btpanel') {
|
||||
return callback(new Error($t('t_1_1747042969705')))
|
||||
const mapTips = {
|
||||
cloudflare: $t('t_0_1747042966820'),
|
||||
btpanel: $t('t_1_1747042969705'),
|
||||
btwaf: $t('t_1_1747271295484'),
|
||||
}
|
||||
return callback(new Error(mapTips[param.value.type as keyof typeof mapTips]))
|
||||
}
|
||||
callback()
|
||||
},
|
||||
@@ -314,23 +319,35 @@ export const useApiFormController = (props: { data: AccessItem }) => {
|
||||
message: $t('t_6_1745317313383'),
|
||||
trigger: 'input',
|
||||
},
|
||||
secret_key: {
|
||||
trigger: 'input',
|
||||
validator: (rule: FormItemRule, value: string, callback: (error?: Error) => void) => {
|
||||
if (!value.length) {
|
||||
if (param.value.type === 'tencentcloud') {
|
||||
return callback(new Error($t('t_2_1747042967277')))
|
||||
} else if (param.value.type === 'huaweicloud') {
|
||||
return callback(new Error($t('t_3_1747042967608')))
|
||||
}
|
||||
}
|
||||
callback()
|
||||
},
|
||||
},
|
||||
|
||||
access_key: {
|
||||
required: true,
|
||||
message: $t('t_4_1747042966254'),
|
||||
trigger: 'input',
|
||||
validator: (rule: FormItemRule, value: string, callback: (error?: Error) => void) => {
|
||||
if (!value.length) {
|
||||
const mapTips = {
|
||||
huawei: $t('t_2_1747271295877'),
|
||||
baidu: $t('t_3_1747271294475'),
|
||||
}
|
||||
return callback(new Error(mapTips[param.value.type as keyof typeof mapTips]))
|
||||
}
|
||||
callback()
|
||||
},
|
||||
},
|
||||
secret_key: {
|
||||
trigger: 'input',
|
||||
validator: (rule: FormItemRule, value: string, callback: (error?: Error) => void) => {
|
||||
if (!value.length) {
|
||||
const mapTips = {
|
||||
tencentcloud: $t('t_2_1747042967277'),
|
||||
huawei: $t('t_3_1747042967608'),
|
||||
baidu: $t('t_4_1747271294621'),
|
||||
}
|
||||
return callback(new Error(mapTips[param.value.type as keyof typeof mapTips]))
|
||||
}
|
||||
callback()
|
||||
},
|
||||
},
|
||||
email: {
|
||||
trigger: 'input',
|
||||
@@ -407,8 +424,9 @@ export const useApiFormController = (props: { data: AccessItem }) => {
|
||||
break
|
||||
case '1panel':
|
||||
case 'btpanel':
|
||||
case 'btwaf':
|
||||
items.push(
|
||||
useFormInput($t('t_2_1746667592840'), 'config.url'),
|
||||
useFormInput(param.value.type === 'btwaf' ? $t('t_5_1747271291828') : $t('t_2_1746667592840'), 'config.url'),
|
||||
useFormInput($t('t_55_1745289355715'), 'config.api_key'),
|
||||
useFormSwitch(
|
||||
$t('t_3_1746667592270'),
|
||||
@@ -417,9 +435,7 @@ export const useApiFormController = (props: { data: AccessItem }) => {
|
||||
checkedValue: '1',
|
||||
uncheckedValue: '0',
|
||||
},
|
||||
{
|
||||
showRequireMark: false,
|
||||
},
|
||||
{ showRequireMark: false },
|
||||
),
|
||||
)
|
||||
break
|
||||
@@ -434,6 +450,7 @@ export const useApiFormController = (props: { data: AccessItem }) => {
|
||||
items.push(useFormInput('SecretId', 'config.secret_id'), useFormInput('SecretKey', 'config.secret_key'))
|
||||
break
|
||||
case 'huaweicloud':
|
||||
case 'baidu':
|
||||
items.push(useFormInput('AccessKey', 'config.access_key'), useFormInput('SecretKey', 'config.secret_key'))
|
||||
break
|
||||
case 'cloudflare':
|
||||
@@ -461,6 +478,7 @@ export const useApiFormController = (props: { data: AccessItem }) => {
|
||||
break
|
||||
case '1panel':
|
||||
case 'btpanel':
|
||||
case 'btwaf':
|
||||
param.value.config = {
|
||||
url: '',
|
||||
api_key: '',
|
||||
@@ -473,6 +491,19 @@ export const useApiFormController = (props: { data: AccessItem }) => {
|
||||
access_key_secret: '',
|
||||
}
|
||||
break
|
||||
case 'baidu':
|
||||
case 'huaweicloud':
|
||||
param.value.config = {
|
||||
access_key: '',
|
||||
secret_key: '',
|
||||
}
|
||||
break
|
||||
case 'cloudflare':
|
||||
param.value.config = {
|
||||
email: '',
|
||||
api_key: '',
|
||||
}
|
||||
break
|
||||
case 'tencentcloud':
|
||||
param.value.config = {
|
||||
secret_id: '',
|
||||
|
||||
@@ -24,7 +24,7 @@ export default defineComponent({
|
||||
<BaseComponent
|
||||
v-slots={{
|
||||
header: () => (
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center justify-between mb-[1.6rem]">
|
||||
<NButton type="primary" onClick={() => fetch()}>
|
||||
{$t('t_9_1746667589516')}
|
||||
</NButton>
|
||||
|
||||
@@ -214,7 +214,7 @@ export const useController = () => {
|
||||
*/
|
||||
const handleViewHistory = async (workflow: WorkflowItem) => {
|
||||
useModal({
|
||||
title: workflow ? `${workflow.name} - ${$t('t_9_1745215914666')}` : $t('t_9_1745215914666'),
|
||||
title: workflow ? `【${workflow.name}】 - ${$t('t_9_1745215914666')}` : $t('t_9_1745215914666'),
|
||||
component: HistoryModal,
|
||||
area: 800,
|
||||
componentProps: { id: workflow.id },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NInput, NButton } from 'naive-ui'
|
||||
import { useThemeCssVar } from '@baota/naive-ui/theme'
|
||||
import { useTheme, useThemeCssVar } from '@baota/naive-ui/theme'
|
||||
import { PlusOutlined } from '@vicons/antd'
|
||||
import { Search } from '@vicons/carbon'
|
||||
import { $t } from '@locales/index'
|
||||
@@ -18,7 +18,8 @@ export default defineComponent({
|
||||
const cssVar = useThemeCssVar(['contentPadding', 'borderColor', 'headerHeight', 'iconColorHover'])
|
||||
// 挂载时请求数据
|
||||
onMounted(() => fetch())
|
||||
|
||||
const { theme, themeOverrides } = useTheme()
|
||||
console.log(theme.value, themeOverrides.value)
|
||||
return () => (
|
||||
<div class="h-full flex flex-col" style={cssVar.value}>
|
||||
<div class="mx-auto max-w-[1600px] w-full p-6">
|
||||
|
||||
@@ -6,9 +6,9 @@ import { $t } from '@locales/index'
|
||||
import { useThemeCssVar } from '@baota/naive-ui/theme'
|
||||
import { MenuFoldOutlined, MenuUnfoldOutlined } from '@vicons/antd'
|
||||
import { useController } from './useController'
|
||||
|
||||
import styles from './index.module.css'
|
||||
|
||||
// import ThemeTips from '@baota/naive-ui/components/themeTips'
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
// 获取控制器中的状态和方法
|
||||
@@ -65,6 +65,7 @@ export default defineComponent({
|
||||
<NLayout>
|
||||
<NLayoutHeader class={styles.header}>
|
||||
<div class={styles.systemInfo}>
|
||||
{/* <ThemeTips size="small" /> */}
|
||||
<NBadge value={1} show={false} dot>
|
||||
<span class="px-[.5rem] cursor-pointer">v1.0.1</span>
|
||||
</NBadge>
|
||||
|
||||
@@ -56,11 +56,13 @@ export const useLayoutStore = defineStore('layout-store', () => {
|
||||
// 主机提供商
|
||||
ssh: { name: 'SSH', access: ['host'] },
|
||||
btpanel: { name: $t('t_10_1745735765165'), access: ['host'] },
|
||||
btwaf: { name: '宝塔WAF', access: ['host'] },
|
||||
'1panel': { name: '1Panel', access: ['host'] },
|
||||
aliyun: { name: $t('t_2_1747019616224'), access: ['dns', 'host'] },
|
||||
tencentcloud: { name: $t('t_3_1747019616129'), access: ['dns', 'host'] },
|
||||
huaweicloud: { name: '华为云', access: ['dns'] },
|
||||
cloudflare: { name: 'Cloudflare', access: ['dns'] },
|
||||
baidu: { name: '百度云', access: ['dns'] },
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -163,7 +165,19 @@ export const useLayoutStore = defineStore('layout-store', () => {
|
||||
* @returns DNS提供商
|
||||
*/
|
||||
const fetchDnsProvider = async (
|
||||
type: 'btpanel' | 'aliyun' | 'ssh' | 'tencentcloud' | '1panel' | 'dns' | '' = '',
|
||||
type:
|
||||
| 'btpanel'
|
||||
| 'aliyun'
|
||||
| 'ssh'
|
||||
| 'tencentcloud'
|
||||
| '1panel'
|
||||
| 'dns'
|
||||
| 'baidu'
|
||||
| 'huaweicloud'
|
||||
| 'cloudflare'
|
||||
| 'baidu'
|
||||
| ''
|
||||
| 'btwaf' = '',
|
||||
): Promise<void> => {
|
||||
try {
|
||||
dnsProvider.value = []
|
||||
|
||||
@@ -5,8 +5,8 @@ import { $t } from '@locales/index'
|
||||
import { useController } from './useController'
|
||||
import styles from './index.module.css'
|
||||
|
||||
import LocalesTips from '@baota/naive-ui/components/localesTips'
|
||||
import ThemeTips from '@baota/naive-ui/components/themeTips'
|
||||
// import LocalesTips from '@baota/naive-ui/components/localesTips'
|
||||
// import ThemeTips from '@baota/naive-ui/components/themeTips'
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
@@ -27,8 +27,8 @@ export default defineComponent({
|
||||
style={`background-image:${isDark.value ? 'url(/static/images/login-bg-dark.svg)' : 'url(/static/images/login-bg.svg)'};`}
|
||||
>
|
||||
<div class="absolute z-[99] top-0 right-0 p-[2rem] flex w-[120px] justify-between">
|
||||
<LocalesTips />
|
||||
<ThemeTips />
|
||||
{/* <LocalesTips /> */}
|
||||
{/* <ThemeTips /> */}
|
||||
</div>
|
||||
<div class={styles.loginBox}>
|
||||
<div class={styles.leftSection}>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NGrid, NFormItemGi, NInput, NSwitch } from 'naive-ui'
|
||||
import { NGrid, NFormItemGi, NInput, NSwitch, NTooltip } from 'naive-ui'
|
||||
import { useForm, useModalHooks } from '@baota/naive-ui/hooks'
|
||||
import { useError } from '@baota/hooks/error'
|
||||
import { $t } from '@locales/index'
|
||||
@@ -72,14 +72,38 @@ export default defineComponent({
|
||||
'smtp-template': (formData: Ref<ReportMail>) => {
|
||||
return (
|
||||
<NGrid cols="24" xGap="24">
|
||||
<NFormItemGi span="12" label={$t('t_14_1745833932440')} path="smtpHost">
|
||||
<NFormItemGi span="14" label={$t('t_14_1745833932440')} path="smtpHost">
|
||||
<NInput v-model:value={formData.value.smtpHost} placeholder={$t('t_15_1745833940280')} />
|
||||
</NFormItemGi>
|
||||
<NFormItemGi span="7" label={$t('t_16_1745833933819')} path="smtpPort">
|
||||
<NInput v-model:value={formData.value.smtpPort} placeholder={$t('t_17_1745833935070')} />
|
||||
</NFormItemGi>
|
||||
<NFormItemGi span="5" label={$t('t_18_1745833933989')} path="smtpTLS">
|
||||
<NSwitch v-model:value={formData.value.smtpTLS} checkedValue="true" uncheckedValue="false" />
|
||||
<NSwitch
|
||||
v-model:value={formData.value.smtpTLS}
|
||||
checkedValue="true"
|
||||
uncheckedValue="false"
|
||||
onUpdateValue={(val) => {
|
||||
formData.value.smtpPort = val === 'true' ? '465' : '25'
|
||||
}}
|
||||
/>
|
||||
</NFormItemGi>
|
||||
<NFormItemGi span="5" label={$t('t_16_1745833933819')} path="smtpPort">
|
||||
<NTooltip
|
||||
trigger="hover"
|
||||
placement="top"
|
||||
v-slots={{
|
||||
trigger: () => {
|
||||
return (
|
||||
<NInput
|
||||
v-model:value={formData.value.smtpPort}
|
||||
readonly
|
||||
class="!cursor-not-allowed"
|
||||
placeholder={$t('t_17_1745833935070')}
|
||||
/>
|
||||
)
|
||||
},
|
||||
}}
|
||||
>
|
||||
{$t('SMTP端口禁止修改')}
|
||||
</NTooltip>
|
||||
</NFormItemGi>
|
||||
</NGrid>
|
||||
)
|
||||
|
||||
@@ -73,7 +73,7 @@ export const useSettingsStore = defineStore('settings-store', () => {
|
||||
sender: '', // 发送邮箱
|
||||
smtpHost: '', // SMTP服务器
|
||||
smtpPort: '465', //SMTP端口
|
||||
smtpTLS: 'false', // TLS协议,加密
|
||||
smtpTLS: false, // TLS协议,加密
|
||||
password: '',
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user