From 4437361eed762416037e646d92c8916f42c77a03 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Thu, 10 Jul 2025 22:33:39 +0800 Subject: [PATCH] feat: style --- apps/chat/template/embed.js | 4 +- ui/src/api/application/application-xpack.ts | 48 -- ui/src/api/application/application.ts | 22 + .../component/answer-content/index.vue | 13 +- .../ExecutionDetailContent.vue | 4 +- .../ParagraphSourceContent.vue | 2 +- .../knowledge-source-component/index.vue | 9 +- .../component/prologue-content/index.vue | 9 +- .../component/question-content/index.vue | 4 +- ui/src/components/ai-chat/index.vue | 12 +- ui/src/locales/lang/en-US/ai-chat.ts | 1 + ui/src/locales/lang/en-US/common.ts | 2 +- ui/src/locales/lang/zh-CN/ai-chat.ts | 1 + ui/src/locales/lang/zh-CN/common.ts | 2 +- ui/src/locales/lang/zh-Hant/ai-chat.ts | 1 + ui/src/locales/lang/zh-Hant/common.ts | 2 +- ui/src/stores/modules/application.ts | 31 +- ui/src/stores/modules/chat-user.ts | 9 - .../component/APIKeyDialog.vue | 4 +- ui/src/views/application-overview/index.vue | 4 +- .../XPackDisplaySettingDialog.vue | 573 +++++++++--------- .../component/NodeContent.vue | 51 +- ui/src/views/application-workflow/index.vue | 8 +- ui/src/views/chat/embed/index.vue | 25 +- ui/src/views/chat/mobile/index.vue | 29 +- ui/src/views/chat/pc/index.vue | 17 +- ui/src/views/document/index.vue | 190 +++--- .../paragraph/component/ParagraphCard.vue | 4 +- .../system-chat-user/chat-user/index.vue | 4 +- ui/src/views/system/user-manage/index.vue | 4 +- 30 files changed, 567 insertions(+), 522 deletions(-) delete mode 100644 ui/src/api/application/application-xpack.ts diff --git a/apps/chat/template/embed.js b/apps/chat/template/embed.js index a64e6379c..202b52db7 100644 --- a/apps/chat/template/embed.js +++ b/apps/chat/template/embed.js @@ -240,8 +240,8 @@ function initMaxkbStyle(root, maxkbId){ } #maxkb-chat-container { - width: 450px; - height: 600px; + width: 460px; + height: 680px; display:none; } @media only screen and (max-width: 768px) { diff --git a/ui/src/api/application/application-xpack.ts b/ui/src/api/application/application-xpack.ts deleted file mode 100644 index 6209e6d73..000000000 --- a/ui/src/api/application/application-xpack.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Result } from '@/request/Result' -import { get, put } from '@/request/index' -import useStore from '@/stores' -import { type Ref } from 'vue' - -const prefix: any = { _value: '/workspace/' } -Object.defineProperty(prefix, 'value', { - get: function () { - const { user } = useStore() - return this._value + user.getWorkspaceId() + '/application' - }, -}) - -/** - * 替换社区版-获取AccessToken - * @param 参数 application_id - */ -const getAccessToken: (application_id: string, loading?: Ref) => Promise> = ( - application_id, - loading, -) => { - return get(`${prefix.value}/${application_id}/setting`, undefined, loading) -} - -/** - * 替换社区版-修改AccessToken - * @param 参数 application_id - * data { - * "show_source": boolean, - * "show_history": boolean, - * "draggable": boolean, - * "show_guide": boolean, - * "avatar": file, - * "float_icon": file, - * } - */ -const putAccessToken: ( - application_id: string, - data: any, - loading?: Ref, -) => Promise> = (application_id, data, loading) => { - return put(`${prefix.value}/${application_id}/setting`, data, undefined, loading) -} - -export default { - getAccessToken, - putAccessToken, -} diff --git a/ui/src/api/application/application.ts b/ui/src/api/application/application.ts index df5491403..583f1c721 100644 --- a/ui/src/api/application/application.ts +++ b/ui/src/api/application/application.ts @@ -120,6 +120,27 @@ const putAccessToken: ( return put(`${prefix.value}/${application_id}/access_token`, data, undefined, loading) } +/** + * 替换社区版-修改AccessToken + * @param 参数 application_id + * data { + * "show_source": boolean, + * "show_history": boolean, + * "draggable": boolean, + * "show_guide": boolean, + * "avatar": file, + * "float_icon": file, + * } + */ +const putXpackAccessToken: ( + application_id: string, + data: any, + loading?: Ref, +) => Promise> = (application_id, data, loading) => { + return put(`${prefix.value}/${application_id}/setting`, data, undefined, loading) +} + + /** * 导出应用 */ @@ -331,6 +352,7 @@ export default { getApplicationDetail, getAccessToken, putAccessToken, + putXpackAccessToken, exportApplication, importApplication, getStatistics, diff --git a/ui/src/components/ai-chat/component/answer-content/index.vue b/ui/src/components/ai-chat/component/answer-content/index.vue index f544cfd29..ccaf584d4 100644 --- a/ui/src/components/ai-chat/component/answer-content/index.vue +++ b/ui/src/components/ai-chat/component/answer-content/index.vue @@ -42,6 +42,7 @@ () -const { user } = useStore() - const emit = defineEmits([ 'update:chatRecord', 'openExecutionDetail', @@ -100,10 +99,10 @@ const emit = defineEmits([ ]) const showAvatar = computed(() => { - return user.isEE() || user.isPE() ? props.application.show_avatar : true + return props.application.show_avatar == undefined ? true : props.application.show_avatar }) const showUserAvatar = computed(() => { - return user.isEE() || user.isPE() ? props.application.show_user_avatar : true + return props.application.show_user_avatar == undefined ? true : props.application.show_user_avatar }) const chatMessage = (question: string, type: 'old' | 'new', other_params_data?: any) => { if (type === 'old') { @@ -150,7 +149,11 @@ function showSource(row: any) { if (props.type === 'log') { return true } else if (row.write_ed && 500 !== row.status) { - if (props.type === 'debug-ai-chat' || props.application?.show_source) { + if ( + props.type === 'debug-ai-chat' || + props.application?.show_source || + props.application?.show_exec + ) { return true } } diff --git a/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue b/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue index deff5f1cb..dd6750fde 100644 --- a/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue +++ b/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue @@ -193,7 +193,7 @@ >
- {{ $t('views.application.applicationForm.form.roleSettings.label') }} + {{ $t('views.application.form.roleSettings.label') }}
{{ item.system || '-' }} @@ -503,7 +503,7 @@
- - + {{ $t('chat.KnowledgeSource.noSource') }}
diff --git a/ui/src/components/ai-chat/component/knowledge-source-component/index.vue b/ui/src/components/ai-chat/component/knowledge-source-component/index.vue index b454f9cd9..b176750b0 100644 --- a/ui/src/components/ai-chat/component/knowledge-source-component/index.vue +++ b/ui/src/components/ai-chat/component/knowledge-source-component/index.vue @@ -1,6 +1,6 @@ -
+
- - - - -
- {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.customThemeColor') }} -
-
- - {{ - !xpackForm.custom_theme.theme_color - ? $t('views.applicationOverview.appInfo.SettingDisplayDialog.default') - : '' - }} -
-
- -
- {{ - $t('views.applicationOverview.appInfo.SettingDisplayDialog.headerTitleFontColor') - }} -
- -
-
- -
- {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.languageLabel') }} -
- - - -
- - -
- {{ $t('views.application.title') + ' LOGO' }} - - - - {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }} - - - -
- - {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }} - -
- - -
- {{ - $t('views.applicationOverview.appInfo.SettingDisplayDialog.chatBackground') - }} - - - - {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }} - - - -
- - {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.chatBackgroundMessage') }} - -
- - -
- {{ - $t('views.applicationOverview.appInfo.SettingDisplayDialog.AIAvatar') - }} - - {{ - $t('views.applicationOverview.appInfo.SettingDisplayDialog.display') - }} - - - {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }} - - - -
- - {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }} - -
- - -
- {{ - $t('views.applicationOverview.appInfo.SettingDisplayDialog.askUserAvatar') - }} - - - {{ - $t('views.applicationOverview.appInfo.SettingDisplayDialog.display') - }} - - - {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }} - - - -
- {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }} - -
- - -
- {{ - $t('views.applicationOverview.appInfo.SettingDisplayDialog.floatIcon') - }} - - - {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }} - - -
- - {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }} - -
-
- {{ - $t('views.applicationOverview.appInfo.SettingDisplayDialog.iconDefaultPosition') - }} - -
- + +
+ + -
- - - - - - px +
+ {{ + $t('views.applicationOverview.appInfo.SettingDisplayDialog.customThemeColor') + }} +
+
+ + {{ + !xpackForm.custom_theme.theme_color + ? $t('views.applicationOverview.appInfo.SettingDisplayDialog.default') + : '' + }}
-
- - - - - - px -
+
+ {{ + $t( + 'views.applicationOverview.appInfo.SettingDisplayDialog.headerTitleFontColor', + ) + }} +
+
-
- + +
+ {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.languageLabel') }} +
+ + + +
+ + +
+ {{ $t('views.application.title') + ' LOGO' }} + + + + {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }} + + + +
+ + {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }} + +
+ + +
+ {{ + $t('views.applicationOverview.appInfo.SettingDisplayDialog.chatBackground') + }} + + + + {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }} + + + +
+ + {{ + $t('views.applicationOverview.appInfo.SettingDisplayDialog.chatBackgroundMessage') + }} + +
+ + +
+ {{ + $t('views.applicationOverview.appInfo.SettingDisplayDialog.AIAvatar') + }} + + {{ + $t('views.applicationOverview.appInfo.SettingDisplayDialog.display') + }} + + + {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }} + + + +
+ + {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }} + +
+ + +
+ {{ + $t('views.applicationOverview.appInfo.SettingDisplayDialog.askUserAvatar') + }} + + + {{ + $t('views.applicationOverview.appInfo.SettingDisplayDialog.display') + }} + + + {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }} + + + +
+ {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }} + +
+ + +
+ {{ + $t('views.applicationOverview.appInfo.SettingDisplayDialog.floatIcon') + }} + + + {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }} + + +
+ + {{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }} + +
+
+ {{ + $t('views.applicationOverview.appInfo.SettingDisplayDialog.iconDefaultPosition') + }} + +
+ + +
+ + + + + + px +
+
+ +
+ + + + + + px +
+
+
+
+
- - - - - - - - -
+ + + + + + + + + +
+