From ea56efae47283e306e22b9bfb77854383fdc2ad5 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Tue, 21 Mar 2023 15:39:31 +0000 Subject: [PATCH] Added Download pane --- Gruntfile.js | 18 +++++++++- src/web/html/index.html | 76 ++++++++++++++++++++++++++++++----------- src/web/static/ga.html | 16 +++------ 3 files changed, 78 insertions(+), 32 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 71055b24..943fae48 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -29,7 +29,7 @@ module.exports = function (grunt) { "Creates a production-ready build. Use the --msg flag to add a compile message.", [ "eslint", "clean:prod", "clean:config", "exec:generateConfig", "findModules", "webpack:web", - "copy:standalone", "zip:standalone", "clean:standalone", "chmod" + "copy:standalone", "zip:standalone", "clean:standalone", "exec:calcDownloadHash", "chmod" ]); grunt.registerTask("node", @@ -323,6 +323,22 @@ module.exports = function (grunt) { } }, exec: { + calcDownloadHash: { + command: function () { + switch (process.platform) { + case "darwin": + return chainCommands([ + `shasum -a 256 build/prod/CyberChef_v${pkg.version}.zip | awk '{print $1;}' > build/prod/sha256digest.txt`, + `sed -i '' -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html` + ]); + default: + return chainCommands([ + `sha256sum build/prod/CyberChef_v${pkg.version}.zip | awk '{print $1;}' > build/prod/sha256digest.txt`, + `sed -i -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html` + ]); + } + }, + }, repoSize: { command: chainCommands([ "git ls-files | wc -l | xargs printf '\n%b\ttracked files\n'", diff --git a/src/web/html/index.html b/src/web/html/index.html index c3b780b5..97d83c1e 100755 --- a/src/web/html/index.html +++ b/src/web/html/index.html @@ -146,7 +146,7 @@
- - + + + + + + diff --git a/src/web/static/ga.html b/src/web/static/ga.html index e5f8db82..d285cdf9 100755 --- a/src/web/static/ga.html +++ b/src/web/static/ga.html @@ -1,18 +1,12 @@ +