aboutsummaryrefslogtreecommitdiff
path: root/src/js/utils.js
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2025-07-24 22:11:45 +0300
committerkaotisk <kaotisk@arching-kaos.org>2025-07-24 22:11:45 +0300
commitf0b67be017c47517116fa2707f915091e9a9cddc (patch)
treed6c0aaff5b05e412aaf3370c7ffc55af39528e05 /src/js/utils.js
parentd86e492c4d1524b7b0f811432548e7086c17bf20 (diff)
downloadarching-kaos-web-ui-f0b67be017c47517116fa2707f915091e9a9cddc.tar.gz
arching-kaos-web-ui-f0b67be017c47517116fa2707f915091e9a9cddc.tar.bz2
arching-kaos-web-ui-f0b67be017c47517116fa2707f915091e9a9cddc.zip
[fs] Now AKFS downloads are offered with their namesHEADorigin/masterorigin/HEADmaster
Diffstat (limited to 'src/js/utils.js')
-rw-r--r--src/js/utils.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/js/utils.js b/src/js/utils.js
index 6a355a8..a5f34dc 100644
--- a/src/js/utils.js
+++ b/src/js/utils.js
@@ -27,10 +27,10 @@ export function debugLog(message)
if (showDebug) console.log(message);
}
-export function offerDownloadableData(data)
+export function offerDownloadableData(data, filename)
{
var link = document.createElement('a');
- link.download = 'data';
+ link.download = filename === undefined ? 'data': filename;
var blob = new Blob([data]); // , {type: 'text/plain'}
link.href = window.URL.createObjectURL(blob);
link.click();
@@ -46,6 +46,6 @@ export function decodeBase64ToHex(base64String) {
// Convert the byte array to a hex string representation
return Array.from(byteArray)
.map(byte => byte.toString(16).padStart(2, '0')) // Convert to hex and pad with zeros
- .join(''); // Join with spaces for readability
+ .join('');
}
// @license-end