Procházet zdrojové kódy

Merge pull request #763 from smiclea/fix-zip-compression

Fix zipped files not being compressed
Daniel Vincze před 3 roky
rodič
revize
9d9c455be0
2 změnil soubory, kde provedl 12 přidání a 3 odebrání
  1. 4 1
      src/stores/EndpointStore.ts
  2. 8 2
      src/stores/LogStore.ts

+ 4 - 1
src/stores/EndpointStore.ts

@@ -223,7 +223,10 @@ class EndpointStore {
       })
     );
 
-    const content = await zip.generateAsync({ type: "blob" });
+    const content = await zip.generateAsync({
+      type: "blob",
+      compression: "DEFLATE",
+    });
     saveAs(content, "coriolis-endpoints.zip");
   }
 

+ 8 - 2
src/stores/LogStore.ts

@@ -104,7 +104,10 @@ class LogStore {
       zip.file(`${response.name}.log`, response.content.data);
     });
     await downloadDiagnosticsIntoZip(zip);
-    const zipContent = await zip.generateAsync({ type: "blob" });
+    const zipContent = await zip.generateAsync({
+      type: "blob",
+      compression: "DEFLATE",
+    });
     saveAs(zipContent, "logs.zip");
     runInAction(() => {
       this.downloadingAllLogs = false;
@@ -125,7 +128,10 @@ class LogStore {
     this.generatingDiagnostics = true;
     const zip = new JSZip();
     await downloadDiagnosticsIntoZip(zip);
-    const zipContent = await zip.generateAsync({ type: "blob" });
+    const zipContent = await zip.generateAsync({
+      type: "blob",
+      compression: "DEFLATE",
+    });
     saveAs(zipContent, "diagnostics.zip");
     runInAction(() => {
       this.generatingDiagnostics = false;