mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-01 05:23:47 +08:00
Revert "Refactor dataset / kb API to RESTFul style" (#13614)
Reverts infiniflow/ragflow#13263
This commit is contained in:
@@ -23,7 +23,7 @@ export function DatasetCard({
|
||||
<HomeCard
|
||||
data={{
|
||||
...dataset,
|
||||
description: `${dataset.document_count} ${t('knowledgeDetails.files')}`,
|
||||
description: `${dataset.doc_num} ${t('knowledgeDetails.files')}`,
|
||||
}}
|
||||
moreDropdown={
|
||||
<DatasetDropdown
|
||||
|
||||
@@ -46,20 +46,20 @@ export function InputForm({ onOk }: IModalProps<any>) {
|
||||
})
|
||||
.trim(),
|
||||
parseType: z.number().optional(),
|
||||
embedding_model: z
|
||||
embd_id: z
|
||||
.string()
|
||||
.min(1, {
|
||||
message: t('knowledgeConfiguration.embeddingModelPlaceholder'),
|
||||
})
|
||||
.trim(),
|
||||
chunk_method: z.string().optional(),
|
||||
parser_id: z.string().optional(),
|
||||
pipeline_id: z.string().optional(),
|
||||
})
|
||||
.superRefine((data, ctx) => {
|
||||
// When parseType === 1, chunk_method is required
|
||||
// When parseType === 1, parser_id is required
|
||||
if (
|
||||
data.parseType === 1 &&
|
||||
(!data.chunk_method || data.chunk_method.trim() === '')
|
||||
(!data.parser_id || data.parser_id.trim() === '')
|
||||
) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
@@ -82,8 +82,8 @@ export function InputForm({ onOk }: IModalProps<any>) {
|
||||
defaultValues: {
|
||||
name: '',
|
||||
parseType: 1,
|
||||
chunk_method: '',
|
||||
embedding_model: tenantInfo?.embd_id,
|
||||
parser_id: '',
|
||||
embd_id: tenantInfo?.embd_id,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -16,14 +16,8 @@ export const useSearchKnowledge = () => {
|
||||
|
||||
export interface Iknowledge {
|
||||
name: string;
|
||||
embedding_model?: string;
|
||||
chunk_method?: string;
|
||||
parseType?: number;
|
||||
pipeline_id?: string | null;
|
||||
ext?: {
|
||||
language?: string;
|
||||
[key: string]: any;
|
||||
};
|
||||
embd_id: string;
|
||||
parser_id: string;
|
||||
}
|
||||
export const useSaveKnowledge = () => {
|
||||
const { visible: visible, hideModal, showModal } = useSetModalState();
|
||||
@@ -36,7 +30,7 @@ export const useSaveKnowledge = () => {
|
||||
|
||||
if (ret?.code === 0) {
|
||||
hideModal();
|
||||
navigateToDataset(ret.data.id)();
|
||||
navigateToDataset(ret.data.kb_id)();
|
||||
}
|
||||
},
|
||||
[createKnowledge, hideModal, navigateToDataset],
|
||||
|
||||
@@ -30,7 +30,7 @@ export default function Datasets() {
|
||||
|
||||
const {
|
||||
kbs,
|
||||
total_datasets,
|
||||
total,
|
||||
pagination,
|
||||
setPagination,
|
||||
handleInputChange,
|
||||
@@ -107,7 +107,7 @@ export default function Datasets() {
|
||||
<footer className="mt-4 px-5 pb-5">
|
||||
<RAGFlowPagination
|
||||
{...pick(pagination, 'current', 'pageSize')}
|
||||
total={total_datasets}
|
||||
total={total}
|
||||
onChange={handlePageChange}
|
||||
/>
|
||||
</footer>
|
||||
|
||||
Reference in New Issue
Block a user