Skip to content

Commit

Permalink
YDA-5504: add filesize to checksum report
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Oct 19, 2023
1 parent a2dc04e commit d82663e
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions deposit/deposit.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ def download_report() -> Response:
ext = '.csv'
if response['status'] == 'ok':
for result in response["data"]:
output += f"{result['name']},{result['checksum']} \n"
output += f"{result['name']},{result['size']},{result['checksum']} \n"
else:
mime = 'text/plain'
ext = '.txt'
if response['status'] == 'ok':
for result in response["data"]:
output += f"{result['name']} {result['checksum']} \n"
output += f"{result['name']} {result['size']} {result['checksum']} \n"

return Response(
output,
Expand Down
3 changes: 2 additions & 1 deletion deposit/static/deposit/js/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,11 @@ $(function () {
{ coll: Yoda.basePath + folder }).then((data) => {
let table = '<table class="table table-striped"><tbody>'

table += '<thead><tr><th>Filename</th><th>Checksum</th></thead>'
table += '<thead><tr><th>Filename</th><th>Size</th><th>Checksum</th></tr></thead>'
$.each(data, function (index, obj) {
table += `<tr>
<td>${obj.name}</td>
<td>${obj.size}</td>
<td>${obj.checksum}</td>
</tr>`
})
Expand Down
3 changes: 1 addition & 2 deletions deposit/templates/deposit/data.html
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,7 @@ <h5 class="modal-title">
</div>
<div class="modal-body">
<p>
This overview shows files and their checksums.
These checksums can de used to verify data integrity.
This overview shows files and their sizes and checksums and can be used to verify data integrity.
The checksum algorithm used is <a href="https://en.wikipedia.org/wiki/SHA-2" target="_blank" title="SHA-256 checksum algorithm">SHA-256</a>.
</p>
<div id="checksumReport"></div>
Expand Down
4 changes: 2 additions & 2 deletions research/research.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ def download_report() -> Response:
ext = '.csv'
if response['status'] == 'ok':
for result in response["data"]:
output += f"{result['name']},{result['checksum']} \n"
output += f"{result['name']},{result['size']},{result['checksum']} \n"
else:
mime = 'text/plain'
ext = '.txt'
if response['status'] == 'ok':
for result in response["data"]:
output += f"{result['name']} {result['checksum']} \n"
output += f"{result['name']} {result['size']} {result['checksum']} \n"

return Response(
output,
Expand Down
3 changes: 2 additions & 1 deletion research/static/research/js/research.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,11 @@ $(function () {
{ coll: Yoda.basePath + folder }).then((data) => {
let table = '<table class="table table-striped"><tbody>'

table += '<thead><tr><th>Filename</th><th>Checksum</th></thead>'
table += '<thead><tr><th>Filename</th><th>Size</th><th>Checksum</th></tr></thead>'
$.each(data, function (index, obj) {
table += `<tr>
<td>${obj.name}</td>
<td>${obj.size}</td>
<td>${obj.checksum}</td>
</tr>`
})
Expand Down
3 changes: 1 addition & 2 deletions research/templates/research/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ <h5 class="modal-title">
</div>
<div class="modal-body">
<p>
This overview shows files and their checksums.
These checksums can de used to verify data integrity.
This overview shows files and their sizes and checksums and can be used to verify data integrity.
The checksum algorithm used is <a href="https://en.wikipedia.org/wiki/SHA-2" target="_blank" title="SHA-256 checksum algorithm">SHA-256</a>.
</p>
<div id="checksumReport"></div>
Expand Down
3 changes: 2 additions & 1 deletion vault/static/vault/js/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ $(function () {
{ coll: Yoda.basePath + folder }).then((data) => {
let table = '<table class="table table-striped"><tbody>'

table += '<thead><tr><th>Filename</th><th>Checksum</th></thead>'
table += '<thead><tr><th>Filename</th><th>Size</th><th>Checksum</th></tr></thead>'
$.each(data, function (index, obj) {
table += `<tr>
<td>${obj.name}</td>
<td>${obj.size}</td>
<td>${obj.checksum}</td>
</tr>`
})
Expand Down
3 changes: 1 addition & 2 deletions vault/templates/vault/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ <h5 class="modal-title">
</div>
<div class="modal-body">
<p>
This overview shows files and their checksums.
These checksums can de used to verify data integrity.
This overview shows files and their sizes and checksums and can be used to verify data integrity.
The checksum algorithm used is <a href="https://en.wikipedia.org/wiki/SHA-2" target="_blank" title="SHA-256 checksum algorithm">SHA-256</a>.
</p>
<div id="checksumReport"></div>
Expand Down
4 changes: 2 additions & 2 deletions vault/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ def download_report() -> Response:
ext = '.csv'
if response['status'] == 'ok':
for result in response["data"]:
output += f"{result['name']},{result['checksum']} \n"
output += f"{result['name']},{result['size']},{result['checksum']} \n"
else:
mime = 'text/plain'
ext = '.txt'
if response['status'] == 'ok':
for result in response["data"]:
output += f"{result['name']} {result['checksum']} \n"
output += f"{result['name']} {result['size']} {result['checksum']} \n"

return Response(
output,
Expand Down

0 comments on commit d82663e

Please sign in to comment.