diff --git a/ui/src/api/application.ts b/ui/src/api/application.ts index f21c465b0..f03e9950f 100644 --- a/ui/src/api/application.ts +++ b/ui/src/api/application.ts @@ -4,6 +4,7 @@ import type { pageRequest } from '@/api/type/common' import type { ApplicationFormType } from '@/api/type/application' import { type Ref } from 'vue' import type { FormField } from '@/components/dynamics-form/type' + const prefix = '/application' /** @@ -352,6 +353,40 @@ const postTextToSpeech: ( ) => Promise> = (application_id, data, loading) => { return download(`${prefix}/${application_id}/text_to_speech`, 'post', data, undefined, loading) } +/** + * 获取平台状态 + */ +const getPlatformStatus: (application_id: string) => Promise> = (application_id) => { + return get(`/platform/${application_id}/status`) +} +/** + * 获取平台配置 + */ +const getPlatformConfig: (application_id: string, type: string) => Promise> = ( + application_id, + type +) => { + return get(`/platform/${application_id}/${type}`) +} +/** + * 更新平台配置 + */ +const updatePlatformConfig: ( + application_id: string, + type: string, + data: any +) => Promise> = (application_id, type, data) => { + return post(`/platform/${application_id}/${type}`, data) +} +/** + * 更新平台状态 + */ +const updatePlatformStatus: (application_id: string, data: any) => Promise> = ( + application_id, + data +) => { + return post(`/platform/${application_id}/status`, data) +} export default { getAllAppilcation, @@ -381,4 +416,8 @@ export default { getApplicationTTSModel, postSpeechToText, postTextToSpeech, + getPlatformStatus, + getPlatformConfig, + updatePlatformConfig, + updatePlatformStatus } diff --git a/ui/src/assets/logo_dingtalk.svg b/ui/src/assets/logo_dingtalk.svg new file mode 100644 index 000000000..64d957d4f --- /dev/null +++ b/ui/src/assets/logo_dingtalk.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/src/assets/logo_lark.svg b/ui/src/assets/logo_lark.svg new file mode 100644 index 000000000..938c5055d --- /dev/null +++ b/ui/src/assets/logo_lark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/ui/src/assets/logo_wechat-work.svg b/ui/src/assets/logo_wechat-work.svg new file mode 100644 index 000000000..ea8601249 --- /dev/null +++ b/ui/src/assets/logo_wechat-work.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ui/src/assets/logo_wechat.svg b/ui/src/assets/logo_wechat.svg new file mode 100644 index 000000000..6c0e78de8 --- /dev/null +++ b/ui/src/assets/logo_wechat.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/src/components/icons/index.ts b/ui/src/components/icons/index.ts index 246a1dcba..716399ca6 100644 --- a/ui/src/components/icons/index.ts +++ b/ui/src/components/icons/index.ts @@ -1101,5 +1101,51 @@ export const iconMap: any = { ) ]) } + }, + 'app-access': { + iconReader: () => { + return h('i', [ + h( + 'svg', + { + style: { height: '100%', width: '100%' }, + viewBox: '0 0 1024 1024', + version: '1.1', + xmlns: 'http://www.w3.org/2000/svg' + }, + [ + h('path', { + d: 'M490.368 48.554667a42.666667 42.666667 0 0 1 43.264 0l362.666667 213.333333A42.666667 42.666667 0 0 1 917.333333 298.666667v426.666666a42.666667 42.666667 0 0 1-21.034666 36.778667l-362.666667 213.333333a42.666667 42.666667 0 0 1-43.264 0l-362.666667-213.333333A42.666667 42.666667 0 0 1 106.666667 725.333333V298.666667a42.666667 42.666667 0 0 1 21.034666-36.778667l362.666667-213.333333zM192 323.072v377.856L512 889.173333l320-188.245333V323.072L512 134.826667 192 323.072z', + fill: 'currentColor' + }), + h('path', { + d: 'M705.194667 441.472a42.666667 42.666667 0 1 0-45.226667-72.362667l-148.096 92.586667L363.946667 369.066667a42.666667 42.666667 0 1 0-45.312 72.362666L469.333333 535.722667V704a42.666667 42.666667 0 1 0 85.333334 0v-168.448l150.528-94.08z', + fill: 'currentColor' + }) + ] + ) + ]) + } + }, + 'app-access-active': { + iconReader: () => { + return h('i', [ + h( + 'svg', + { + style: { height: '100%', width: '100%' }, + viewBox: '0 0 1024 1024', + version: '1.1', + xmlns: 'http://www.w3.org/2000/svg' + }, + [ + h('path', { + d: 'M533.632 48.554667a42.666667 42.666667 0 0 0-43.264 0l-362.666667 213.333333A42.666667 42.666667 0 0 0 106.666667 298.666667v426.666666a42.666667 42.666667 0 0 0 21.034666 36.778667l362.666667 213.333333a42.666667 42.666667 0 0 0 43.264 0l362.666667-213.333333A42.666667 42.666667 0 0 0 917.333333 725.333333V298.666667a42.666667 42.666667 0 0 0-21.034666-36.778667l-362.666667-213.333333z m185.130667 334.08a42.666667 42.666667 0 0 1-13.568 58.837333L554.666667 535.552V704a42.666667 42.666667 0 1 1-85.333334 0v-168.277333l-150.613333-94.293334a42.666667 42.666667 0 0 1 45.226667-72.32l147.925333 92.586667 148.053333-92.586667a42.666667 42.666667 0 0 1 58.837334 13.568z', + fill: 'currentColor' + }) + ] + ) + ]) + } } } diff --git a/ui/src/router/modules/application.ts b/ui/src/router/modules/application.ts index 366f49ac8..df37b7dc6 100644 --- a/ui/src/router/modules/application.ts +++ b/ui/src/router/modules/application.ts @@ -1,4 +1,5 @@ import Layout from '@/layout/layout-template/DetailLayout.vue' +import { ComplexPermission } from '@/utils/permission/type' const applicationRouter = { path: '/application', name: 'application', @@ -51,6 +52,20 @@ const applicationRouter = { }, component: () => import('@/views/application/ApplicationSetting.vue') }, + { + path: 'access', + name: 'AppAccess', + meta: { + icon: 'app-access', + iconActive: 'app-access-active', + title: '应用接入', + active: 'access', + parentPath: '/application/:id/:type', + parentName: 'ApplicationDetail', + permission: new ComplexPermission([], ['x-pack'], 'OR') + }, + component: () => import('@/views/application/ApplicationAccess.vue') + }, { path: 'hit-test', name: 'AppHitTest', diff --git a/ui/src/styles/app.scss b/ui/src/styles/app.scss index c15b79913..2a6af0b4a 100644 --- a/ui/src/styles/app.scss +++ b/ui/src/styles/app.scss @@ -304,6 +304,10 @@ h5 { color: var(--el-color-primary); } +.border-none { + border: none; +} + .cursor { cursor: pointer; } diff --git a/ui/src/views/application/ApplicationAccess.vue b/ui/src/views/application/ApplicationAccess.vue new file mode 100644 index 000000000..b97f6d226 --- /dev/null +++ b/ui/src/views/application/ApplicationAccess.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/ui/src/views/application/component/AccessSettingDrawer.vue b/ui/src/views/application/component/AccessSettingDrawer.vue new file mode 100644 index 000000000..bad157009 --- /dev/null +++ b/ui/src/views/application/component/AccessSettingDrawer.vue @@ -0,0 +1,177 @@ + + + + +