From 136ecb17f3afe61e862f767cd782d4b2fea0f4f0 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Tue, 12 Aug 2025 17:51:31 +0800 Subject: [PATCH] refactor(ui): clean code --- .../access/AccessFormEmailConfig.tsx | 1 - .../access/AccessFormWebhookConfig.tsx | 66 ++++---- .../certificate/CertificateDetail.tsx | 10 +- .../designer/forms/BizApplyNodeConfigForm.tsx | 141 ++++++++---------- .../forms/BizDeployNodeConfigForm.tsx | 62 ++++---- .../BizDeployNodeConfigFormProviderLocal.tsx | 116 +++++++------- .../BizDeployNodeConfigFormProviderSSH.tsx | 136 ++++++++--------- ...BizDeployNodeConfigFormProviderWebhook.tsx | 4 +- .../forms/BizNotifyNodeConfigForm.tsx | 49 +++--- ...BizNotifyNodeConfigFormProviderWebhook.tsx | 4 +- 10 files changed, 253 insertions(+), 336 deletions(-) diff --git a/ui/src/components/access/AccessFormEmailConfig.tsx b/ui/src/components/access/AccessFormEmailConfig.tsx index 629748dc..95148f79 100644 --- a/ui/src/components/access/AccessFormEmailConfig.tsx +++ b/ui/src/components/access/AccessFormEmailConfig.tsx @@ -1,5 +1,4 @@ import { useTranslation } from "react-i18next"; -import { QuestionCircleOutlined as IconQuestionCircleOutlined } from "@ant-design/icons"; import { Form, type FormInstance, Input, InputNumber, Switch } from "antd"; import { createSchemaFieldRule } from "antd-zod"; import { z } from "zod"; diff --git a/ui/src/components/access/AccessFormWebhookConfig.tsx b/ui/src/components/access/AccessFormWebhookConfig.tsx index d3d5dc4d..7661d95b 100644 --- a/ui/src/components/access/AccessFormWebhookConfig.tsx +++ b/ui/src/components/access/AccessFormWebhookConfig.tsx @@ -305,20 +305,13 @@ const AccessFormWebhookConfig = ({ form: formInst, formName, disabled, initialVa - - - + +
+ +
+ - - - + +
+ ({ + key, + label: , + onClick: () => handlePresetDataForNotificationClick(key), + })), + }} + trigger={["click"]} + > + + +
+ { - -
- + +
{ - -
- + +
- - - + } + > +
+ + {t("workflow_node.apply.form.provider_access.button")} + + + } + usage="dns" + afterSubmit={(record) => { + const provider = accessProvidersMap.get(record.provider); + if (provider?.usages?.includes(ACCESS_USAGES.DNS)) { + formInst.setFieldValue("providerAccessId", record.id); + handleProviderAccessSelect(record.id); + } + }} + /> +
+ - - - + +
+ + + + + +
+ -