Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
fba25ac
Feature: Added data source functionality
dcc123456 Nov 6, 2025
e07ec15
Merge branch 'main' of github.com:infiniflow/ragflow into feature/1103
dcc123456 Nov 6, 2025
ec1ff8e
Fix: Modify the data source log list interface
dcc123456 Nov 6, 2025
e894fc7
Fix: Improve some functional issues with the data source.
dcc123456 Nov 6, 2025
0b69fb6
Fix: Improve some functional issues with the data source.
dcc123456 Nov 6, 2025
45d753d
Merge branch 'main' of github.com:infiniflow/ragflow into feature/1103
dcc123456 Nov 6, 2025
57d07b1
Fix: Added data source rebuild functionality
dcc123456 Nov 7, 2025
3aae6db
Merge branch 'main' of github.com:infiniflow/ragflow into feature/1103
dcc123456 Nov 7, 2025
0aaeda5
Fix: Added some prompts and polling functionality to retrieve data so…
dcc123456 Nov 7, 2025
3cfef30
Merge branch 'main' of github.com:infiniflow/ragflow into feature/1022
dcc123456 Nov 7, 2025
9e9bf28
Feature: Added global variable functionality
dcc123456 Nov 7, 2025
7cd392f
Merge branch 'main' of github.com:infiniflow/ragflow into feature/1103
dcc123456 Nov 10, 2025
f5fec7b
Fix: Delete invalid code
dcc123456 Nov 10, 2025
1ab203a
Fix: Bugs fixes
dcc123456 Nov 10, 2025
a5206f2
Merge branch 'main' of github.com:infiniflow/ragflow into feature/1103
dcc123456 Nov 10, 2025
145cd02
Fix: Input component style
dcc123456 Nov 10, 2025
aa8ff52
Fix: Input component style
dcc123456 Nov 10, 2025
826e518
Fixes: Bugs fixed
dcc123456 Nov 10, 2025
1760c88
Merge branch 'main' of github.com:infiniflow/ragflow into feature/1103
dcc123456 Nov 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/src/interfaces/database/knowledge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface IConnector {
name: string;
status: RunningStatus;
source: DataSourceKey;
auto_parse?: '0' | '1';
}
// knowledge base
export interface IKnowledge {
Expand Down
1 change: 1 addition & 0 deletions web/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ export default {
reRankModelWaring: 'Re-rank model is very time consuming.',
},
knowledgeConfiguration: {
autoParse: 'Auto Parse',
rebuildTip:
'Re-downloads files from the linked data source and parses them again.',
baseInfo: 'Basic Info',
Expand Down
1 change: 1 addition & 0 deletions web/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export default {
theDocumentBeingParsedCannotBeDeleted: '正在解析的文档不能被删除',
},
knowledgeConfiguration: {
autoParse: '自动解析',
rebuildTip: '从所有已关联的数据源重新下载文件并再次解析。',
baseInfo: '基础信息',
gobalIndex: '全局索引',
Expand Down
22 changes: 20 additions & 2 deletions web/src/pages/agent/gobal-variable-sheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
DynamicForm,
DynamicFormRef,
FormFieldConfig,
FormFieldType,
} from '@/components/dynamic-form';
import { Button } from '@/components/ui/button';
import { Modal } from '@/components/ui/modal/modal';
Expand Down Expand Up @@ -112,6 +113,23 @@ export const GobalParamSheet = (props: IGobalParamModalProps) => {
};

const handleEditGobalVariable = (item: FieldValues) => {
fields.forEach((field) => {
if (field.name === 'value') {
switch (item.type) {
// [TypesWithArray.String]: FormFieldType.Textarea,
// [TypesWithArray.Number]: FormFieldType.Number,
// [TypesWithArray.Boolean]: FormFieldType.Checkbox,
case TypesWithArray.Boolean:
field.type = FormFieldType.Checkbox;
break;
case TypesWithArray.Number:
field.type = FormFieldType.Number;
break;
default:
field.type = FormFieldType.Textarea;
}
}
});
setDefaultValues(item);
showModal();
};
Expand All @@ -124,7 +142,7 @@ export const GobalParamSheet = (props: IGobalParamModalProps) => {
>
<SheetHeader className="p-5">
<SheetTitle className="flex items-center gap-2.5">
{t('flow.conversationVariable')}
{t('flow.gobalVariable')}
</SheetTitle>
</SheetHeader>

Expand Down Expand Up @@ -185,7 +203,7 @@ export const GobalParamSheet = (props: IGobalParamModalProps) => {
</div>
</SheetContent>
<Modal
title={t('flow.add') + t('flow.conversationVariable')}
title={t('flow.add') + t('flow.gobalVariable')}
open={visible}
onCancel={hideAddModal}
showfooter={false}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { IconFontFill } from '@/components/icon-font';
import { Button } from '@/components/ui/button';
import { Switch } from '@/components/ui/switch';
import {
Tooltip,
TooltipContent,
Expand All @@ -24,16 +25,25 @@ export interface ILinkDataSourceProps {
data?: IConnector[];
handleLinkOrEditSubmit?: (data: IDataSourceBase[] | undefined) => void;
unbindFunc?: (item: DataSourceItemProps) => void;
handleAutoParse?: (option: {
source_id: string;
isAutoParse: boolean;
}) => void;
}

interface DataSourceItemProps extends IDataSourceNodeProps {
openLinkModalFunc?: (open: boolean, data?: IDataSourceNodeProps) => void;
unbindFunc?: (item: DataSourceItemProps) => void;
handleAutoParse?: (option: {
source_id: string;
isAutoParse: boolean;
}) => void;
}

const DataSourceItem = (props: DataSourceItemProps) => {
const { t } = useTranslation();
const { id, name, icon, source, unbindFunc } = props;
const { id, name, icon, source, auto_parse, unbindFunc, handleAutoParse } =
props;

const { navigateToDataSourceDetail } = useNavigatePage();
const { handleRebuild } = useDataSourceRebuild();
Expand All @@ -50,7 +60,19 @@ const DataSourceItem = (props: DataSourceItemProps) => {
</div>
<div>{name}</div>
</div>
<div className="flex items-center">
<div className="flex items-center ">
<div className="items-center gap-1 hidden mr-5 group-hover:flex">
<div className="text-xs text-text-secondary">
{t('knowledgeConfiguration.autoParse')}
</div>
<Switch
checked={auto_parse === '1'}
onCheckedChange={(isAutoParse) => {
handleAutoParse?.({ source_id: id, isAutoParse });
}}
className="w-8 h-4"
/>
</div>
<Tooltip>
<TooltipTrigger>
<Button
Expand Down Expand Up @@ -105,7 +127,12 @@ const DataSourceItem = (props: DataSourceItemProps) => {
};

const LinkDataSource = (props: ILinkDataSourceProps) => {
const { data, handleLinkOrEditSubmit: submit, unbindFunc } = props;
const {
data,
handleLinkOrEditSubmit: submit,
unbindFunc,
handleAutoParse,
} = props;
const { t } = useTranslation();
const [openLinkModal, setOpenLinkModal] = useState(false);

Expand Down Expand Up @@ -176,6 +203,7 @@ const LinkDataSource = (props: ILinkDataSourceProps) => {
key={item.id}
openLinkModalFunc={openLinkModalFunc}
unbindFunc={unbindFunc}
handleAutoParse={handleAutoParse}
{...item}
/>
),
Expand Down
1 change: 1 addition & 0 deletions web/src/pages/dataset/dataset-setting/form-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const formSchema = z
name: z.string().optional(),
source: z.string().optional(),
ststus: z.string().optional(),
auto_parse: z.string().optional(),
}),
)
.optional(),
Expand Down
30 changes: 29 additions & 1 deletion web/src/pages/dataset/dataset-setting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Form } from '@/components/ui/form';
import { FormLayout } from '@/constants/form';
import { DocumentParserType } from '@/constants/knowledge';
import { PermissionRole } from '@/constants/permission';
import { IConnector } from '@/interfaces/database/knowledge';
import { DataSourceInfo } from '@/pages/user-setting/data-source/contant';
import { IDataSourceBase } from '@/pages/user-setting/data-source/interface';
import { zodResolver } from '@hookform/resolvers/zod';
Expand Down Expand Up @@ -149,11 +150,12 @@ export default function DatasetSettings() {
// }
// };

const handleLinkOrEditSubmit = (data: IDataSourceBase[] | undefined) => {
const handleLinkOrEditSubmit = (data: IConnector[] | undefined) => {
if (data) {
const connectors = data.map((connector) => {
return {
...connector,
auto_parse: connector.auto_parse === '0' ? '0' : '1',
icon:
DataSourceInfo[connector.source as keyof typeof DataSourceInfo]
?.icon || '',
Expand Down Expand Up @@ -208,6 +210,31 @@ export default function DatasetSettings() {
// form.setValue('pipeline_avatar', data.avatar || '');
}
};
const handleAutoParse = ({
source_id,
isAutoParse,
}: {
source_id: string;
isAutoParse: boolean;
}) => {
if (source_id) {
const connectors = sourceData?.map((connector) => {
if (connector.id === source_id) {
return {
...connector,
auto_parse: isAutoParse ? '1' : '0',
};
}
return connector;
});
console.log('🚀 ~ DatasetSettings ~ connectors:', connectors);
setSourceData(connectors as IDataSourceNodeProps[]);
form.setValue('connectors', connectors || []);
// form.setValue('pipeline_name', data.name || '');
// form.setValue('pipeline_avatar', data.avatar || '');
}
};

return (
<section className="p-5 h-full flex flex-col">
<TopTitle
Expand Down Expand Up @@ -269,6 +296,7 @@ export default function DatasetSettings() {
data={sourceData}
handleLinkOrEditSubmit={handleLinkOrEditSubmit}
unbindFunc={unbindFunc}
handleAutoParse={handleAutoParse}
/>
</MainContainer>
</div>
Expand Down
12 changes: 6 additions & 6 deletions web/src/pages/home/datasets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { CardSineLineContainer } from '@/components/card-singleline-container';
import { RenameDialog } from '@/components/rename-dialog';
import { HomeIcon } from '@/components/svg-icon';
import { CardSkeleton } from '@/components/ui/skeleton';
import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks';
import { useFetchNextKnowledgeListByPage } from '@/hooks/use-knowledge-request';
import { useTranslation } from 'react-i18next';
import { DatasetCard, SeeAllCard } from '../datasets/dataset-card';
import { DatasetCard } from '../datasets/dataset-card';
import { useRenameDataset } from '../datasets/use-rename-dataset';
import { SeeAllAppCard } from './application-card';

export function Datasets() {
const { t } = useTranslation();
Expand All @@ -18,6 +20,7 @@ export function Datasets() {
hideDatasetRenameModal,
showDatasetRenameModal,
} = useRenameDataset();
const { navigateToDatasetList } = useNavigatePage();

return (
<section>
Expand All @@ -26,13 +29,12 @@ export function Datasets() {
<HomeIcon name="datasets" width={'32'} />
{t('header.dataset')}
</h2>
<div className="flex gap-6">
<div className="">
{loading ? (
<div className="flex-1">
<CardSkeleton />
</div>
) : (
// <div className="grid gap-6 grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 3xl:grid-cols-7 max-h-[78vh] overflow-auto">
<CardSineLineContainer>
{kbs
?.slice(0, 6)
Expand All @@ -43,9 +45,7 @@ export function Datasets() {
showDatasetRenameModal={showDatasetRenameModal}
></DatasetCard>
))}
<div className="min-h-24">
<SeeAllCard></SeeAllCard>
</div>
{<SeeAllAppCard click={navigateToDatasetList}></SeeAllAppCard>}
</CardSineLineContainer>
// </div>
)}
Expand Down
5 changes: 2 additions & 3 deletions web/src/pages/login-next/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
import { Input } from '@/components/ui/input';
import { cn } from '@/lib/utils';
import { zodResolver } from '@hookform/resolvers/zod';
import { Eye, EyeOff } from 'lucide-react';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
import { BgSvg } from './bg';
Expand Down Expand Up @@ -247,7 +246,7 @@ const Login = () => {
}
{...field}
/>
<button
{/* <button
type="button"
className="absolute inset-y-0 right-0 pr-3 flex items-center"
onClick={() => setShowPassword(!showPassword)}
Expand All @@ -257,7 +256,7 @@ const Login = () => {
) : (
<Eye className="h-4 w-4 text-gray-500" />
)}
</button>
</button> */}
</div>
</FormControl>
<FormMessage />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Card, CardContent, CardHeader } from '@/components/ui/card';
import { PropsWithChildren } from 'react';

export const UserSettingHeader = ({
name,
description,
}: {
name: string;
description?: string;
}) => {
return (
<>
<header className="flex flex-col gap-1 justify-between items-start p-0">
<div className="text-2xl font-medium text-text-primary">{name}</div>
{description && (
<div className="text-sm text-text-secondary ">{description}</div>
)}
</header>
{/* <Separator className="border-border-button bg-border-button h-[0.5px]" /> */}
</>
);
};

export function Title({ children }: PropsWithChildren) {
return <span className="font-bold text-xl">{children}</span>;
}

type ProfileSettingWrapperCardProps = {
header: React.ReactNode;
} & PropsWithChildren;

export function ProfileSettingWrapperCard({
header,
children,
}: ProfileSettingWrapperCardProps) {
return (
<Card className="w-full border-border-button bg-transparent relative border-[0.5px]">
<CardHeader className="border-b-[0.5px] border-border-button p-5 ">
{header}
</CardHeader>
<CardContent className="p-5">{children}</CardContent>
</Card>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ export const DataSourceLogsTable = ({
))
) : (
<TableRow>
<TableCell colSpan={columns.length} className="h-24 text-center">
No results.
<TableCell colSpan={5} className="h-24 text-center">
{t('common.noData')}
</TableCell>
</TableRow>
)}
Expand Down
Loading