From ca4e8002434c6d0af0e3e694ebbcba1f3ac797e7 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Tue, 27 Oct 2026 16:14:14 +0800 Subject: [PATCH] feat: Add an opening message and an icon to the conversation page. --- ui/src/api/admin/auth/external-login.ts | 3 +- ui/src/api/admin/auth/types.ts | 20 +-- .../application/application.ts | 13 +- .../workspace/application/application.ts | 13 +- ui/src/api/chat/auth.ts | 41 ++++- ui/src/api/types/application.ts | 2 + ui/src/api/types/chat-application.ts | 42 ++++- ui/src/api/types/login.ts | 19 +++ ui/src/assets/conversation/load_error.png | Bin 0 -> 11156 bytes ui/src/constants/CONSTANT_README.md | 3 + ui/src/constants/application.ts | 24 +++ .../components/content/items/text.vue | 7 +- .../components/header/debug/index.vue | 1 - .../markdown-renderer/EchartsRender.vue | 161 ++++++++++++++++++ .../markdown-renderer/FormRender.vue | 32 ++++ .../markdown-renderer/HtmlRender.vue | 23 +++ .../markdown-renderer/IframeRender.vue | 20 +++ .../markdown-renderer/QuickQuestion.vue | 19 +++ .../markdown-renderer/ReasoningRender.vue | 37 ++++ .../markdown-renderer/iframe-bridge.ts | 143 ++++++++++++++++ .../components/markdown-renderer/index.vue | 83 +++++++++ .../markdown-renderer/parse-tags.ts | 80 +++++++++ .../tool-calls-render/content/index.vue | 15 ++ .../content/simple-tool-calls/index.vue | 17 ++ .../tool-calls-render/index.ts | 6 + .../tool-calls-render/index.vue | 40 +++++ .../components/message-input/index.ts | 92 ++++++---- .../components/message-list/index.ts | 9 +- .../components/message-list/index.vue | 49 ++++-- .../components/prologue-content/index.ts | 24 +++ .../components/prologue-content/index.vue | 16 ++ ui/src/conversation-panel/core/types.ts | 8 +- .../left-sidebar/conversation-list/index.ts | 9 +- .../main/chat-panel/index.vue | 7 +- ui/src/conversation-panel/view/chat/index.ts | 25 ++- .../conversation-panel/view/debug/app-info.ts | 73 ++++++++ ui/src/conversation-panel/view/debug/index.ts | 40 ++++- .../conversation-panel/view/debug/index.vue | 10 +- ui/src/conversation-panel/view/types.ts | 4 + .../application/components/ButtonDebug.vue | 5 +- ui/src/views/workflow/application/index.vue | 1 + 41 files changed, 1133 insertions(+), 103 deletions(-) create mode 100644 ui/src/assets/conversation/load_error.png create mode 100644 ui/src/constants/application.ts create mode 100644 ui/src/conversation-panel/components/markdown-renderer/EchartsRender.vue create mode 100644 ui/src/conversation-panel/components/markdown-renderer/FormRender.vue create mode 100644 ui/src/conversation-panel/components/markdown-renderer/HtmlRender.vue create mode 100644 ui/src/conversation-panel/components/markdown-renderer/IframeRender.vue create mode 100644 ui/src/conversation-panel/components/markdown-renderer/QuickQuestion.vue create mode 100644 ui/src/conversation-panel/components/markdown-renderer/ReasoningRender.vue create mode 100644 ui/src/conversation-panel/components/markdown-renderer/iframe-bridge.ts create mode 100644 ui/src/conversation-panel/components/markdown-renderer/index.vue create mode 100644 ui/src/conversation-panel/components/markdown-renderer/parse-tags.ts create mode 100644 ui/src/conversation-panel/components/markdown-renderer/tool-calls-render/content/index.vue create mode 100644 ui/src/conversation-panel/components/markdown-renderer/tool-calls-render/content/simple-tool-calls/index.vue create mode 100644 ui/src/conversation-panel/components/markdown-renderer/tool-calls-render/index.ts create mode 100644 ui/src/conversation-panel/components/markdown-renderer/tool-calls-render/index.vue create mode 100644 ui/src/conversation-panel/components/prologue-content/index.ts create mode 100644 ui/src/conversation-panel/components/prologue-content/index.vue create mode 100644 ui/src/conversation-panel/view/debug/app-info.ts diff --git a/ui/src/api/admin/auth/external-login.ts b/ui/src/api/admin/auth/external-login.ts index 8600bfcd3aa..0690a49a552 100644 --- a/ui/src/api/admin/auth/external-login.ts +++ b/ui/src/api/admin/auth/external-login.ts @@ -1,7 +1,8 @@ /** 提供 Admin 第三方认证、扫码登录及客户端授权回调接口。 */ import { get } from '../core/request' -import type { ExternalAuthSetting, LoginResponse, QrCodeSource } from './types' +import type { ExternalAuthSetting, QrCodeSource } from '@/api/types' +import type { LoginResponse } from './types' /** 获取外部认证方式的跳转配置。 */ const getExternalAuthSetting = (authType: string) => { diff --git a/ui/src/api/admin/auth/types.ts b/ui/src/api/admin/auth/types.ts index 5ab8bec417d..70fdffa8666 100644 --- a/ui/src/api/admin/auth/types.ts +++ b/ui/src/api/admin/auth/types.ts @@ -1,6 +1,6 @@ /** Admin 认证 API 及其 Store 消费方共同使用的类型。 */ -import type { LoginMethod, QrCodeConfig, WorkspaceItem } from '@/api/types' +import type { WorkspaceItem } from '@/api/types' export interface CurrentUserInfo { email: string @@ -32,24 +32,6 @@ export interface CaptchaResponse { captcha: string } -export interface ExternalAuthConfig { - authEndpoint?: string - clientId?: string - ldpUri?: string - redirectUrl: string - scope?: string - state?: string -} - -export interface ExternalAuthSetting { - config?: ExternalAuthConfig -} - -export interface QrCodeSource { - auth_type: Extract - config: QrCodeConfig -} - export interface BaseProfile { edition: 'CE' | 'EE' | 'PE' license_is_valid: boolean diff --git a/ui/src/api/admin/system/resource-management/application/application.ts b/ui/src/api/admin/system/resource-management/application/application.ts index 2866d4f4624..419385dab43 100644 --- a/ui/src/api/admin/system/resource-management/application/application.ts +++ b/ui/src/api/admin/system/resource-management/application/application.ts @@ -1,6 +1,13 @@ import { del, get, getExportFile, put } from '@/api/admin/core/request' import type { ParamsPage, ResponsePage } from '@/api/admin/core/types' -import type { ApplicationAccessToken, ApplicationAccessTokenPayload, ApplicationDetail, ApplicationFormPayload, Dict } from '@/api/types' +import type { + ApplicationAccessToken, + ApplicationAccessTokenPayload, + ApplicationDetail, + ApplicationDisplaySetting, + ApplicationFormPayload, + Dict, +} from '@/api/types' const prefix = '/system/resource/application' @@ -45,6 +52,9 @@ const getAccessToken = (applicationId: string) => get(`$ const putAccessToken = (applicationId: string, payload: ApplicationAccessTokenPayload) => put(`${prefix}/${applicationId}/access_token`, payload) +/** 获取智能体展示设置,仅许可证有效的专业版、企业版提供;未保存过的字段可能缺失。 */ +const getDisplaySetting = (applicationId: string) => get>(`${prefix}/${applicationId}/setting`) + /** 保存智能体展示设置,沿用 V2 图片与配置的 multipart 协议。 */ const putDisplaySetting = (applicationId: string, payload: FormData) => put(`${prefix}/${applicationId}/setting`, payload) @@ -63,6 +73,7 @@ export default { getApplicationDetail, getAccessToken, putAccessToken, + getDisplaySetting, putDisplaySetting, putApplication, putApplicationPublish, diff --git a/ui/src/api/admin/workspace/application/application.ts b/ui/src/api/admin/workspace/application/application.ts index fce1df2b9eb..5cf6fa39dc6 100644 --- a/ui/src/api/admin/workspace/application/application.ts +++ b/ui/src/api/admin/workspace/application/application.ts @@ -1,6 +1,13 @@ import { del, get, getExportFile, post, put } from '../../core/request' import type { ParamsPage, ResponsePage } from '../../core/types' -import type { ApplicationAccessToken, ApplicationAccessTokenPayload, ApplicationDetail, ApplicationFormPayload, Dict } from '@/api/types' +import type { + ApplicationAccessToken, + ApplicationAccessTokenPayload, + ApplicationDetail, + ApplicationDisplaySetting, + ApplicationFormPayload, + Dict, +} from '@/api/types' import { getWorkspaceId } from '@/utils/resource-context' const getPrefix = () => { @@ -34,6 +41,9 @@ const getAccessToken = (applicationId: string) => get(`$ const putAccessToken = (applicationId: string, payload: ApplicationAccessTokenPayload) => put(`${getPrefix()}/${applicationId}/access_token`, payload) +/** 获取智能体展示设置,仅许可证有效的专业版、企业版提供;未保存过的字段可能缺失。 */ +const getDisplaySetting = (applicationId: string) => get>(`${getPrefix()}/${applicationId}/setting`) + /** 保存智能体展示设置,沿用 V2 图片与配置的 multipart 协议。 */ const putDisplaySetting = (applicationId: string, payload: FormData) => put(`${getPrefix()}/${applicationId}/setting`, payload) @@ -103,6 +113,7 @@ export default { getApplicationDetail, getAccessToken, putAccessToken, + getDisplaySetting, putDisplaySetting, deleteApplication, exportApplication, diff --git a/ui/src/api/chat/auth.ts b/ui/src/api/chat/auth.ts index ed2589ce984..ea77baa88f9 100644 --- a/ui/src/api/chat/auth.ts +++ b/ui/src/api/chat/auth.ts @@ -1,8 +1,8 @@ -/** 提供单应用对话与门户的认证前置配置、匿名认证、登录和登出接口。 */ +/** 提供单应用对话与门户的认证前置配置、匿名认证、账号/第三方/扫码登录和登出接口。 */ import { get, post, promise, request } from './core/request' import type { ApiResponse } from './core/types' -import type { ApplicationAuthProfile, ChatLoginRequest, ChatLoginResponse, PortalAuthProfile } from '@/api/types' +import type { ApplicationAuthProfile, ChatLoginRequest, ChatLoginResponse, ExternalAuthSetting, PortalAuthProfile, QrCodeSource } from '@/api/types' interface ChatCaptchaResponse { captcha: string @@ -43,6 +43,30 @@ const postLogin = (loginRequest: ChatLoginRequest, accessToken?: string, savedTo ) } +/** 使用 LDAP 账号登录;传入 accessToken 时登录到对应应用,否则登录门户。携带本地保存的 token。 */ +const postLdapLogin = (loginRequest: ChatLoginRequest, accessToken?: string, savedToken?: string) => { + return promise( + request.post>(accessToken ? `/auth/ldap/login/${accessToken}` : '/auth/ldap/login', loginRequest, { + headers: getSavedTokenHeaders(savedToken), + }), + ) +} + +/** 获取 CAS、OIDC、OAuth2 等对话用户第三方认证的跳转配置。 */ +const getExternalAuthSetting = (authType: string) => { + return get(`/chat_user/${authType}/detail`) +} + +/** 获取对话用户扫码登录提供商配置。 */ +const getQrCodeSources = () => { + return get('/auth/qr_type/source') +} + +/** 使用钉钉扫码授权码登录;传入 accessToken 时登录到对应应用。 */ +const getDingTalkCallback = (code: string, accessToken?: string) => { + return get('/auth/dingtalk', accessToken ? { code, accessToken } : { code }) +} + /** * 获取应用登录验证码;无需验证码时返回空字符串。 * 后端当前以 `application_id` 查询参数接收 accessToken,且仅支持应用场景。 @@ -56,4 +80,15 @@ const postLogout = () => { return post('/v3/auth/logout') } -export default { getApplicationAuthProfile, getPortalAuthProfile, postAnonymousAuth, postLogin, getCaptcha, postLogout } +export default { + getApplicationAuthProfile, + getPortalAuthProfile, + postAnonymousAuth, + postLogin, + postLdapLogin, + getExternalAuthSetting, + getQrCodeSources, + getDingTalkCallback, + getCaptcha, + postLogout, +} diff --git a/ui/src/api/types/application.ts b/ui/src/api/types/application.ts index cef0bb08296..5cfa36f5003 100644 --- a/ui/src/api/types/application.ts +++ b/ui/src/api/types/application.ts @@ -140,6 +140,8 @@ export interface ApplicationFormPayload { tts_type?: string tts_autoplay?: boolean stt_autosend?: boolean + file_upload_enable?: boolean + file_upload_setting?: Record folder_id?: string workspace_id?: string mcp_enable?: boolean diff --git a/ui/src/api/types/chat-application.ts b/ui/src/api/types/chat-application.ts index 25c7f3cd875..e1a2ca47f75 100644 --- a/ui/src/api/types/chat-application.ts +++ b/ui/src/api/types/chat-application.ts @@ -1,12 +1,50 @@ /** 对话端智能体信息类型。 */ -/** 对话端可见的智能体基础信息,仅声明当前使用的字段。 */ +import type LogicFlow from '@logicflow/core' +import type { ApplicationType } from './application' +import type { Dict } from './common' + +/** + * 对话端可见的智能体信息。门户智能体列表只返回基础字段; + * profile 接口额外返回对话配置(已发布版本)与访问设置,访问设置中的展示项需许可证有效才返回。 + */ export interface ChatApplicationProfile { id: string name: string icon: string - desc?: string + desc?: string | null prologue?: string + type?: ApplicationType + dialogue_number?: number + problem_optimization?: boolean + stt_model_id?: string | null + tts_model_id?: string | null + stt_model_enable?: boolean + tts_model_enable?: boolean + tts_type?: string + tts_autoplay?: boolean + stt_autosend?: boolean + file_upload_enable?: boolean + file_upload_setting?: Dict + /** 仅包含开始节点(base-node),非工作流智能体为 null。 */ + work_flow?: LogicFlow.GraphConfigData | null + show_source?: boolean + show_exec?: boolean + show_share?: boolean + language?: string | null + show_history?: boolean + draggable?: boolean + show_guide?: boolean + avatar?: string + show_avatar?: boolean + float_icon?: string + disclaimer?: boolean + disclaimer_value?: string + custom_theme?: { theme_color?: string; header_font_color?: string } + user_avatar?: string + show_user_avatar?: boolean + float_location?: Dict + chat_background?: string } /** 门户历史对话中单条会话的摘要。 */ diff --git a/ui/src/api/types/login.ts b/ui/src/api/types/login.ts index e6cb574db20..0c14c93cd53 100644 --- a/ui/src/api/types/login.ts +++ b/ui/src/api/types/login.ts @@ -21,6 +21,25 @@ export interface QrCodeConfig { qr_url?: string } +export interface QrCodeSource { + auth_type: QrCodeProvider + config: QrCodeConfig +} + +/** CAS、OIDC、OAuth2 等第三方认证的跳转配置。 */ +export interface ExternalAuthConfig { + authEndpoint?: string + clientId?: string + ldpUri?: string + redirectUrl: string + scope?: string + state?: string +} + +export interface ExternalAuthSetting { + config?: ExternalAuthConfig +} + export interface UpdatePasswordForm { password: string re_password: string diff --git a/ui/src/assets/conversation/load_error.png b/ui/src/assets/conversation/load_error.png new file mode 100644 index 0000000000000000000000000000000000000000..695abfd885e460f29d7a47ce4fef571d9ecbc4cf GIT binary patch literal 11156 zcmeHtS2$c@+b)xl2oWU-(FZ|vQKJvhYod1&1Q7{9C@Ex!(Q0%dO11+>v(vQGG5NltsHFJATMle?VY5U zadl115PNGWW&>djehud*Hg@*P-mW$}-kQ2r-VRn`*32@}M3P?OfB;7ux91Qq$Jb79 zaW5(6zjDQa|F3TIF+=`7;^rX5Y^d=R@&x8;0}7^crywuP)t2v(n3xzJzW|?r01xm44;^)1U(dL&C#E0_QI{TcAE+?Rd?$O%+GyryXyY?<_-A*?{4CQ z$)I@u`|;nBc>;^R3Iy+G2RK@XPFnZoj!?yU6)}xb!lyFFKtVAL4G! z1vIPQBx|-+jhc@k5b~ljTjo)LILGTH$Tr`~raSZwe0)jqQWYYsb7Sr?;Ss1l&@A9}{1u4A{{7IWj?N9V_7g`KO|r)mlLxgOixacuRzvVb`O;q30u{w{1qhOM0K z_UE-?XUFGSLc(Re@*S2^AVLU#G6=jiF}yf_hiE0E)K^;Ok4ILSnHP!(Fweq+8jy3k)8}rBbxq>WDng|>MFtew zX2FPj@rO4FA*g0LVzTDt`zb?u#J3tR`!Ry!BMu?d(WA$g{>xO)3Lbn-FFO5@C>=;S z@|&TXs%KK^(qiF}@Uv@Yr|g=eru{^~DKeiX}m5IV_|SgyF_by(rUrcQ-xr+f<&F6Tv}tLKNaf(zbhhnL4O z1I_(!n_u7bJ?FAmxb(Co9xI#QA?+$7N)MjXWJUEWG(Nro>V-h@VDF5T6&Y6Kv=pVZ zuVCQecLTm1r}y}~!W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UzXHa9a!MvhAIL)AM!tC~3*shJygarmg4d%X^K|I~6n%fx*!pv(A zF4lj^etNslJY%q<`pf?MdE~Lk>QDcJ)ecg<^;D0OU^aK#;R1R3XqhkAy{Z@KH!07Q zO6r{swjI^N^~5CNJEi_uZXJ-aHh@GO3M9t`4#%Xbd<@dtH`#^xjIVEyB&Zim%4lvG z_$>r}_W|?zYF_#d?jsxgrFg0>oG~uMQ8R%duW_{8R literal 0 HcmV?d00001 diff --git a/ui/src/constants/CONSTANT_README.md b/ui/src/constants/CONSTANT_README.md index 024d39d4ec1..00dbf753076 100644 --- a/ui/src/constants/CONSTANT_README.md +++ b/ui/src/constants/CONSTANT_README.md @@ -45,3 +45,6 @@ API 枚举值。例如角色类型和登录方式以 `src/api/enums` 为唯一 `file-type.ts` 维护图片、文档、视频和音频的文件扩展名常量,扩展名统一使用大写。 使用方判断文件类型时先将后缀转换为大写,再与对应常量匹配。 + +`application.ts` 的 `APPLICATION_DISPLAY_SETTING_DEFAULT` 维护智能体显示设置默认值,专业版显示设置弹窗的 +初始与恢复默认、调试面板(社区版或接口未返回的字段)共用;常量只读,使用方修改前先深拷贝。 diff --git a/ui/src/constants/application.ts b/ui/src/constants/application.ts new file mode 100644 index 00000000000..2eb3029216a --- /dev/null +++ b/ui/src/constants/application.ts @@ -0,0 +1,24 @@ +/** 智能体共享常量。 */ + +import type { ApplicationDisplaySetting } from '@/api/types' + +/** 显示设置默认值:专业版显示设置弹窗的初始与恢复默认,社区版调试面板也以此展示。使用方按需深拷贝。 */ +export const APPLICATION_DISPLAY_SETTING_DEFAULT: Readonly = { + show_source: false, + show_exec: false, + language: '', + show_history: true, + draggable: true, + show_share: true, + icon: '', + chat_background: '', + avatar: './favicon.ico', + float_icon: '', + user_avatar: './favicon.ico', + disclaimer: false, + disclaimer_value: '「以上内容均由 AI 生成,仅供参考和借鉴」', + custom_theme: { theme_color: '', header_font_color: '#1f2329' }, + float_location: { x: { type: 'right', value: 0 }, y: { type: 'bottom', value: 30 } }, + show_avatar: true, + show_user_avatar: true, +} diff --git a/ui/src/conversation-panel/components/content/items/text.vue b/ui/src/conversation-panel/components/content/items/text.vue index 4a4862158bc..a888a092d8a 100644 --- a/ui/src/conversation-panel/components/content/items/text.vue +++ b/ui/src/conversation-panel/components/content/items/text.vue @@ -1,17 +1,16 @@ diff --git a/ui/src/conversation-panel/components/header/debug/index.vue b/ui/src/conversation-panel/components/header/debug/index.vue index 351da6e6848..a33c4f25daa 100644 --- a/ui/src/conversation-panel/components/header/debug/index.vue +++ b/ui/src/conversation-panel/components/header/debug/index.vue @@ -18,7 +18,6 @@ const debug = useDebugHeaderStore() -

{{ appInfo?.name }}

diff --git a/ui/src/conversation-panel/components/markdown-renderer/EchartsRender.vue b/ui/src/conversation-panel/components/markdown-renderer/EchartsRender.vue new file mode 100644 index 00000000000..d73ff7f77ef --- /dev/null +++ b/ui/src/conversation-panel/components/markdown-renderer/EchartsRender.vue @@ -0,0 +1,161 @@ + + +