Skip to content

Commit

Permalink
perf: load members;perf: yuque load;fix: workflow llm params cannot c…
Browse files Browse the repository at this point in the history
…lose (#3594)

* chat openapi doc

* feat: dataset openapi doc

* perf: load members

* perf: member load code

* perf: yuque load

* fix: workflow llm params cannot close
  • Loading branch information
c121914yu committed Jan 15, 2025
1 parent 68f5afe commit 80e6706
Show file tree
Hide file tree
Showing 31 changed files with 346 additions and 318 deletions.
2 changes: 1 addition & 1 deletion docSite/content/zh-cn/docs/development/openapi/chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/getHistories
- appId - 应用 Id
- offset - 偏移量,即从第几条数据开始取
- pageSize - 记录数量
- source - 对话源
- source - 对话源。source=api,表示获取通过 API 创建的对话(不会获取到页面上的对话记录)
{{% /alert %}}

{{< /markdownify >}}
Expand Down
21 changes: 17 additions & 4 deletions docSite/content/zh-cn/docs/development/openapi/dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,21 @@ data 为集合的 ID。
{{< tab tabName="请求示例" >}}
{{< markdownify >}}

**4.8.19+**
```bash
curl --location --request POST 'http://localhost:3000/api/core/dataset/collection/listv2' \
--header 'Authorization: Bearer {{authorization}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"offset":0,
"pageSize": 10,
"datasetId":"6593e137231a2be9c5603ba7",
"parentId": null,
"searchText":""
}'
```

**4.8.19-(不再维护)**
```bash
curl --location --request POST 'http://localhost:3000/api/core/dataset/collection/list' \
--header 'Authorization: Bearer {{authorization}}' \
Expand All @@ -753,7 +768,7 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
{{< markdownify >}}

{{% alert icon=" " context="success" %}}
- pageNum: 页码(选填)
- offset: 偏移量
- pageSize: 每页数量,最大30(选填)
- datasetId: 知识库的ID(必填)
- parentId: 父级Id(选填)
Expand All @@ -773,9 +788,7 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
"statusText": "",
"message": "",
"data": {
"pageNum": 1,
"pageSize": 10,
"data": [
"list": [
{
"_id": "6593e137231a2be9c5603ba9",
"parentId": null,
Expand Down
6 changes: 5 additions & 1 deletion docSite/content/zh-cn/docs/development/upgrading/4819.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ weight: 806

## 完整更新内容

1. 新增 - 工作流知识库检索支持按知识库权限进行过滤
1. 新增 - 工作流知识库检索支持按知识库权限进行过滤。
2. 优化 - 成员列表分页加载。
3. 优化 - 统一分页加载代码。
4. 修复 - 语雀文件库导入时,嵌套文件内容无法展开的问题。
5. 修复 - 工作流编排中,LLM 参数无法关闭问题。
2 changes: 1 addition & 1 deletion packages/global/core/dataset/apiDataset.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type APIFileItem = {
type: 'file' | 'folder';
updateTime: Date;
createTime: Date;
canEnter?: boolean;
hasChild?: boolean;
};

export type APIFileServer = {
Expand Down
3 changes: 2 additions & 1 deletion packages/global/support/user/team/org/type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ type OrgSchemaType = {
};

type OrgMemberSchemaType = {
_id: string;
teamId: string;
orgId: string;
tmbId: string;
};

type OrgType = Omit<OrgSchemaType, 'avatar'> & {
avatar: string;
members: OrgMemberSchemaType[];
permission: TeamPermission;
members: OrgMemberSchemaType[];
};
2 changes: 1 addition & 1 deletion packages/service/core/dataset/apiDataset/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const useApiDatasetRequest = ({ apiServer }: { apiServer: APIFileServer }

const formattedFiles = files.map((file) => ({
...file,
canEnter: file.type === 'folder'
hasChild: file.type === 'folder'
}));

return formattedFiles;
Expand Down
11 changes: 4 additions & 7 deletions packages/service/support/permission/org/orgSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@ export const OrgSchema = new Schema(
OrgSchema.virtual('members', {
ref: OrgMemberCollectionName,
localField: '_id',
foreignField: 'orgId'
foreignField: 'orgId',
match: function (this: OrgSchemaType) {
return { teamId: this.teamId };
}
});
// OrgSchema.virtual('permission', {
// ref: ResourcePermissionCollectionName,
// localField: '_id',
// foreignField: 'orgId',
// justOne: true
// });

try {
OrgSchema.index({
Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/common/Avatar/AvatarGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function AvatarGroup({
<Flex position="relative">
{avatars.slice(0, max).map((avatar, index) => (
<Avatar
key={avatar + groupId}
key={index}
src={avatar}
position={index > 0 ? 'absolute' : 'relative'}
left={index > 0 ? `${index * 15}px` : 0}
Expand Down
2 changes: 1 addition & 1 deletion packages/web/hooks/useScrollPagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import MyBox from '../components/common/MyBox';
import { useTranslation } from 'next-i18next';

type ItemHeight<T> = (index: number, data: T) => number;
const thresholdVal = 200;
const thresholdVal = 100;

export type ScrollListType = ({
children,
Expand Down
2 changes: 1 addition & 1 deletion projects/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "4.8.18",
"version": "4.8.19",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
Loading

0 comments on commit 80e6706

Please sign in to comment.