MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / EvalDatasets

Function EvalDatasets

packages/ui/src/views/datasets/index.jsx:54–366  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52// ==============================|| Datasets ||============================== //
53
54const EvalDatasets = () => {
55 const navigate = useNavigate()
56 const theme = useTheme()
57 const { confirm } = useConfirm()
58 const { error } = useError()
59
60 const customization = useSelector((state) => state.customization)
61
62 useNotifier()
63 const enqueueSnackbar = (...args) => dispatch(enqueueSnackbarAction(...args))
64 const closeSnackbar = (...args) => dispatch(closeSnackbarAction(...args))
65
66 const [search, setSearch] = useState('')
67 const dispatch = useDispatch()
68 const [isLoading, setLoading] = useState(true)
69 const [datasets, setDatasets] = useState([])
70 const [showDatasetDialog, setShowDatasetDialog] = useState(false)
71 const [datasetDialogProps, setDatasetDialogProps] = useState({})
72 const getAllDatasets = useApi(datasetsApi.getAllDatasets)
73
74 /* Table Pagination */
75 const [currentPage, setCurrentPage] = useState(1)
76 const [pageLimit, setPageLimit] = useState(DEFAULT_ITEMS_PER_PAGE)
77 const [total, setTotal] = useState(0)
78 const onChange = (page, pageLimit) => {
79 setCurrentPage(page)
80 setPageLimit(pageLimit)
81 refresh(page, pageLimit)
82 }
83
84 const refresh = (page, limit) => {
85 setLoading(true)
86 const params = {
87 page: page || currentPage,
88 limit: limit || pageLimit
89 }
90 getAllDatasets.request(params)
91 }
92
93 const goToRows = (selectedDataset) => {
94 navigate(`/dataset_rows/${selectedDataset.id}?page=1&limit=10`)
95 }
96
97 const onSearchChange = (event) => {
98 setSearch(event.target.value)
99 }
100
101 const addNew = () => {
102 const dialogProp = {
103 type: 'ADD',
104 cancelButtonName: 'Cancel',
105 confirmButtonName: 'Add',
106 data: {}
107 }
108 setDatasetDialogProps(dialogProp)
109 setShowDatasetDialog(true)
110 }
111

Callers

nothing calls this directly

Calls 8

useErrorFunction · 0.90
truncateStringFunction · 0.90
useConfirmFunction · 0.85
useNotifierFunction · 0.85
goToRowsFunction · 0.85
refreshFunction · 0.70
editFunction · 0.70
deleteDatasetFunction · 0.70

Tested by

no test coverage detected