Skip to content

Commit 097a24f

Browse files
authored
feat(ui): add Slack app integration for MaxKB app
1 parent 33c07fd commit 097a24f

File tree

6 files changed

+52
-2
lines changed

6 files changed

+52
-2
lines changed

ui/src/assets/logo_slack.svg

Lines changed: 1 addition & 0 deletions
Loading

ui/src/locales/lang/en-US/views/application.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ export default {
166166
wechatPlatform: 'WeChat Open Platform',
167167
dingtalkPlatform: 'DingTalk Open Platform',
168168
larkPlatform: 'Lark Open Platform',
169+
slack: 'Slack',
170+
slackTip: 'Create Slack intelligent APP',
169171
wecomSetting: {
170172
title: 'WeCom Configuration',
171173
cropId: 'Crop ID',
@@ -206,6 +208,11 @@ export default {
206208
urlInfo:
207209
'-Events and callbacks - event configuration - configure the "request address" of the subscription method'
208210
},
211+
slackSetting: {
212+
title: 'Slack Configuration',
213+
signingSecretPlaceholder: 'Please enter signing secret',
214+
botUserTokenPlaceholder: 'Please enter bot user token',
215+
},
209216
copyUrl: 'Copy the link and fill it in'
210217
},
211218
hitTest: {

ui/src/locales/lang/zh-CN/views/application.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ export default {
150150
wechatTip: '打造公众号智能应用',
151151
lark: '飞书应用',
152152
larkTip: '打造飞书智能应用',
153+
slack: 'Slack',
154+
slackTip: '打造 Slack 智能应用',
153155
setting: '配置',
154156
callback: '回调地址',
155157
callbackTip: '请输入回调地址',
@@ -193,7 +195,11 @@ export default {
193195
verificationTokenPlaceholder: '请输入Verification Token',
194196
urlInfo: '-事件与回调-事件配置-配置订阅方式的 "请求地址" 中'
195197
},
196-
198+
slackSetting: {
199+
title: 'Slack 应用配置',
200+
signingSecretPlaceholder: '请输入 Signing Secret',
201+
botUserTokenPlaceholder: '请输入 Bot User Token',
202+
},
197203
copyUrl: '复制链接填入到'
198204
},
199205
hitTest: {

ui/src/locales/lang/zh-Hant/views/application.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ export default {
149149
wechatTip: '打造公眾號智慧應用',
150150
lark: '飛書應用',
151151
larkTip: '打造飛書智慧應用',
152+
slack: 'Slack',
153+
slackTip: '打造 Slack 智慧應用',
152154
setting: '配置',
153155
callback: '回呼位址',
154156
callbackTip: '請輸入回呼位址',
@@ -192,6 +194,11 @@ export default {
192194
verificationTokenPlaceholder: '請輸入Verification Token',
193195
urlInfo: '-事件與回呼-事件配置-配置訂閱方式的 "請求位址" 中'
194196
},
197+
slackSetting: {
198+
title: 'Slack 應用配置',
199+
signingSecretPlaceholder: '請輸入 Signing Secret',
200+
botUserTokenPlaceholder: '請輸入 Bot User Token',
201+
},
195202
copyUrl: '複製連結填入到'
196203
},
197204
hitTest: {

ui/src/views/application/ApplicationAccess.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ const platforms = reactive([
8383
description: t('views.application.applicationAccess.larkTip'),
8484
isActive: false,
8585
exists: false
86+
},
87+
{
88+
key: 'slack',
89+
logoSrc: new URL(`../../assets/logo_slack.svg`, import.meta.url).href,
90+
name: t('views.application.applicationAccess.slack'),
91+
description: t('views.application.applicationAccess.slackTip'),
92+
isActive: false,
93+
exists: false
8694
}
8795
])
8896

ui/src/views/application/component/AccessSettingDrawer.vue

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ const form = reactive<any>({
136136
encoding_aes_key: '',
137137
callback_url: ''
138138
},
139-
feishu: { app_id: '', app_secret: '', verification_token: '', callback_url: '' }
139+
feishu: { app_id: '', app_secret: '', verification_token: '', callback_url: '' },
140+
slack: { signing_secret: '', bot_user_token: '', callback_url: '' }
140141
})
141142
142143
const rules = reactive<{ [propName: string]: any }>({
@@ -245,6 +246,22 @@ const rules = reactive<{ [propName: string]: any }>({
245246
trigger: 'blur'
246247
}
247248
]
249+
},
250+
slack: {
251+
signing_secret: [
252+
{
253+
required: true,
254+
message: t('views.application.applicationAccess.slackSetting.signingSecretPlaceholder'),
255+
trigger: 'blur'
256+
}
257+
],
258+
bot_user_token: [
259+
{
260+
required: true,
261+
message: t('views.application.applicationAccess.slackSetting.botUserTokenPlaceholder'),
262+
trigger: 'blur'
263+
}
264+
]
248265
}
249266
})
250267
@@ -282,6 +299,10 @@ const configFields: { [propName: string]: { [propName: string]: any } } = {
282299
app_id: { label: 'App ID', placeholder: '' },
283300
app_secret: { label: 'App Secret', placeholder: '' },
284301
verification_token: { label: 'Verification Token', placeholder: '' }
302+
},
303+
slack: {
304+
signing_secret: { label: 'Signing Secret', placeholder: '' },
305+
bot_user_token: { label: 'Bot User Token', placeholder: '' }
285306
}
286307
}
287308

0 commit comments

Comments
 (0)