From f5a4e357b9de68ae03508e5da0ca364a6450a470 Mon Sep 17 00:00:00 2001 From: Nick Malcolm Date: Mon, 14 Jun 2021 20:27:16 +1200 Subject: [PATCH 1/5] Consolidate javascript at the bottom of the template. Remove duplicate bootstrap includes - you only need bundle to get Popper (see https://getbootstrap.com/docs/4.0/getting-started/contents/#js-files) and you don't need both plain bootstrap and bundled bootstrap. Remove dupe jQuery too. --- include/html_report | 60 ++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/include/html_report b/include/html_report index 42db8626..76935786 100644 --- a/include/html_report +++ b/include/html_report @@ -29,31 +29,10 @@ addHtmlHeader() { - - - - Prowler - AWS Security Assessments @@ -179,16 +158,31 @@ addHtmlFooter() { - - - - - - + + \$(document).ready(function(){ + + \$('#findingsTable').dataTable( { "lengthMenu": [ [50, 100, -1], [50, 100, "All"] ], "ordering": true } ); + + var maxLength = 30; + \$(".show-read-more").each(function(){ + var myStr = \$(this).text(); + if(\$.trim(myStr).length > maxLength){ + var newStr = myStr.substring(0, maxLength); + var removedStr = myStr.substring(maxLength, \$.trim(myStr).length); + \$(this).empty().html(newStr); + \$(this).append(' read more...'); + \$(this).append('' + removedStr + ''); + } + }); + \$(".read-more").click(function(){ + \$(this).siblings(".more-text").contents().unwrap(); + \$(this).remove(); + }); + }); + + EOF From 89af81ed22ee2bdfd60e560310a5a1acd32e3eda Mon Sep 17 00:00:00 2001 From: Nick Malcolm Date: Mon, 14 Jun 2021 20:31:34 +1200 Subject: [PATCH 2/5] Use DataTable's SearchPanes extension to allow easy filtering by result, severity, region, service, or check. --- include/html_report | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/include/html_report b/include/html_report index 76935786..8db263d5 100644 --- a/include/html_report +++ b/include/html_report @@ -27,7 +27,8 @@ addHtmlHeader() { - + +