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

Function unzipFile

frontend/src/hooks/useFileManager.ts:509–538  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

507 };
508
509 const unzipFile = async (name: string) => {
510 const dirname = await openDialog(t("TXT_CODE_7669fd3f"), "", "", "unzip");
511 const { execute } = compressFileApi();
512 const loadingDialog = await openLoadingDialog(
513 t("TXT_CODE_b3825da"),
514 t("TXT_CODE_b82225c3"),
515 t("TXT_CODE_6f038f25")
516 );
517 try {
518 await execute({
519 params: {
520 uuid: instanceId || "",
521 daemonId: daemonId || ""
522 },
523 data: {
524 type: 2,
525 code: dialog.value.code,
526 source: currentPath.value + name,
527 targets: dialog.value.unzipmode == "0" ? currentPath.value : currentPath.value + dirname
528 }
529 });
530 message.success(t("TXT_CODE_c3a933d3"));
531 await getFileList();
532 } catch (error: any) {
533 message.error(t("TXT_CODE_26d7316f"));
534 reportErrorMsg(error.message);
535 } finally {
536 loadingDialog.cancel();
537 }
538 };
539
540 const spinning = ref(false);
541

Callers

nothing calls this directly

Calls 7

openLoadingDialogFunction · 0.90
reportErrorMsgFunction · 0.90
executeFunction · 0.85
getFileListFunction · 0.85
errorMethod · 0.80
cancelMethod · 0.80
openDialogFunction · 0.70

Tested by

no test coverage detected