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

Function zipFile

frontend/src/hooks/useFileManager.ts:476–507  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

474 };
475
476 const zipFile = async () => {
477 if (!selectionData.value || selectionData.value.length === 0)
478 return reportErrorMsg(t("TXT_CODE_b152cd75"));
479 const filename = await openDialog(t("TXT_CODE_f8a15a94"), t("TXT_CODE_366bad15"), "", "zip");
480 const { execute } = compressFileApi();
481 const loadingDialog = await openLoadingDialog(
482 t("TXT_CODE_b3825da"),
483 t("TXT_CODE_ba027d6c"),
484 t("TXT_CODE_e1070b52")
485 );
486 try {
487 await execute({
488 params: {
489 uuid: instanceId || "",
490 daemonId: daemonId || ""
491 },
492 data: {
493 type: 1,
494 code: "utf-8",
495 source: currentPath.value + filename + ".zip",
496 targets: selectionData.value.map((e) => currentPath.value + e.name)
497 }
498 });
499 message.success(t("TXT_CODE_c3a933d3"));
500 await getFileList();
501 } catch (error: any) {
502 message.error(t("TXT_CODE_dba9bf61"));
503 reportErrorMsg(error.message);
504 } finally {
505 loadingDialog.cancel();
506 }
507 };
508
509 const unzipFile = async (name: string) => {
510 const dirname = await openDialog(t("TXT_CODE_7669fd3f"), "", "", "unzip");

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected