feat(im): add DingTalk platform integration
Add DingTalk bot adapter supporting both webhook (HmacSHA256 signature verification) and Stream mode (via official dingtalk-stream-sdk-go), with sessionWebhook/OpenAPI reply fallback and AccessToken caching.
This commit is contained in:
@@ -182,7 +182,7 @@ export interface IMChannel {
|
||||
id: string;
|
||||
tenant_id?: number;
|
||||
agent_id: string;
|
||||
platform: 'wecom' | 'feishu' | 'slack' | 'telegram';
|
||||
platform: 'wecom' | 'feishu' | 'slack' | 'telegram' | 'dingtalk';
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
mode: 'webhook' | 'websocket';
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
<t-radio-button value="feishu">{{ $t('agentEditor.im.feishu') }}</t-radio-button>
|
||||
<t-radio-button value="slack">{{ $t('agentEditor.im.slack') }}</t-radio-button>
|
||||
<t-radio-button value="telegram">{{ $t('agentEditor.im.telegram') }}</t-radio-button>
|
||||
<t-radio-button value="dingtalk">{{ $t('agentEditor.im.dingtalk') }}</t-radio-button>
|
||||
</t-radio-group>
|
||||
</div>
|
||||
|
||||
@@ -259,6 +260,24 @@
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<!-- DingTalk credentials -->
|
||||
<template v-if="formData.platform === 'dingtalk'">
|
||||
<div class="platform-link-hint">
|
||||
<t-icon name="jump" class="hint-link-icon" />
|
||||
<a href="https://open.dingtalk.com/" target="_blank" rel="noopener noreferrer" class="hint-link">
|
||||
{{ $t('agentEditor.im.dingtalkConsole') }}
|
||||
</a>
|
||||
<span class="hint-text">{{ $t('agentEditor.im.consoleTip') }}</span>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<label class="form-label">Client ID (AppKey)</label>
|
||||
<t-input v-model="formData.credentials.client_id" placeholder="Client ID / AppKey" />
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<label class="form-label">Client Secret (AppSecret)</label>
|
||||
<t-input v-model="formData.credentials.client_secret" type="password" placeholder="Client Secret / AppSecret" />
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</t-dialog>
|
||||
</div>
|
||||
@@ -289,7 +308,7 @@ const knowledgeBases = ref<{ id: string; name: string }[]>([]);
|
||||
const defaultCredentials = (): Record<string, any> => ({});
|
||||
|
||||
const formData = ref({
|
||||
platform: 'wecom' as 'wecom' | 'feishu' | 'slack' | 'telegram',
|
||||
platform: 'wecom' as 'wecom' | 'feishu' | 'slack' | 'telegram' | 'dingtalk',
|
||||
name: '',
|
||||
mode: 'websocket' as 'webhook' | 'websocket',
|
||||
output_mode: 'stream' as 'stream' | 'full',
|
||||
@@ -544,6 +563,10 @@ onMounted(() => {
|
||||
color: #26a6db;
|
||||
}
|
||||
|
||||
&.dingtalk {
|
||||
background: rgba(23, 126, 251, 0.08);
|
||||
color: #177efb;
|
||||
}
|
||||
}
|
||||
|
||||
.channel-name {
|
||||
|
||||
@@ -3182,11 +3182,12 @@ export default {
|
||||
},
|
||||
im: {
|
||||
title: 'IM Integration',
|
||||
description: 'Connect agent to instant messaging platforms like WeCom, Feishu, Slack and Telegram',
|
||||
description: 'Connect agent to instant messaging platforms like WeCom, Feishu, Slack, Telegram and DingTalk',
|
||||
wecom: 'WeCom',
|
||||
feishu: 'Feishu',
|
||||
slack: 'Slack',
|
||||
telegram: 'Telegram',
|
||||
dingtalk: 'DingTalk',
|
||||
addChannel: 'Add Channel',
|
||||
editChannel: 'Edit Channel',
|
||||
deleteConfirm: 'Are you sure you want to delete this channel? This action cannot be undone.',
|
||||
@@ -3205,6 +3206,7 @@ export default {
|
||||
feishuConsole: 'Feishu Open Platform',
|
||||
slackConsole: 'Slack API Console',
|
||||
telegramConsole: 'Telegram BotFather',
|
||||
dingtalkConsole: 'DingTalk Open Platform',
|
||||
modeHint: 'WebSocket is recommended for easier setup',
|
||||
consoleTip: 'to get credentials',
|
||||
fileKnowledgeBase: 'File Storage Knowledge Base',
|
||||
|
||||
@@ -3212,11 +3212,12 @@ export default {
|
||||
},
|
||||
im: {
|
||||
title: "IM 통합",
|
||||
description: "에이전트를 WeCom, Feishu, Slack, Telegram 등 인스턴트 메시징 플랫폼에 연결",
|
||||
description: "에이전트를 WeCom, Feishu, Slack, Telegram, DingTalk 등 인스턴트 메시징 플랫폼에 연결",
|
||||
wecom: "WeCom",
|
||||
feishu: "Feishu",
|
||||
slack: "Slack",
|
||||
telegram: "Telegram",
|
||||
dingtalk: "DingTalk",
|
||||
addChannel: "채널 추가",
|
||||
editChannel: "채널 편집",
|
||||
deleteConfirm: "이 채널을 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.",
|
||||
@@ -3235,6 +3236,7 @@ export default {
|
||||
feishuConsole: "Feishu 개발 플랫폼",
|
||||
slackConsole: "Slack API 콘솔",
|
||||
telegramConsole: "Telegram BotFather",
|
||||
dingtalkConsole: "DingTalk 개발 플랫폼",
|
||||
modeHint: "WebSocket 방식이 설정이 더 간편하여 권장됩니다",
|
||||
consoleTip: "자격 증명 정보를 가져오세요",
|
||||
fileKnowledgeBase: "파일 저장 지식 베이스",
|
||||
|
||||
@@ -2845,11 +2845,12 @@ export default {
|
||||
},
|
||||
im: {
|
||||
title: 'Интеграция IM',
|
||||
description: 'Подключите агента к платформам мгновенных сообщений, таким как WeCom, Feishu, Slack и Telegram',
|
||||
description: 'Подключите агента к платформам мгновенных сообщений, таким как WeCom, Feishu, Slack, Telegram и DingTalk',
|
||||
wecom: 'WeCom',
|
||||
feishu: 'Feishu',
|
||||
slack: 'Slack',
|
||||
telegram: 'Telegram',
|
||||
dingtalk: 'DingTalk',
|
||||
addChannel: 'Добавить канал',
|
||||
editChannel: 'Редактировать канал',
|
||||
deleteConfirm: 'Вы уверены, что хотите удалить этот канал? Это действие не может быть отменено.',
|
||||
@@ -2868,6 +2869,7 @@ export default {
|
||||
feishuConsole: 'Платформа Feishu',
|
||||
slackConsole: 'Консоль Slack API',
|
||||
telegramConsole: 'Telegram BotFather',
|
||||
dingtalkConsole: 'Платформа DingTalk',
|
||||
modeHint: 'Рекомендуется WebSocket — проще настроить',
|
||||
consoleTip: 'для получения учётных данных',
|
||||
fileKnowledgeBase: 'База знаний для файлов',
|
||||
|
||||
@@ -3157,11 +3157,12 @@ export default {
|
||||
},
|
||||
im: {
|
||||
title: "IM 集成",
|
||||
description: "将智能体接入即时通讯平台,支持企业微信、飞书、Slack和Telegram",
|
||||
description: "将智能体接入即时通讯平台,支持企业微信、飞书、Slack、Telegram和钉钉",
|
||||
wecom: "企业微信",
|
||||
feishu: "飞书",
|
||||
slack: "Slack",
|
||||
telegram: "Telegram",
|
||||
dingtalk: "钉钉",
|
||||
addChannel: "添加渠道",
|
||||
editChannel: "编辑渠道",
|
||||
deleteConfirm: "确定删除该渠道?删除后无法恢复。",
|
||||
@@ -3180,6 +3181,7 @@ export default {
|
||||
feishuConsole: "飞书开放平台",
|
||||
slackConsole: "Slack API 控制台",
|
||||
telegramConsole: "Telegram BotFather",
|
||||
dingtalkConsole: "钉钉开放平台",
|
||||
modeHint: "推荐使用 WebSocket 方式接入,配置更简单",
|
||||
consoleTip: "前往获取凭证信息",
|
||||
fileKnowledgeBase: "文件保存知识库",
|
||||
|
||||
Reference in New Issue
Block a user