From 3ac96f464df689f4242282dc371f234a779f0227 Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Fri, 23 May 2025 10:31:11 +0800 Subject: [PATCH] perf: show description in bot form --- pkg/platform/sources/officialaccount.yaml | 3 +++ web/src/app/home/bots/components/bot-form/BotForm.tsx | 1 + web/src/app/infra/entities/api/index.ts | 10 +--------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pkg/platform/sources/officialaccount.yaml b/pkg/platform/sources/officialaccount.yaml index 9cc7b003..1a93c0bc 100644 --- a/pkg/platform/sources/officialaccount.yaml +++ b/pkg/platform/sources/officialaccount.yaml @@ -57,6 +57,9 @@ spec: label: en_US: Host zh_Hans: 监听主机 + description: + en_US: The host that Official Account listens on for Webhook connections. + zh_Hans: 微信公众号监听的主机,除非你知道自己在做什么,否则请写 0.0.0.0 type: string required: true default: 0.0.0.0 diff --git a/web/src/app/home/bots/components/bot-form/BotForm.tsx b/web/src/app/home/bots/components/bot-form/BotForm.tsx index 384abb79..c2c79e41 100644 --- a/web/src/app/home/bots/components/bot-form/BotForm.tsx +++ b/web/src/app/home/bots/components/bot-form/BotForm.tsx @@ -202,6 +202,7 @@ export default function BotForm({ default: item.default, id: UUID.generate(), label: item.label, + description: item.description, name: item.name, required: item.required, type: parseDynamicFormItemType(item.type), diff --git a/web/src/app/infra/entities/api/index.ts b/web/src/app/infra/entities/api/index.ts index fa6eda5a..1efdd130 100644 --- a/web/src/app/infra/entities/api/index.ts +++ b/web/src/app/infra/entities/api/index.ts @@ -84,18 +84,10 @@ export interface Adapter { description: I18nLabel; icon?: string; spec: { - config: AdapterSpecConfig[]; + config: IDynamicFormItemSchema[]; }; } -export interface AdapterSpecConfig { - default: string | number | boolean | Array; - label: I18nLabel; - name: string; - required: boolean; - type: string; -} - export interface ApiRespPlatformBots { bots: Bot[]; }