File tree Expand file tree Collapse file tree 10 files changed +116
-27
lines changed
Expand file tree Collapse file tree 10 files changed +116
-27
lines changed Original file line number Diff line number Diff line change @@ -136,16 +136,16 @@ def download_report() -> Response:
136136 writer = csv .writer (output_io , quoting = csv .QUOTE_MINIMAL )
137137 writer .writerow (["filename" , "size" , "checksum" ])
138138 if response ['status' ] == 'ok' :
139- for result in response ["data" ]:
140- writer .writerow ([result ['name' ], result ['size ' ], result ['checksum' ]])
139+ for result in response ["data" ][ "manifest" ] :
140+ writer .writerow ([result ['name' ], result ['human_readable_size ' ], result ['checksum' ]])
141141 output = output_io .getvalue ()
142142 else :
143143 mime = 'text/plain'
144144 ext = '.txt'
145145 lines = []
146146 if response ['status' ] == 'ok' :
147- for result in response ["data" ]:
148- lines .append (f"{ result ['name' ]} { result ['size ' ]} { result ['checksum' ]} " )
147+ for result in response ["data" ][ "manifest" ] :
148+ lines .append (f"{ result ['name' ]} { result ['human_readable_size ' ]} { result ['checksum' ]} " )
149149 output = "\n " .join (lines )
150150
151151 return Response (
Original file line number Diff line number Diff line change @@ -169,15 +169,18 @@ $(function () {
169169
170170 Yoda . call ( 'research_manifest' ,
171171 { coll : Yoda . basePath + folder } ) . then ( ( data ) => {
172- let table = '<table class="table table-striped"><tbody>'
172+ document . getElementById ( 'number-of-files' ) . textContent = data . files
173+ document . getElementById ( 'total-size' ) . textContent = data . size
174+ document . getElementById ( 'number-of-checksums' ) . textContent = `${ data . checksums } / ${ data . files } `
173175
176+ let table = '<table class="table table-striped"><tbody>'
174177 table += '<thead><tr><th>Filename</th><th>Size</th><th>Checksum</th></tr></thead>'
175- if ( data . length > 0 ) {
176- $ . each ( data , function ( index , obj ) {
178+ if ( data . manifest . length > 0 ) {
179+ $ . each ( data . manifest , function ( index , obj ) {
177180 table += `<tr>
178181 <td>${ obj . name } </td>
179- <td>${ obj . size } </td>
180- <td>${ obj . checksum } </td>
182+ <td>${ obj . human_readable_size } </td>
183+ <td><pre> ${ obj . checksum } </pre> </td>
181184 </tr>`
182185 } )
183186 if ( downloadChecksumReportTextTooltip ) {
Original file line number Diff line number Diff line change @@ -389,6 +389,32 @@ <h5 class="modal-title">
389389 This overview shows files and their sizes and checksums and can be used to verify data integrity.
390390 The checksum algorithm used is < a href ="https://en.wikipedia.org/wiki/SHA-2 " target ="_blank " title ="SHA-256 checksum algorithm "> SHA-256</ a > .
391391 </ p >
392+ < div class ="row ">
393+ < div class ="col ">
394+ < div class ="card ">
395+ < div class ="card-body ">
396+ < h5 class ="card-title "> < i class ="fa-solid fa-file " aria-hidden ="true "> </ i > Number of files</ h5 >
397+ < p id ="number-of-files " class ="card-text "> </ p >
398+ </ div >
399+ </ div >
400+ </ div >
401+ < div class ="col ">
402+ < div class ="card ">
403+ < div class ="card-body ">
404+ < h5 class ="card-title "> < i class ="fa-solid fa-database " aria-hidden ="true "> </ i > Total size</ h5 >
405+ < p id ="total-size " class ="card-text "> </ p >
406+ </ div >
407+ </ div >
408+ </ div >
409+ < div class ="col ">
410+ < div class ="card ">
411+ < div class ="card-body ">
412+ < h5 class ="card-title "> < i class ="fa-solid fa-check " aria-hidden ="true "> </ i > Checksums generated</ h5 >
413+ < p id ="number-of-checksums " class ="card-text "> </ p >
414+ </ div >
415+ </ div >
416+ </ div >
417+ </ div >
392418 < div id ="checksumReport "> </ div >
393419 </ div >
394420 < div class ="modal-footer ">
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22from __future__ import annotations
33
4- __copyright__ = 'Copyright (c) 2021-2024 , Utrecht University'
4+ __copyright__ = 'Copyright (c) 2021-2025 , Utrecht University'
55__license__ = 'GPLv3, see LICENSE'
66
77import csv
@@ -316,16 +316,16 @@ def download_report() -> Response:
316316 writer = csv .writer (output_io , quoting = csv .QUOTE_MINIMAL )
317317 writer .writerow (["filename" , "size" , "checksum" ])
318318 if response ['status' ] == 'ok' :
319- for result in response ["data" ]:
320- writer .writerow ([result ['name' ], result ['size ' ], result ['checksum' ]])
319+ for result in response ["data" ][ "manifest" ] :
320+ writer .writerow ([result ['name' ], result ['human_readable_size ' ], result ['checksum' ]])
321321 output = output_io .getvalue ()
322322 else :
323323 mime = 'text/plain'
324324 ext = '.txt'
325325 lines = []
326326 if response ['status' ] == 'ok' :
327- for result in response ["data" ]:
328- lines .append (f"{ result ['name' ]} { result ['size ' ]} { result ['checksum' ]} " )
327+ for result in response ["data" ][ "manifest" ] :
328+ lines .append (f"{ result ['name' ]} { result ['human_readable_size ' ]} { result ['checksum' ]} " )
329329 output = "\n " .join (lines )
330330
331331 return Response (
Original file line number Diff line number Diff line change @@ -200,15 +200,19 @@ $(function () {
200200
201201 Yoda . call ( 'research_manifest' ,
202202 { coll : Yoda . basePath + folder } ) . then ( ( data ) => {
203+ document . getElementById ( 'number-of-files' ) . textContent = data . files
204+ document . getElementById ( 'total-size' ) . textContent = data . size
205+ document . getElementById ( 'number-of-checksums' ) . textContent = `${ data . checksums } / ${ data . files } `
206+
203207 let table = '<table class="table table-striped"><tbody>'
204208
205209 table += '<thead><tr><th>Filename</th><th>Size</th><th>Checksum</th></tr></thead>'
206- if ( data . length > 0 ) {
207- $ . each ( data , function ( index , obj ) {
210+ if ( data . manifest . length > 0 ) {
211+ $ . each ( data . manifest , function ( index , obj ) {
208212 table += `<tr>
209213 <td>${ obj . name } </td>
210- <td>${ obj . size } </td>
211- <td>${ obj . checksum } </td>
214+ <td>${ obj . human_readable_size } </td>
215+ <td><pre> ${ obj . checksum } </pre> </td>
212216 </tr>`
213217 } )
214218 if ( downloadChecksumReportTextTooltip ) {
Original file line number Diff line number Diff line change @@ -62,6 +62,32 @@ <h5 class="modal-title">
6262 This overview shows files and their sizes and checksums and can be used to verify data integrity.
6363 The checksum algorithm used is < a href ="https://en.wikipedia.org/wiki/SHA-2 " target ="_blank " title ="SHA-256 checksum algorithm "> SHA-256</ a > .
6464 </ p >
65+ < div class ="row ">
66+ < div class ="col ">
67+ < div class ="card ">
68+ < div class ="card-body ">
69+ < h5 class ="card-title "> < i class ="fa-solid fa-file " aria-hidden ="true "> </ i > Number of files</ h5 >
70+ < p id ="number-of-files " class ="card-text "> </ p >
71+ </ div >
72+ </ div >
73+ </ div >
74+ < div class ="col ">
75+ < div class ="card ">
76+ < div class ="card-body ">
77+ < h5 class ="card-title "> < i class ="fa-solid fa-database " aria-hidden ="true "> </ i > Total size</ h5 >
78+ < p id ="total-size " class ="card-text "> </ p >
79+ </ div >
80+ </ div >
81+ </ div >
82+ < div class ="col ">
83+ < div class ="card ">
84+ < div class ="card-body ">
85+ < h5 class ="card-title "> < i class ="fa-solid fa-check " aria-hidden ="true "> </ i > Checksums generated</ h5 >
86+ < p id ="number-of-checksums " class ="card-text "> </ p >
87+ </ div >
88+ </ div >
89+ </ div >
90+ </ div >
6591 < div id ="checksumReport "> </ div >
6692 </ div >
6793 < div class ="modal-footer ">
Original file line number Diff line number Diff line change @@ -377,7 +377,7 @@ async function collectFolderEntries (folderPath) {
377377 // Start with the directory
378378 const downloadEntries = [ { name : folderName + '/' } ]
379379
380- for ( const item of data ) {
380+ for ( const item of data . manifest ) {
381381 if ( item . name . endsWith ( '/' ) ) {
382382 // Sub-folder
383383 downloadEntries . push ( { name : folderName + '/' + item . name } )
Original file line number Diff line number Diff line change @@ -67,15 +67,19 @@ $(function () {
6767
6868 Yoda . call ( 'research_manifest' ,
6969 { coll : Yoda . basePath + folder } ) . then ( ( data ) => {
70+ document . getElementById ( 'number-of-files' ) . textContent = data . files
71+ document . getElementById ( 'total-size' ) . textContent = data . size
72+ document . getElementById ( 'number-of-checksums' ) . textContent = `${ data . checksums } / ${ data . files } `
73+
7074 let table = '<table class="table table-striped"><tbody>'
7175
7276 table += '<thead><tr><th>Filename</th><th>Size</th><th>Checksum</th></tr></thead>'
73- if ( data . length > 0 ) {
74- $ . each ( data , function ( index , obj ) {
77+ if ( data . manifest . length > 0 ) {
78+ $ . each ( data . manifest , function ( index , obj ) {
7579 table += `<tr>
7680 <td>${ obj . name } </td>
77- <td>${ obj . size } </td>
78- <td>${ obj . checksum } </td>
81+ <td>${ obj . human_readable_size } </td>
82+ <td><pre> ${ obj . checksum } </pre> </td>
7983 </tr>`
8084 } )
8185 if ( downloadChecksumReportTextTooltip ) {
Original file line number Diff line number Diff line change @@ -160,6 +160,32 @@ <h5 class="modal-title">
160160 This overview shows files and their sizes and checksums and can be used to verify data integrity.
161161 The checksum algorithm used is < a href ="https://en.wikipedia.org/wiki/SHA-2 " target ="_blank " title ="SHA-256 checksum algorithm "> SHA-256</ a > .
162162 </ p >
163+ < div class ="row ">
164+ < div class ="col ">
165+ < div class ="card ">
166+ < div class ="card-body ">
167+ < h5 class ="card-title "> < i class ="fa-solid fa-file " aria-hidden ="true "> </ i > Number of files</ h5 >
168+ < p id ="number-of-files " class ="card-text "> </ p >
169+ </ div >
170+ </ div >
171+ </ div >
172+ < div class ="col ">
173+ < div class ="card ">
174+ < div class ="card-body ">
175+ < h5 class ="card-title "> < i class ="fa-solid fa-database " aria-hidden ="true "> </ i > Total size</ h5 >
176+ < p id ="total-size " class ="card-text "> </ p >
177+ </ div >
178+ </ div >
179+ </ div >
180+ < div class ="col ">
181+ < div class ="card ">
182+ < div class ="card-body ">
183+ < h5 class ="card-title "> < i class ="fa-solid fa-check " aria-hidden ="true "> </ i > Checksums generated</ h5 >
184+ < p id ="number-of-checksums " class ="card-text "> </ p >
185+ </ div >
186+ </ div >
187+ </ div >
188+ </ div >
163189 < div id ="checksumReport "> </ div >
164190 </ div >
165191 < div class ="modal-footer ">
Original file line number Diff line number Diff line change @@ -140,16 +140,16 @@ def download_report() -> Response:
140140 writer = csv .writer (output_io , quoting = csv .QUOTE_MINIMAL )
141141 writer .writerow (["filename" , "size" , "checksum" ])
142142 if response ['status' ] == 'ok' :
143- for result in response ["data" ]:
144- writer .writerow ([result ['name' ], result ['size ' ], result ['checksum' ]])
143+ for result in response ["data" ][ "manifest" ] :
144+ writer .writerow ([result ['name' ], result ['human_readable_size ' ], result ['checksum' ]])
145145 output = output_io .getvalue ()
146146 else :
147147 mime = 'text/plain'
148148 ext = '.txt'
149149 lines = []
150150 if response ['status' ] == 'ok' :
151- for result in response ["data" ]:
152- lines .append (f"{ result ['name' ]} { result ['size ' ]} { result ['checksum' ]} " )
151+ for result in response ["data" ][ "manifest" ] :
152+ lines .append (f"{ result ['name' ]} { result ['human_readable_size ' ]} { result ['checksum' ]} " )
153153 output = "\n " .join (lines )
154154
155155 return Response (
You can’t perform that action at this time.
0 commit comments