@@ -658,29 +658,61 @@ <h4>License obligations</h4>
658658 </ template >
659659 </ section >
660660
661- <!-- cryptography -->
662- < section aria-labelledby ="nav-cryptography-tab " class ="tab-pane fade " id ="nav-cryptography " role ="tabpanel "
663- tabindex ="0 ">
664- < table class ="table main-table " id ="table-cryptography ">
665- < thead >
666- < tr >
667- < th > Component</ th >
668- < th > Version</ th >
669- < th > Cryptography</ th >
670- </ tr >
671- </ thead >
672- < tbody >
673- </ tbody >
674- </ table >
675-
676- < template id ="tpl-cryptography-row ">
677- < tr >
678- < td > </ td >
679- < td > </ td >
680- < td > </ td >
681- </ tr >
682- </ template >
683- </ section >
661+ <!-- cryptography -->
662+ < section aria-labelledby ="nav-cryptography-tab " class ="tab-pane fade " id ="nav-cryptography " role ="tabpanel "
663+ tabindex ="0 ">
664+ < nav >
665+ < div class ="nav nav-tabs " id ="nav-tab-crypto " role ="tablist ">
666+ < button aria-controls ="pane-local-cryptography " class ="nav-link visible active " aria-selected ="false " data-bs-target ="#pane-local-cryptography "
667+ data-bs-toggle ="tab " id ="crypto-file-tab " role ="tab " type ="button "> Files</ button >
668+ < button aria-controls ="pane-component-cryptography " class ="nav-link visible " aria-selected ="true " data-bs-target ="#pane-component-cryptography "
669+ data-bs-toggle ="tab " id ="crypto-component-tab " role ="tab " type ="button "> Components</ button >
670+ </ div >
671+ </ nav >
672+
673+ < div class ="tab-content " id ="myTabContent ">
674+ < div class ="tab-pane " id ="pane-component-cryptography " aria-labelledby ="crypto-component-tab " role ="tabpanel " tabindex ="0 ">
675+ < table class ="table main-table " id ="table-cryptography " >
676+ < thead >
677+ < tr >
678+ < th > Component</ th >
679+ < th > Version</ th >
680+ < th > Cryptography</ th >
681+ </ tr >
682+ </ thead >
683+ < tbody >
684+ </ tbody >
685+ </ table >
686+
687+ < template id ="tpl-cryptography-row ">
688+ < tr >
689+ < td > </ td >
690+ < td > </ td >
691+ < td > </ td >
692+ </ tr >
693+ </ template >
694+ </ div >
695+ < div class ="tab-pane active " id ="pane-local-cryptography " role ="tabpanel " aria-labelledby ="crypto-file-tab " tabindex ="0 ">
696+ < table class ="table main-table " id ="table-local-cryptography ">
697+ < thead >
698+ < tr >
699+ < th > File</ th >
700+ < th > Cryptography</ th >
701+ </ tr >
702+ </ thead >
703+ < tbody >
704+ </ tbody >
705+ </ table >
706+
707+ < template id ="tpl-local-cryptography-row ">
708+ < tr >
709+ < td > </ td >
710+ < td > </ td >
711+ </ tr >
712+ </ template >
713+ </ div >
714+ </ div >
715+ </ section >
684716
685717 <!-- quality -->
686718 < section aria-labelledby ="nav-quality-tab " class ="tab-pane fade " id ="nav-quality " role ="tabpanel "
@@ -809,7 +841,8 @@ <h4>License obligations</h4>
809841 renderDependenciesTable ( ) ;
810842 renderVulnerabilitiesTable ( ) ;
811843 renderCopyrightTable ( ) ;
812- renderCryptographyTable ( ) ;
844+ renderComponentCryptographyTable ( ) ;
845+ renderLocalCryptographyTable ( ) ;
813846 renderQualityTable ( ) ;
814847 renderHealthTable ( ) ;
815848 }
@@ -842,7 +875,7 @@ <h4>License obligations</h4>
842875 if ( data . dependencies ) showTab ( 'nav-dependencies-tab' ) ;
843876 if ( data . vulnerabilities ) showTab ( 'nav-vulnerabilities-tab' ) ;
844877 if ( existVersionKey ( 'copyrights' , data . component ) ) showTab ( 'nav-copyrights-tab' ) ;
845- if ( existVersionKey ( 'cryptography' , data . component ) ) showTab ( 'nav-cryptography-tab' ) ;
878+ if ( data . cryptography ) showTab ( 'nav-cryptography-tab' ) ;
846879 if ( existVersionKey ( 'quality' , data . component ) ) showTab ( 'nav-quality-tab' ) ;
847880 if ( existComponentKey ( 'health' , data . component ) ) showTab ( 'nav-health-tab' ) ;
848881 }
@@ -1135,24 +1168,36 @@ <h4>License obligations</h4>
11351168 }
11361169 }
11371170
1138- function renderCryptographyTable ( ) {
1171+ function renderComponentCryptographyTable ( ) {
11391172 const template = document . querySelector ( "#tpl-cryptography-row" ) ;
11401173 const table = document . querySelector ( "#table-cryptography tbody" ) ;
11411174
1142- const { component : componentData } = data ;
1175+ const { cryptography } = data ;
11431176
1144- if ( ! componentData ) return false ;
1177+ if ( ! cryptography && ! cryptography . components ) return false ;
11451178
1146- for ( const compData of componentData ) {
1147- for ( const version of compData . versions ) {
1148- if ( ! version . cryptography ) continue
1149- const clon = template . content . cloneNode ( true ) ;
1150- clon . querySelector ( 'td:nth-child(1)' ) . innerHTML = compData . name ;
1151- clon . querySelector ( 'td:nth-child(2)' ) . innerHTML = version . version ;
1152- clon . querySelector ( 'td:nth-child(3)' ) . innerHTML = version . cryptography . map ( e => `${ e . algorithm } (${ e . strength } )` ) . join ( '' ) ;
1179+ for ( const crypto of cryptography . components ) {
1180+ const clon = template . content . cloneNode ( true ) ;
1181+ clon . querySelector ( 'td:nth-child(1)' ) . innerHTML = crypto . purl ;
1182+ clon . querySelector ( 'td:nth-child(2)' ) . innerHTML = crypto . version ;
1183+ clon . querySelector ( 'td:nth-child(3)' ) . innerHTML = crypto . algorithms . map ( e => `${ e . algorithm } (${ e . strength } )` ) . join ( ' - ' ) ;
1184+ table . appendChild ( clon ) ;
1185+ }
1186+ }
11531187
1154- table . appendChild ( clon ) ;
1155- }
1188+ function renderLocalCryptographyTable ( ) {
1189+ const template = document . querySelector ( "#tpl-local-cryptography-row" ) ;
1190+ const table = document . querySelector ( "#table-local-cryptography tbody" ) ;
1191+
1192+ const { cryptography } = data ;
1193+
1194+ if ( ! cryptography && ! cryptography . files ) return false ;
1195+
1196+ for ( const crypto of cryptography . files ) {
1197+ const clon = template . content . cloneNode ( true ) ;
1198+ clon . querySelector ( 'td:nth-child(1)' ) . innerHTML = crypto . file ;
1199+ clon . querySelector ( 'td:nth-child(2)' ) . innerHTML = crypto . algorithms . map ( e => `${ e . algorithm } (${ e . strength } )` ) . join ( ' - ' ) ;
1200+ table . appendChild ( clon ) ;
11561201 }
11571202 }
11581203
0 commit comments