【优化】重绘各类厂商和资源来源图标

【新增】CA类型SSL.COM
【新增】消息通知渠道-webhook
【新增】消息通知渠道-飞书
【新增】消息通知渠道-钉钉
【新增】huaweicloud-cdn部署类型
【修改】版本号
This commit is contained in:
chudong
2025-05-29 14:29:11 +08:00
parent c7e8dee436
commit 29e5cc8304
170 changed files with 12084 additions and 13703 deletions

View File

@@ -0,0 +1,71 @@
import { useForm, useModalHooks } from '@baota/naive-ui/hooks'
import { useError } from '@baota/hooks/error'
import { useWebhookChannelFormController } from './useController'
import { useStore } from '@settings/useStore'
import type { ReportWebhook, ReportType } from '@/types/setting'
/**
* Webhook通知渠道表单组件
*/
export default defineComponent({
name: 'WebhookChannelModel',
props: {
data: {
type: Object as PropType<ReportType<ReportWebhook> | null>,
default: () => null,
},
},
setup(props: { data: ReportType<ReportWebhook> | null }) {
const { handleError } = useError()
const { confirm } = useModalHooks()
const { fetchNotifyChannels } = useStore()
const { config, rules, webhookChannelForm, submitForm } = useWebhookChannelFormController()
if (props.data) {
const { name, config } = props.data
webhookChannelForm.value = {
name,
...config,
}
}
// 使用表单hooks
const {
component: WebhookForm,
example,
data,
} = useForm({
config,
defaultValue: webhookChannelForm,
rules,
})
// 关联确认按钮
confirm(async (close) => {
try {
const { name, ...other } = data.value
await example.value?.validate()
const res = await submitForm(
{
type: 'webhook',
name: name || '',
config: other,
},
example,
props.data?.id,
)
fetchNotifyChannels()
if (res) close()
} catch (error) {
handleError(error)
}
})
return () => (
<div class="webhook-channel-form">
<WebhookForm labelPlacement="top"></WebhookForm>
</div>
)
},
})