mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-28 04:42:00 +08:00
### What problem does this PR solve? Feat: Add background color to GraphRag configuration #4980 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
b4ad565df6
commit
f9fe6ac642
@ -1,5 +1,5 @@
|
|||||||
import { useTranslate } from '@/hooks/common-hooks';
|
import { useTranslate } from '@/hooks/common-hooks';
|
||||||
import { Divider, Form, Select, Switch } from 'antd';
|
import { Form, Select, Switch } from 'antd';
|
||||||
import { upperFirst } from 'lodash';
|
import { upperFirst } from 'lodash';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
import EntityTypesItem from '../entity-types-item';
|
import EntityTypesItem from '../entity-types-item';
|
||||||
@ -50,8 +50,7 @@ const GraphRagItems = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="border p-2 rounded-lg bg-slate-50 dark:bg-gray-600">
|
||||||
<Divider></Divider>
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={['parser_config', 'graphrag', 'use_graphrag']}
|
name={['parser_config', 'graphrag', 'use_graphrag']}
|
||||||
label={t('useGraphRag')}
|
label={t('useGraphRag')}
|
||||||
@ -113,7 +112,7 @@ const GraphRagItems = () => {
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import {
|
|||||||
ReactFlow,
|
ReactFlow,
|
||||||
} from '@xyflow/react';
|
} from '@xyflow/react';
|
||||||
import '@xyflow/react/dist/style.css';
|
import '@xyflow/react/dist/style.css';
|
||||||
import { FolderInput, FolderOutput } from 'lucide-react';
|
import { Book, FolderInput, FolderOutput } from 'lucide-react';
|
||||||
import ChatDrawer from '../chat/drawer';
|
import ChatDrawer from '../chat/drawer';
|
||||||
import FormDrawer from '../flow-drawer';
|
import FormDrawer from '../flow-drawer';
|
||||||
import {
|
import {
|
||||||
@ -23,6 +23,7 @@ import {
|
|||||||
} from '../hooks';
|
} from '../hooks';
|
||||||
import { useBeforeDelete } from '../hooks/use-before-delete';
|
import { useBeforeDelete } from '../hooks/use-before-delete';
|
||||||
import { useHandleExportOrImportJsonFile } from '../hooks/use-export-json';
|
import { useHandleExportOrImportJsonFile } from '../hooks/use-export-json';
|
||||||
|
import { useOpenDocument } from '../hooks/use-open-document';
|
||||||
import { useShowDrawer } from '../hooks/use-show-drawer';
|
import { useShowDrawer } from '../hooks/use-show-drawer';
|
||||||
import JsonUploadModal from '../json-upload-modal';
|
import JsonUploadModal from '../json-upload-modal';
|
||||||
import RunDrawer from '../run-drawer';
|
import RunDrawer from '../run-drawer';
|
||||||
@ -97,6 +98,8 @@ function FlowCanvas({ drawerVisible, hideDrawer }: IProps) {
|
|||||||
hideFileUploadModal,
|
hideFileUploadModal,
|
||||||
} = useHandleExportOrImportJsonFile();
|
} = useHandleExportOrImportJsonFile();
|
||||||
|
|
||||||
|
const openDocument = useOpenDocument();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
onNodeClick,
|
onNodeClick,
|
||||||
onPaneClick,
|
onPaneClick,
|
||||||
@ -189,6 +192,14 @@ function FlowCanvas({ drawerVisible, hideDrawer }: IProps) {
|
|||||||
<TooltipContent>Export</TooltipContent>
|
<TooltipContent>Export</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</ControlButton>
|
</ControlButton>
|
||||||
|
<ControlButton onClick={openDocument}>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger asChild>
|
||||||
|
<Book className={controlIconClassname} />
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent>Document</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</ControlButton>
|
||||||
</Controls>
|
</Controls>
|
||||||
</ReactFlow>
|
</ReactFlow>
|
||||||
{formDrawerVisible && (
|
{formDrawerVisible && (
|
||||||
|
12
web/src/pages/flow/hooks/use-open-document.ts
Normal file
12
web/src/pages/flow/hooks/use-open-document.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
|
export function useOpenDocument() {
|
||||||
|
const openDocument = useCallback(() => {
|
||||||
|
window.open(
|
||||||
|
'https://ragflow.io/docs/dev/category/agent-components',
|
||||||
|
'_blank',
|
||||||
|
);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return openDocument;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user