diff --git a/ui/src/api/API_README.md b/ui/src/api/API_README.md index 8987a149ed8..30df5128468 100644 --- a/ui/src/api/API_README.md +++ b/ui/src/api/API_README.md @@ -436,6 +436,11 @@ API 对象和工作空间上下文,作为该抽屉的范围选择例外;用 筛选保持一致;分页使用 `ParamsPage` 与 `ResponsePage`。导出沿用 `getExportFile`。 工作空间总量接口返回数值,不与 System 首页的对象响应混用。 +System 首页的智能体选项使用 `system/resource-management/application/application.ts` 的 +`getApplicationPage(page, query)`,请求 `/system/resource/application//`。 +工作空间筛选通过 `query.workspace_ids` 传入所选工作空间 ID 的 JSON 数组字符串;名称筛选使用 `name`。 +Workspace 智能体分页方法只接收分页与查询条件,从当前资源上下文读取工作空间。 + ### 对话面板接口 `admin/workspace/conversation.ts` 集中维护调试对话的打开、发送、取消、续传、历史会话、 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 3f1d9b40f19..1a596b97a78 100644 --- a/ui/src/api/admin/system/resource-management/application/application.ts +++ b/ui/src/api/admin/system/resource-management/application/application.ts @@ -1,14 +1,21 @@ -import { postStream } from '@/api/admin/core/request' -import type { PromptGeneratePayload } from '@/api/types' +import { get, postStream } from '@/api/admin/core/request' +import type { ParamsPage, ResponsePage } from '@/api/admin/core/types' +import type { ApplicationDetail, Dict, PromptGeneratePayload } from '@/api/types' import { ADMIN_API_BASE_PATH } from '@/api/constants' const prefix = '/system/resource/application' +/** 获取 System 资源管理智能体分页列表。 */ +const getApplicationPage = (page: ParamsPage, query?: Dict) => { + return get>(`${prefix}/${page.currentPage}/${page.pageSize}`, query) +} + /** 使用指定模型流式生成或优化 System 资源智能体的系统提示词。 */ const postPromptGenerate = (applicationId: string, modelId: string, payload: PromptGeneratePayload) => { return postStream(ADMIN_API_BASE_PATH, `${prefix}/${applicationId}/model/${modelId}/prompt_generate`, payload) } export default { + getApplicationPage, postPromptGenerate, } diff --git a/ui/src/api/admin/workspace/application/application.ts b/ui/src/api/admin/workspace/application/application.ts index 5d681b71bf4..6b9ad58522f 100644 --- a/ui/src/api/admin/workspace/application/application.ts +++ b/ui/src/api/admin/workspace/application/application.ts @@ -4,7 +4,8 @@ import type { ApplicationDetail, ApplicationFormPayload, Dict, PromptGeneratePay import { getWorkspaceId } from '@/utils/resource-context' import { ADMIN_API_BASE_PATH } from '@/api/constants' -const getPrefix = (workspaceId = getWorkspaceId()) => { +const getPrefix = () => { + const workspaceId = getWorkspaceId() return `/workspace/${workspaceId}/application` } @@ -16,8 +17,8 @@ const getAllApplication = (query?: Dict) => { } /** 获取工作空间智能体列表。 */ -const getApplicationPage = (page: ParamsPage, query?: Dict, workspaceId?: string) => { - return get>(`${getPrefix(workspaceId)}/${page.currentPage}/${page.pageSize}`, query) +const getApplicationPage = (page: ParamsPage, query?: Dict) => { + return get>(`${getPrefix()}/${page.currentPage}/${page.pageSize}`, query) } /** 获取工作空间智能体详情。 */ diff --git a/ui/src/components/mk-edit-avatar/index.vue b/ui/src/components/mk-edit-avatar/index.vue index 6acb3ff87bb..8a255746fe3 100644 --- a/ui/src/components/mk-edit-avatar/index.vue +++ b/ui/src/components/mk-edit-avatar/index.vue @@ -131,7 +131,7 @@ onBeforeUnmount(() => { :show-file-list="false" :on-change="selectImage" > - +
diff --git a/ui/src/conversation-panel/left-sidebar/conversation-list/index.vue b/ui/src/conversation-panel/left-sidebar/conversation-list/index.vue index b4fe1c7164e..1ffd2b4a59d 100644 --- a/ui/src/conversation-panel/left-sidebar/conversation-list/index.vue +++ b/ui/src/conversation-panel/left-sidebar/conversation-list/index.vue @@ -33,6 +33,8 @@ const conversationTime = (conversation: Conversation) => relativeTimeFormat(conv
历史对话
+ + diff --git a/ui/src/views/application-detail/chat-user/index.vue b/ui/src/views/application-detail/chat-user/index.vue index a1f646d4ae1..5a92ef69d64 100644 --- a/ui/src/views/application-detail/chat-user/index.vue +++ b/ui/src/views/application-detail/chat-user/index.vue @@ -145,7 +145,7 @@ onMounted(() => loadChatUserGroups())