Replace pako with gzip-js
parent
35962bd05e
commit
e8a5b2c6b5
|
@ -3577,6 +3577,11 @@
|
||||||
"parse-json": "^4.0.0"
|
"parse-json": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"crc32": {
|
||||||
|
"version": "0.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/crc32/-/crc32-0.2.2.tgz",
|
||||||
|
"integrity": "sha1-etIg1v/c0Rn5/BJ6d3LKzqOQpLo="
|
||||||
|
},
|
||||||
"create-ecdh": {
|
"create-ecdh": {
|
||||||
"version": "4.0.3",
|
"version": "4.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
|
||||||
|
@ -4217,6 +4222,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"deflate-js": {
|
||||||
|
"version": "0.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/deflate-js/-/deflate-js-0.2.3.tgz",
|
||||||
|
"integrity": "sha1-+Fq7WOvFFRowYUdHPVfD5PfkQms="
|
||||||
|
},
|
||||||
"del": {
|
"del": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz",
|
||||||
|
@ -5944,6 +5954,15 @@
|
||||||
"unicode-trie": "^0.3.1"
|
"unicode-trie": "^0.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"gzip-js": {
|
||||||
|
"version": "0.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/gzip-js/-/gzip-js-0.3.2.tgz",
|
||||||
|
"integrity": "sha1-IxF+/usozzhSSN7/Df+tiUg22Ws=",
|
||||||
|
"requires": {
|
||||||
|
"crc32": ">= 0.2.2",
|
||||||
|
"deflate-js": ">= 0.2.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"gzip-size": {
|
"gzip-size": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz",
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
"do-bulma": "git+https://github.com/do-community/do-bulma.git",
|
"do-bulma": "git+https://github.com/do-community/do-bulma.git",
|
||||||
"do-vue": "git+https://github.com/do-community/do-vue.git",
|
"do-vue": "git+https://github.com/do-community/do-vue.git",
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"pako": "^1.0.11",
|
"gzip-js": "^0.3.2",
|
||||||
"pretty-checkbox-vue": "^1.1.9",
|
"pretty-checkbox-vue": "^1.1.9",
|
||||||
"prismjs": "^1.20.0",
|
"prismjs": "^1.20.0",
|
||||||
"qs": "^6.9.4",
|
"qs": "^6.9.4",
|
||||||
|
|
|
@ -62,7 +62,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tar from 'tarts';
|
import tar from 'tarts';
|
||||||
import { gzip } from 'pako';
|
import { zip as gzip } from 'gzip-js';
|
||||||
import ClipboardJS from 'clipboard';
|
import ClipboardJS from 'clipboard';
|
||||||
import i18n from '../i18n';
|
import i18n from '../i18n';
|
||||||
import * as Sections from './setup_sections';
|
import * as Sections from './setup_sections';
|
||||||
|
@ -130,14 +130,14 @@ THE SOFTWARE.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return gzip(tar(data));
|
return gzip(tar(data), { level: 9 });
|
||||||
},
|
},
|
||||||
downloadTar() {
|
downloadTar() {
|
||||||
// Get the config files as a compressed tar
|
// Get the config files as a compressed tar
|
||||||
const contents = this.tarContents();
|
const contents = this.tarContents();
|
||||||
|
|
||||||
// Convert it to a blob and download
|
// Convert it to a blob and download
|
||||||
const blob = new Blob([ contents ], { type: 'application/tar+gzip' });
|
const blob = new Blob([ Uint8Array.from(contents) ], { type: 'application/tar+gzip' });
|
||||||
const link = document.createElement('a');
|
const link = document.createElement('a');
|
||||||
link.href = window.URL.createObjectURL(blob);
|
link.href = window.URL.createObjectURL(blob);
|
||||||
link.download = this.tarName;
|
link.download = this.tarName;
|
||||||
|
|
Loading…
Reference in New Issue