mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-19 12:06:42 +08:00
### What problem does this PR solve? fix: #209 after saving the knowledge base configuration, jump to the dataset page feat: translate ConfigurationForm feat: translate KnowledgeTesting feat: translate document list page feat: translate knowledge list page Issue link: #209 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -92,9 +92,9 @@ export const useShowDeleteConfirm = () => {
|
||||
title: t('common.deleteModalTitle'),
|
||||
icon: <ExclamationCircleFilled />,
|
||||
// content: 'Some descriptions',
|
||||
okText: 'Yes',
|
||||
okText: t('common.ok'),
|
||||
okType: 'danger',
|
||||
cancelText: 'No',
|
||||
cancelText: t('common.cancel'),
|
||||
async onOk() {
|
||||
try {
|
||||
const ret = await onOk?.();
|
||||
@ -115,3 +115,7 @@ export const useShowDeleteConfirm = () => {
|
||||
|
||||
return showDeleteConfirm;
|
||||
};
|
||||
|
||||
export const useTranslate = (keyPrefix: string) => {
|
||||
return useTranslation('translation', { keyPrefix });
|
||||
};
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
import { KnowledgeSearchParams } from '@/constants/knowledge';
|
||||
import {
|
||||
KnowledgeRouteKey,
|
||||
KnowledgeSearchParams,
|
||||
} from '@/constants/knowledge';
|
||||
import { useCallback } from 'react';
|
||||
import { useLocation, useNavigate, useSearchParams } from 'umi';
|
||||
|
||||
@ -42,3 +45,12 @@ export const useNavigateWithFromState = () => {
|
||||
[navigate],
|
||||
);
|
||||
};
|
||||
|
||||
export const useNavigateToDataset = () => {
|
||||
const navigate = useNavigate();
|
||||
const { knowledgeId } = useGetKnowledgeSearchParams();
|
||||
|
||||
return useCallback(() => {
|
||||
navigate(`/knowledge/${KnowledgeRouteKey.Dataset}?id=${knowledgeId}`);
|
||||
}, [knowledgeId, navigate]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user