MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / getFileList

Function getFileList

frontend/src/hooks/useFileManager.ts:298–336  ·  view source on GitHub ↗
(throwErr = false, initPath?: string)

Source from the content-addressed store, hash-verified

296 };
297
298 const getFileList = async (throwErr = false, initPath?: string) => {
299 const { execute } = getFileListApi();
300 const thisTab = currentTabs.value.find((e) => e.key === activeTab.value);
301
302 try {
303 clearSelected();
304 let path;
305 if (initPath) {
306 path = initPath;
307 updateBreadcrumbs(initPath);
308 } else {
309 path = currentPath.value;
310 }
311 const res = await execute({
312 params: {
313 daemonId: daemonId || "",
314 uuid: instanceId || "",
315 page: operationForm.value.current - 1,
316 page_size: operationForm.value.pageSize,
317 file_name: operationForm.value.name,
318 target: path
319 }
320 });
321 dataSource.value = res.value?.items || [];
322 operationForm.value.total = res.value?.total || 0;
323 if (!thisTab) {
324 initDefaultTab(path);
325 }
326 } catch (error: any) {
327 // if (thisTab) {
328 // handleRemoveTab(thisTab.key);
329 // } else {
330 // initDefaultTab();
331 // }
332
333 if (throwErr) throw error;
334 return reportErrorMsg(error.message);
335 }
336 };
337
338 const reloadList = async () => {
339 await getFileList();

Callers 15

handleChangeTabFunction · 0.85
reloadListFunction · 0.85
touchFileFunction · 0.85
pasteFunction · 0.85
resetNameFunction · 0.85
useDeleteFileApiFunction · 0.85
zipFileFunction · 0.85
unzipFileFunction · 0.85
rowClickTableFunction · 0.85
downloadFromUrlFunction · 0.85
stopDownloadFileFromUrlFunction · 0.85
handleChangeDirFunction · 0.85

Calls 5

reportErrorMsgFunction · 0.90
clearSelectedFunction · 0.85
updateBreadcrumbsFunction · 0.85
executeFunction · 0.85
initDefaultTabFunction · 0.85

Tested by

no test coverage detected