diff --git a/src/assets/images/logos/feishu.png b/src/assets/images/logos/feishu.png new file mode 100644 index 00000000..36278db2 Binary files /dev/null and b/src/assets/images/logos/feishu.png differ diff --git a/src/components/cards/NotificationChannelCard.vue b/src/components/cards/NotificationChannelCard.vue index bfccab17..1728a5ce 100644 --- a/src/components/cards/NotificationChannelCard.vue +++ b/src/components/cards/NotificationChannelCard.vue @@ -47,6 +47,7 @@ const notificationInfo = ref({ // 各通知类型的名称字典 const notificationTypeNames: { [key: string]: string } = { wechat: t('notification.wechat.name'), + feishu: t('notification.feishu.name'), wechatclawbot: t('notification.wechatclawbot.name'), telegram: t('notification.telegram.name'), qqbot: t('notification.qqbot.name'), @@ -417,6 +418,8 @@ const getIcon = computed(() => { return getLogoUrl('wechat') case 'wechatclawbot': return getLogoUrl('wechatclawbot') + case 'feishu': + return getLogoUrl('feishu') case 'telegram': return getLogoUrl('telegram') case 'qqbot': @@ -777,6 +780,84 @@ watch(notificationInfoDialog, value => { + + + + + + + + + + + + + + + + + + + + + + + + + + = { wechat: '企业微信', + feishu: '飞书', wechatclawbot: '微信 ClawBot', telegram: 'Telegram', slack: 'Slack', @@ -679,6 +681,16 @@ export function useSetupWizard() { break case 'wechatclawbot': break + case 'feishu': + if (!config.FEISHU_APP_ID?.trim()) { + errors.push(t('notification.feishu.appIdRequired')) + validationErrors.value.notification.FEISHU_APP_ID = true + } + if (!config.FEISHU_APP_SECRET?.trim()) { + errors.push(t('notification.feishu.appSecretRequired')) + validationErrors.value.notification.FEISHU_APP_SECRET = true + } + break case 'telegram': if (!config.TELEGRAM_TOKEN?.trim()) { errors.push(t('notification.telegram.tokenRequired')) diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index f365999a..d61fbd29 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -505,6 +505,28 @@ export default { logoutSuccess: 'WeChat ClawBot logged out', logoutFailed: 'Failed to logout WeChat ClawBot', }, + feishu: { + name: 'Feishu', + appId: 'App ID', + appIdHint: 'App ID of the Feishu Open Platform application', + appIdRequired: 'App ID cannot be empty', + appSecret: 'App Secret', + appSecretHint: 'App Secret of the Feishu Open Platform application', + appSecretRequired: 'App Secret cannot be empty', + openId: 'Default User Open ID', + openIdHint: 'Default recipient user Open ID; leave empty to prefer recent interacted users', + openIdPlaceholder: 'ou_xxx', + chatId: 'Default Group Chat ID', + chatIdHint: 'Default recipient group chat ID; either this or Open ID is enough', + chatIdPlaceholder: 'oc_xxx', + admins: 'Admin Whitelist', + adminsHint: 'Open IDs allowed to run commands and admin actions, separated by commas', + adminsPlaceholder: 'Open ID list, separated by commas', + verificationToken: 'Verification Token', + verificationTokenHint: 'Verification Token for Feishu event subscription, required when validation is enabled', + encryptKey: 'Encrypt Key', + encryptKeyHint: 'Encrypt Key for Feishu event subscription, required when encryption is enabled', + }, telegram: { name: 'Telegram', token: 'Bot Token', @@ -1769,6 +1791,7 @@ export default { channel: 'Notification', wechat: 'WeChat Work', wechatClawBot: 'WeChat ClawBot', + feishu: 'Feishu', resourceDownload: 'Resource Download', mediaImport: 'Media Import', subscription: 'Subscription', @@ -2851,6 +2874,7 @@ export default { accountBinding: 'Account Binding', wechatUser: 'WeChat Work User', wechatClawBotUser: 'WeChat ClawBot User', + feishuUser: 'Feishu User', telegramUser: 'Telegram User', slackUser: 'Slack User', discordUser: 'Discord User', @@ -3441,6 +3465,7 @@ export default { typeHint: 'Select the type of notification channel to use', name: 'Notification Name', nameHint: 'Set a name for the notification channel', + feishuConfig: 'Feishu Configuration', telegramConfig: 'Telegram Configuration', emailConfig: 'Email Configuration', botToken: 'Bot Token', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 72b15264..1617c8db 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -500,6 +500,28 @@ export default { logoutSuccess: '微信 ClawBot 已退出登录', logoutFailed: '微信 ClawBot 退出登录失败', }, + feishu: { + name: '飞书', + appId: 'App ID', + appIdHint: '飞书开放平台应用的 App ID', + appIdRequired: 'App ID 不能为空', + appSecret: 'App Secret', + appSecretHint: '飞书开放平台应用的 App Secret', + appSecretRequired: 'App Secret 不能为空', + openId: '默认用户 Open ID', + openIdHint: '默认通知接收用户的 Open ID,留空则优先使用互动用户', + openIdPlaceholder: 'ou_xxx', + chatId: '默认群聊 Chat ID', + chatIdHint: '默认通知接收群聊的 Chat ID,和 Open ID 二选一即可', + chatIdPlaceholder: 'oc_xxx', + admins: '管理员白名单', + adminsHint: '允许执行命令和管理操作的 Open ID 列表,多个使用 , 分隔', + adminsPlaceholder: 'Open ID 列表,多个使用 , 分隔', + verificationToken: 'Verification Token', + verificationTokenHint: '飞书事件订阅的 Verification Token,启用事件校验时填写', + encryptKey: 'Encrypt Key', + encryptKeyHint: '飞书事件订阅的 Encrypt Key,启用消息加密时填写', + }, telegram: { name: 'Telegram', token: 'Bot Token', @@ -1739,6 +1761,7 @@ export default { channel: '通知', wechat: '企业微信', wechatClawBot: '微信 ClawBot', + feishu: '飞书', resourceDownload: '资源下载', mediaImport: '整理入库', subscription: '订阅', @@ -2803,6 +2826,7 @@ export default { accountBinding: '账号绑定', wechatUser: '企业微信用户', wechatClawBotUser: '微信 ClawBot 用户', + feishuUser: '飞书用户', telegramUser: 'Telegram用户', slackUser: 'Slack用户', discordUser: 'Discord用户', @@ -3386,6 +3410,7 @@ export default { typeHint: '选择要使用的通知渠道类型', name: '通知名称', nameHint: '为通知渠道设置一个名称', + feishuConfig: '飞书配置', telegramConfig: 'Telegram 配置', emailConfig: '邮件配置', botToken: '机器人令牌', diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 99ccbd71..c55aec01 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -501,6 +501,28 @@ export default { logoutSuccess: '微信 ClawBot 已退出登入', logoutFailed: '微信 ClawBot 退出登入失敗', }, + feishu: { + name: '飛書', + appId: 'App ID', + appIdHint: '飛書開放平台應用的 App ID', + appIdRequired: 'App ID 不能為空', + appSecret: 'App Secret', + appSecretHint: '飛書開放平台應用的 App Secret', + appSecretRequired: 'App Secret 不能為空', + openId: '預設用戶 Open ID', + openIdHint: '預設通知接收用戶的 Open ID,留空則優先使用互動用戶', + openIdPlaceholder: 'ou_xxx', + chatId: '預設群聊 Chat ID', + chatIdHint: '預設通知接收群聊的 Chat ID,和 Open ID 二選一即可', + chatIdPlaceholder: 'oc_xxx', + admins: '管理員白名單', + adminsHint: '允許執行命令與管理操作的 Open ID 列表,多個使用 , 分隔', + adminsPlaceholder: 'Open ID 列表,多個使用 , 分隔', + verificationToken: 'Verification Token', + verificationTokenHint: '飛書事件訂閱的 Verification Token,啟用事件校驗時填寫', + encryptKey: 'Encrypt Key', + encryptKeyHint: '飛書事件訂閱的 Encrypt Key,啟用消息加密時填寫', + }, telegram: { name: 'Telegram', token: 'Bot Token', @@ -1741,6 +1763,7 @@ export default { channel: '通知', wechat: '企業微信', wechatClawBot: '微信 ClawBot', + feishu: '飛書', resourceDownload: '資源下載', mediaImport: '整理入庫', subscription: '訂閱', @@ -2805,6 +2828,7 @@ export default { accountBinding: '賬號綁定', wechatUser: '企業微信用戶', wechatClawBotUser: '微信 ClawBot 用戶', + feishuUser: '飛書用戶', telegramUser: 'Telegram用戶', slackUser: 'Slack用戶', discordUser: 'Discord用戶', @@ -3388,6 +3412,7 @@ export default { typeHint: '選擇要使用的通知管道類型', name: '通知名稱', nameHint: '為通知管道設定一個名稱', + feishuConfig: '飛書設定', telegramConfig: 'Telegram 設定', emailConfig: '郵件設定', botToken: '機器人權杖', diff --git a/src/utils/imageUtils.ts b/src/utils/imageUtils.ts index 7d9f7c80..4e0a4c65 100644 --- a/src/utils/imageUtils.ts +++ b/src/utils/imageUtils.ts @@ -14,6 +14,7 @@ import plexLogo from '@/assets/images/logos/plex.png' import trimemediaLogo from '@/assets/images/logos/trimemedia.png' import ugreenLogo from '@/assets/images/logos/ugreen.png' import wechatLogo from '@/assets/images/logos/wechat.png' +import feishuLogo from '@/assets/images/logos/feishu.png' import clawbotLogo from '@/assets/images/logos/clawbot.png' import telegramLogo from '@/assets/images/logos/telegram.webp' import slackLogo from '@/assets/images/logos/slack.webp' @@ -47,6 +48,7 @@ const logoMap: Record = { trimemedia: trimemediaLogo, ugreen: ugreenLogo, wechat: wechatLogo, + feishu: feishuLogo, wechatclawbot: clawbotLogo, telegram: telegramLogo, slack: slackLogo, diff --git a/src/views/setting/AccountSettingNotification.vue b/src/views/setting/AccountSettingNotification.vue index 79d4ab77..bf201903 100644 --- a/src/views/setting/AccountSettingNotification.vue +++ b/src/views/setting/AccountSettingNotification.vue @@ -357,9 +357,12 @@ onMounted(() => { {{ t('setting.notification.wechatClawBot') }} - - {{ t('setting.notification.telegram') }} + + {{ t('setting.notification.feishu') }} + + {{ t('setting.notification.telegram') }} + {{ t('setting.notification.slack') }} diff --git a/src/views/setup/NotificationSettingsStep.vue b/src/views/setup/NotificationSettingsStep.vue index 4e98f861..e93501f3 100644 --- a/src/views/setup/NotificationSettingsStep.vue +++ b/src/views/setup/NotificationSettingsStep.vue @@ -66,6 +66,19 @@ const notificationTypes = [ + + + + +
飞书
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +