diff --git a/ui/web/src/i18n/locales/en/channels.json b/ui/web/src/i18n/locales/en/channels.json index eff1642f..b91e7d6b 100644 --- a/ui/web/src/i18n/locales/en/channels.json +++ b/ui/web/src/i18n/locales/en/channels.json @@ -107,7 +107,9 @@ "noSchema": "No configuration schema for this channel type.", "saved": "Saved", "saveConfig": "Save Config", - "saving": "Saving..." + "saving": "Saving...", + "webhookUrlLabel": "Set this as your Lark app's Event Request URL:", + "copyPath": "Copy path" }, "groups": { "saved": "Saved", diff --git a/ui/web/src/i18n/locales/vi/channels.json b/ui/web/src/i18n/locales/vi/channels.json index df09ddfa..4b7d125b 100644 --- a/ui/web/src/i18n/locales/vi/channels.json +++ b/ui/web/src/i18n/locales/vi/channels.json @@ -107,7 +107,9 @@ "noSchema": "Không có lược đồ cấu hình cho loại channel này.", "saved": "Đã lưu", "saveConfig": "Lưu cấu hình", - "saving": "Đang lưu..." + "saving": "Đang lưu...", + "webhookUrlLabel": "Đặt URL này làm Event Request URL cho ứng dụng Lark:", + "copyPath": "Sao chép đường dẫn" }, "groups": { "saved": "Đã lưu", diff --git a/ui/web/src/i18n/locales/zh/channels.json b/ui/web/src/i18n/locales/zh/channels.json index b68f41e0..75560dd9 100644 --- a/ui/web/src/i18n/locales/zh/channels.json +++ b/ui/web/src/i18n/locales/zh/channels.json @@ -107,7 +107,9 @@ "noSchema": "此Channel类型没有配置模式。", "saved": "已保存", "saveConfig": "保存配置", - "saving": "保存中..." + "saving": "保存中...", + "webhookUrlLabel": "将此URL设置为Lark应用的事件请求URL:", + "copyPath": "复制路径" }, "groups": { "saved": "已保存", diff --git a/ui/web/src/pages/channels/channel-detail/channel-config-tab.tsx b/ui/web/src/pages/channels/channel-detail/channel-config-tab.tsx index db3484a4..0d698984 100644 --- a/ui/web/src/pages/channels/channel-detail/channel-config-tab.tsx +++ b/ui/web/src/pages/channels/channel-detail/channel-config-tab.tsx @@ -1,6 +1,6 @@ import { useState, useCallback } from "react"; import { useTranslation } from "react-i18next"; -import { Save, Check, AlertCircle } from "lucide-react"; +import { Save, Check, AlertCircle, Info, Copy } from "lucide-react"; import { Button } from "@/components/ui/button"; import type { ChannelInstanceData } from "@/types/channel"; import { configSchema } from "../channel-schemas"; @@ -62,6 +62,20 @@ export function ChannelConfigTab({ instance, onUpdate }: ChannelConfigTabProps) ); } + // Show webhook URL hint for Feishu/Lark in webhook mode + const isFeishu = instance.channel_type === "feishu"; + const connectionMode = (values.connection_mode as string) ?? "webhook"; + const showWebhookUrl = isFeishu && connectionMode === "webhook"; + const webhookPath = (values.webhook_path as string) || "/feishu/events"; + const webhookUrl = `https://${webhookPath}`; + + const [copied, setCopied] = useState(false); + const handleCopy = useCallback(() => { + navigator.clipboard.writeText(webhookPath); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }, [webhookPath]); + return (
+ {showWebhookUrl && ( +
+ +
+

{t("detail.config.webhookUrlLabel")}

+
+ + {webhookUrl} + + +
+
+
+ )} + {saveError && (