mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-31 23:55:06 +08:00
Feature/1217 (#12087)
### What problem does this PR solve? feature: Complete metadata functionality ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -204,7 +204,8 @@ export const ManageValuesModal = (props: IManageValuesProps) => {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{metaData.restrictDefinedValues && (
|
||||
{((metaData.restrictDefinedValues && isShowValueSwitch) ||
|
||||
!isShowValueSwitch) && (
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="flex justify-between items-center">
|
||||
<div>{t('knowledgeDetails.metadata.values')}</div>
|
||||
|
||||
@ -216,12 +216,6 @@ const Generate: React.FC<GenerateProps> = (props) => {
|
||||
? graphRunData
|
||||
: raptorRunData
|
||||
) as ITraceInfo;
|
||||
console.log(
|
||||
name,
|
||||
'data',
|
||||
data,
|
||||
!data || (!data.progress && data.progress !== 0),
|
||||
);
|
||||
return (
|
||||
<div key={name}>
|
||||
<MenuItem
|
||||
|
||||
@ -25,12 +25,33 @@ export function useSelectDatasetFilters() {
|
||||
}));
|
||||
}
|
||||
}, [filter.run_status, t]);
|
||||
const metaDataList = useMemo(() => {
|
||||
if (filter.metadata) {
|
||||
return Object.keys(filter.metadata).map((x) => ({
|
||||
id: x.toString(),
|
||||
field: x.toString(),
|
||||
label: x.toString(),
|
||||
list: Object.keys(filter.metadata[x]).map((y) => ({
|
||||
id: y.toString(),
|
||||
field: y.toString(),
|
||||
label: y.toString(),
|
||||
value: [y],
|
||||
count: filter.metadata[x][y],
|
||||
})),
|
||||
count: Object.keys(filter.metadata[x]).reduce(
|
||||
(acc, cur) => acc + filter.metadata[x][cur],
|
||||
0,
|
||||
),
|
||||
}));
|
||||
}
|
||||
}, [filter.metadata]);
|
||||
const filters: FilterCollection[] = useMemo(() => {
|
||||
return [
|
||||
{ field: 'type', label: 'File Type', list: fileTypes },
|
||||
{ field: 'run', label: 'Status', list: fileStatus },
|
||||
{ field: 'metadata', label: 'metadata', list: metaDataList },
|
||||
] as FilterCollection[];
|
||||
}, [fileStatus, fileTypes]);
|
||||
}, [fileStatus, fileTypes, metaDataList]);
|
||||
|
||||
return { filters, onOpenChange };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user