mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-18 19:46:44 +08:00
### What problem does this PR solve? feat(dataset): Added data pipeline configuration functionality #9869 - Added a data pipeline selection component to link data pipelines with knowledge bases - Added file filtering functionality, supporting custom file filtering rules - Optimized the configuration interface layout, adjusting style and spacing - Introduced new icons and buttons to enhance the user experience ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
14 lines
329 B
TypeScript
14 lines
329 B
TypeScript
export function buildSelectOptions(
|
|
list: Array<any>,
|
|
keyName?: string,
|
|
valueName?: string,
|
|
) {
|
|
if (!Array.isArray(list) || !list.length) {
|
|
return [];
|
|
}
|
|
if (keyName && valueName) {
|
|
return list.map((x) => ({ label: x[valueName], value: x[keyName] }));
|
|
}
|
|
return list.map((x) => ({ label: x, value: x }));
|
|
}
|