feat: add pinning functionality for knowledge bases

- Introduced a new API endpoint to toggle the pin status of knowledge bases, allowing users to pin important entries to the top of the list.
- Updated the frontend to include UI elements for pinning and unpinning knowledge bases, with corresponding success and error messages.
- Enhanced localization support by adding translations for pinning actions in English, Korean, Russian, and Chinese.
- Modified the database schema to include `is_pinned` and `pinned_at` fields for knowledge bases, enabling persistent pinning status.

These changes improve the organization and accessibility of knowledge bases, enhancing user experience by allowing quick access to prioritized entries.
This commit is contained in:
wizardchen
2026-03-05 12:02:22 +08:00
committed by lyingbug
parent a1c0682aa3
commit 00bf0460cc
14 changed files with 193 additions and 5 deletions
+4
View File
@@ -45,6 +45,10 @@ export function copyKnowledgeBase(data: { source_id: string; target_id?: string
return post(`/api/v1/knowledge-bases/copy`, data);
}
export function togglePinKnowledgeBase(id: string) {
return put(`/api/v1/knowledge-bases/${id}/pin`);
}
// 知识文件 API(基于具体知识库)
// data.tag_id: 可选,指定知识所属的分类ID
export function uploadKnowledgeFile(kbId: string, data: { file: File; tag_id?: string; [key: string]: any } = { file: new File([], '') }, onProgress?: (progressEvent: any) => void) {