From d6b6e44dd592da9c6624486d7d6f0bc205100d94 Mon Sep 17 00:00:00 2001 From: Blake Owens Date: Tue, 16 Nov 2021 22:41:27 -0600 Subject: [PATCH 1/2] Removed all plot objects from corresponding .html files and grouped them into one static .js file --- dojo/static/dojo/js/metrics.js | 2331 +++++++++++++++++ dojo/templates/dojo/dashboard-metrics.html | 499 +--- dojo/templates/dojo/dashboard.html | 140 +- dojo/templates/dojo/endpoint_pdf_report.html | 155 +- .../templates/dojo/engagement_pdf_report.html | 229 +- dojo/templates/dojo/finding_pdf_report.html | 153 +- dojo/templates/dojo/metrics.html | 403 +-- .../dojo/product_endpoint_pdf_report.html | 385 +-- dojo/templates/dojo/product_metrics.html | 1402 +--------- dojo/templates/dojo/product_pdf_report.html | 253 +- .../dojo/product_type_pdf_report.html | 175 +- dojo/templates/dojo/test_pdf_report.html | 377 +-- dojo/templates/dojo/view_endpoint.html | 266 +- dojo/templates/dojo/view_engineer.html | 334 +-- dojo/templates/dojo/view_product_details.html | 33 +- 15 files changed, 2920 insertions(+), 4215 deletions(-) create mode 100644 dojo/static/dojo/js/metrics.js diff --git a/dojo/static/dojo/js/metrics.js b/dojo/static/dojo/js/metrics.js new file mode 100644 index 0000000000..ee01c451c1 --- /dev/null +++ b/dojo/static/dojo/js/metrics.js @@ -0,0 +1,2331 @@ +/* + dashboard.html +*/ + +function homepage_pie_chart(critical, high, medium, low, info) { + var data = [{ + label: "Critical", + color: "#d9534f", + data: critical + }, { + label: "High", + color: "#f0ad4e", + data: high + }, { + label: "Medium", + color: "#f0de28", + data: medium + }, { + label: "Low", + color: "#337ab7", + data: low + }, { + label: "Informational", + color: "#E0E0E0", + data: info + }]; + + var plotObj = $.plot($("#homepage_pie_chart"), data, { + series: { + pie: { + innerRadius: 0.5, + show: true, + radius: 1, + label: { + show: false, + radius: 2 / 3, + formatter: function (label, series) { + return '
' + label + '
' + series.data[0][1] + '
'; + + }, + + } + } + }, + grid: { + hoverable: true, + }, + tooltip:true, + tooltipOpts: { + content: function(label, xval, yval, flotItem) { + return label+"
"+yval + } + } + }); +} + +function homepage_severity_plot(critical, high, medium, low) { + var options = { + xaxes: [{ + mode: 'time' + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: true, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: true, + }; + + var plotObj = $.plot($("#homepage_severity_plot"), [{ + data: critical, + label: " Critical", + color: "#d9534f", + }, { + data: high, + label: " High", + color: '#f0ad4e', + }, { + data: medium, + label: " Medium", + color: '#f0de28', + }, { + data: low, + label: " Low", + color: '#337ab7', + }], + options); +} + +/* + dashboard-metrics.html +*/ + +function opened_per_month(critical, high, medium, low) { + var options = { + xaxes: [{ + mode: 'time', + timeformat: "%m/%y" + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + }; + + $.plot($("#opened_per_month"), [{ + data: critical, + label: " Critical", + color: "#d9534f", + }, { + data: high, + label: " High", + color: '#f0ad4e', + }, { + data: medium, + label: " Medium", + color: '#f0de28', + }, { + data: low, + label: " Low", + color: '#337ab7', + }], + options); +}; + +function accepted_per_month(critical, high, medium, low) { + var options = { + xaxes: [{ + mode: 'time', + timeformat: "%m/%y" + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + }; + + $.plot($("#accepted_per_month"), [{ + data: critical, + label: " Critical", + color: "#d9534f", + }, { + data: high, + label: " High", + color: '#f0ad4e', + }, { + data: medium, + label: " Medium", + color: '#f0de28', + }, { + data: low, + label: " Low", + color: '#337ab7', + }], + options); +}; + +function opened_per_week(critical, high, medium, low) { + var options = { + xaxes: [{ + mode: 'time', + timeformat: "%m/%d/%Y" + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: true, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: true, + }; + + var plotObj = $.plot($("#opened_per_week"), [{ + data: critical, + label: " Critical", + color: "#d9534f", + }, { + data: high, + label: " High", + color: '#f0ad4e', + }, { + data: medium, + label: " Medium", + color: '#f0de28', + }, { + data: low, + label: " Low", + color: '#337ab7', + }], + options); +} + +function accepted_per_week(critical, high, medium, low) { + var options = { + xaxes: [{ + mode: 'time', + timeformat: "%m/%d/%Y" + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + }; + + var plotObj = $.plot($("#accepted_per_week"), [{ + data: critical, + label: " Critical", + color: "#d9534f", + }, { + data: high, + label: " High", + color: '#f0ad4e', + }, { + data: medium, + label: " Medium", + color: '#f0de28', + }, { + data: low, + label: " Low", + color: '#337ab7', + }], + options); +} + +function top_ten_products(critical, high, medium, low, ticks) { + data1 = [ + { + data: critical, + color: "#d9534f", + bars: {fill: 1}, + label: 'Critical', + }, + { + data: high, + color: "#f0ad4e", + bars: {fill: 1}, + label: 'High', + + }, + { + data: medium, + color: "#f0de28", + bars: {fill: 1}, + label: 'Medium', + }, + { + data: low, + color: "#337ab7", + bars: {fill: 1}, + label: 'Low', + }, + ]; + + $.plot("#top-ten", data1, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + }); +} + +function severity_pie(critical, high, medium, low) { + var data = [{ + label: "Critical", + color: "#d9534f", + data: critical + }, { + label: "High", + color: "#f0ad4e", + data: high + }, { + label: "Medium", + color: "#f0de28", + data: medium + }, { + label: "Low", + color: "#337ab7", + data: low + }]; + + var plotObj = $.plot($("#opened_in_period"), data, { + series: { + pie: { + show: true, + radius: 1, + label: { + show: true, + radius: 2 / 3, + formatter: function (label, series) { + return '
' + label + '
' + series.data[0][1] + '
'; + + }, + + } + } + }, + grid: { + hoverable: false + }, + }); +} + +function total_accepted_pie(critical, high, medium, low) { + var data = [{ + label: "Critical", + color: "#d9534f", + data: critical + }, { + label: "High", + color: "#f0ad4e", + data: high + }, { + label: "Medium", + color: "#f0de28", + data: medium + }, { + label: "Low", + color: "#337ab7", + data: low + }]; + + var plotObj = $.plot($("#total_accepted_in_period"), data, { + series: { + pie: { + show: true, + radius: 1, + label: { + show: true, + radius: 2 / 3, + formatter: function (label, series) { + return '
' + label + '
' + series.data[0][1] + '
'; + + }, + + } + } + }, + grid: { + hoverable: false + }, + }); +} + +function total_closed_pie(critical, high, medium, low) { + var data = [{ + label: "Critical", + color: "#d9534f", + data: critical + }, { + label: "High", + color: "#f0ad4e", + data: high + }, { + label: "Medium", + color: "#f0de28", + data: medium + }, { + label: "Low", + color: "#337ab7", + data: low + }]; + + var plotObj = $.plot($("#total_closed_in_period"), data, { + series: { + pie: { + show: true, + radius: 1, + label: { + show: true, + radius: 2 / 3, + formatter: function (label, series) { + return '
' + label + '
' + series.data[0][1] + '
'; + + }, + + } + } + }, + grid: { + hoverable: false + }, + }); +} + +/* + metrics.html +*/ + +function opened_per_month_2(critical, high, medium, low) { + var tick_count = critical.length < 7 ? critical.length : 7; + var options = { + xaxis: { + mode: "time", + timeformat: "%m-%d-%Y", + timezone: 'browser' + }, + xaxes: [{ + ticks: tick_count + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: true, + borderWidth: 1, + borderColor: '#e7e7e7' + + }, + tooltip: true + }; + var plotObj = $.plot($("#opened_per_month_2"), [{ + data: critical, + label: " Critical", + color: "#d9534f", + + }, { + data: high, + label: " High", + color: '#f0ad4e', + + }, { + data: medium, + label: " Medium", + color: '#f0de28', + + }, { + data: low, + label: " Low", + color: '#337ab7', + + }], + options); +} + +function active_per_month(critical, high, medium, low) { + var tick_count = critical.length < 7 ? critical.length : 7; + var options = { + xaxis: { + mode: "time", + timeformat: "%m-%d-%Y", + timezone: 'browser' + }, + xaxes: [{ + ticks: tick_count + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: true, + borderWidth: 1, + borderColor: '#e7e7e7' + + }, + tooltip: true + }; + var plotObj = $.plot($("#active_per_month"), [{ + data: critical, + label: " Critical", + color: "#d9534f", + + }, { + data: high, + label: " High", + color: '#f0ad4e', + + }, { + data: medium, + label: " Medium", + color: '#f0de28', + + }, { + data: low, + label: " Low", + color: '#337ab7', + + }], + options); +} + +function accepted_per_month_2(critical, high, medium, low) { + var tick_count = critical.length < 7 ? critical.length : 7; + var options = { + xaxis: { + mode: "time", + timeformat: "%m-%d-%Y", + timezone: 'browser' + }, + xaxes: [{ + ticks: tick_count + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: true, + borderWidth: 1, + borderColor: '#e7e7e7' + + }, + tooltip: true + }; + var plotObj = $.plot($("#accepted_per_month_2"), [{ + data: critical, + label: " Critical", + color: "#d9534f" + }, { + data: high, + label: " High", + color: '#f0ad4e' + }, { + data: medium, + label: " Medium", + color: '#f0de28' + }, { + data: low, + label: " Low", + color: '#337ab7' + }], + options); +} + +function opened_per_week_2(critical, high, medium, low) { + var options = { + xaxis: { + mode: "time", + timeformat: "%m-%d-%Y", + timezone: 'browser' + }, + xaxes: [{ + ticks: 7 + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: true, + borderWidth: 1, + borderColor: '#e7e7e7' + + }, + tooltip: true + }; + + + var plotObj = $.plot($("#opened_per_week_2"), [{ + data: critical, + label: " Critical", + color: "#d9534f" + }, { + data: high, + label: " High", + color: '#f0ad4e' + }, { + data: medium, + label: " Medium", + color: '#f0de28' + }, { + data: low, + label: " Low", + color: '#337ab7' + }], + options); +} + +function accepted_per_week_2(critical, high, medium, low) { + var options = { + xaxis: { + mode: "time", + timeformat: "%m-%d-%Y", + timezone: 'browser' + }, + xaxes: [{ + ticks: 7 + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: true, + borderWidth: 1, + borderColor: '#e7e7e7' + + }, + tooltip: true + }; + + + var plotObj = $.plot($("#accepted_per_week_2"), [{ + data: critical, + label: " Critical", + color: "#d9534f" + }, { + data: high, + label: " High", + color: '#f0ad4e' + }, { + data: medium, + label: " Medium", + color: '#f0de28' + }, { + data: low, + label: " Low", + color: '#337ab7' + }], + options); +} + +/* + product_metrics.html +*/ + +function accepted_objs(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#accepted_objs", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + + }); +} + +function inactive_objs(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#inactive_objs", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + + }); +} + +function open_objs(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#open_objs", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + + }); +} + +function false_positive_objs(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#false_positive_objs", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + + }); +} + +function verified_objs(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#verified_objs", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + }); +} + +function out_of_scope_objs(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#out_of_scope_objs", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + }); +} + +function all_objs(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#all_objs", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + + }); +} + +function closed_objs(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#closed_objs", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + + }); +} + +function new_objs(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#new_objs", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + + }); +} + +function open_close_weekly(opened, closed, accepted, ticks) { + var options = { + xaxes: [{ + ticks: ticks, + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: true, + borderWidth: 1, + borderColor: '#e7e7e7' + + }, + tooltip: true + }; + + var plotObj = $.plot($("#open_close_weekly"), [{ + data: opened, + label: " Opened", + color: "#d9534f" + }, { + data: closed, + label: " Closed", + color: '#f0ad4e' + }, { + data: accepted, + label: " Accepted", + color: '#80699B' + }], + options); +} + +function severity_weekly(critical, high, medium, low, ticks) { + var options = { + xaxes: [{ + ticks: ticks, + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: true, + borderWidth: 1, + borderColor: '#e7e7e7' + + }, + tooltip: true + }; + + var plotObj = $.plot($("#severity_weekly"), [{ + data: critical, + label: " Critical", + color: "#d9534f" + }, { + data: high, + label: " High", + color: '#f0ad4e' + }, { + data: medium, + label: " Medium", + color: '#f0de28' + }, { + data: low, + label: " Low", + color: '#337ab7' + }, { + data: info, + label: " Info", + color: '#80699B' + }], + options); + +} + +function severity_counts_weekly(critical, high, medium, ticks) { + var options = { + xaxes: [{ + ticks: ticks, + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: true, + borderWidth: 1, + borderColor: '#e7e7e7' + + }, + tooltip: true + }; + + var plotObj = $.plot($("#severity_critical"), [{ + data: critical, + label: " Critical", + color: "#d9534f" + }], + options); + var plotObj = $.plot($("#severity_high"), [{ + data: high, + label: " High", + color: "#f0ad4e" + }], + options); + var plotObj = $.plot($("#severity_medium"), [{ + data: medium, + label: " Medium", + color: "#f0de28" + }], + options); +} + +function test_type(data) { + $.plot('#test_type', [data], { + series: { + stack: true, + bars: { + show: true, + barWidth: .7, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + mode: "categories", + tickLength: 4 + }, + + }); +} + +function draw_vulnerabilities_graph(tag, data) { + $.plot(tag, [data], { + series: { + stack: true, + bars: { + show: true, + barWidth: .7, + 'align': "center" + } + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7' + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + mode: "categories", + tickLength: 4 + } + }); +} + +/* + view_endpoint.html +*/ + +/* + view_engineer.html +*/ + +function open_bug_count_by_month(critical, high, medium, low, ticks) { + var options = { + xaxis: { + tickFormatter: function (x) { + return ticks[x - 1]; + }, + }, + xaxes: [{ + ticks: ticks.length, + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + }; + var plotObj = $.plot($("#chart_div"), [{ + data: critical, + label: " Critical", + color: "#d9534f", + }, { + data: high, + label: " High", + color: '#f0ad4e', + }, { + data: medium, + label: " Medium", + color: '#f0de28', + }, { + data: low, + label: " Low", + color: '#337ab7', + }], + options); +} + +function accepted_bug_count_by_month(critical, high, medium, low, ticks) { + var options = { + xaxis: { + tickFormatter: function (x) { + return ticks[x - 1]; + }, + }, + xaxes: [{ + ticks: ticks.length, + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + }; + var plotObj = $.plot($("#chart_div2"), [{ + data: critical, + label: " Critical", + color: "#d9534f", + }, { + data: high, + label: " High", + color: '#f0ad4e', + }, { + data: medium, + label: " Medium", + color: '#f0de28', + }, { + data: low, + label: " Low", + color: '#337ab7', + }], + options); +} + +function open_bug_count_by_week(critical, high, medium, low, ticks) { + var options = { + xaxis: { + tickFormatter: function (x) { + return ticks[x - 1]; + }, + }, + xaxes: [{ + ticks: ticks.length, + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + }; + + + var plotObj = $.plot($("#chart_div3"), [{ + data: critical, + label: " Critical", + color: "#d9534f", + }, { + data: high, + label: " High", + color: '#f0ad4e', + }, { + data: medium, + label: " Medium", + color: '#f0de28', + }, { + data: low, + label: " Low", + color: '#337ab7', + }], + options); +} + +function accepted_bug_count_by_week(critical, high, medium, low, ticks) { + var options = { + xaxis: { + tickFormatter: function (x) { + return ticks[x - 1]; + }, + }, + xaxes: [{ + ticks: ticks.length, + }], + yaxes: [{ + min: 0 + }], + series: { + lines: { + show: true + }, + points: { + show: true + } + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + }; + + + var plotObj = $.plot($("#chart_div4"), [{ + data: critical, + label: " Critical", + color: "#d9534f", + }, { + data: high, + label: " High", + color: '#f0ad4e', + }, { + data: medium, + label: " Medium", + color: '#f0de28', + }, { + data: low, + label: " Low", + color: '#337ab7', + }], + options); +} + +/* + view_product_details.html +*/ + +function languages_pie(data) { + var plotObj = $.plot($("#donut-lang"), data, { + series: { + pie: { + innerRadius: 0.5, + show: true, + radius: 1, + } + }, + legend: { + show: true + }, + grid: { + hoverable: true, + } + }); +} + +/* + endpoint_pdf_report.html +*/ + +/* + engagement_pdf_report.html +*/ + +/* + finding_pdf_report.html +*/ + +/* + product_endpoint_pdf_report.html +*/ + +function accepted_findings(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#accepted_findings", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + + }); +} + +/* + product_pdf_report.html +*/ + +/* + product_type_pdf_report.html +*/ + +function finding_age(data_1, ticks) { + var dataset = [ + {data: data_1, color: "#337ab7", fillColor: "#337ab7"} + ]; + + var options = { + series: { + bars: { + show: true, + fill: true, + fillColor: "#337ab7" + } + }, + bars: { + align: "center", + barWidth: 0.5 + }, + xaxis: { + axisLabel: "Days Open", + axisLabelUseCanvas: true, + axisLabelFontSizePixels: 12, + axisLabelFontFamily: 'Verdana, Arial', + axisLabelPadding: 10, + ticks: ticks, + }, + yaxis: { + axisLabel: "Number of Findings", + axisLabelUseCanvas: true, + axisLabelFontSizePixels: 12, + axisLabelFontFamily: 'Verdana, Arial', + axisLabelPadding: 3, + }, + legend: { + show: false, + }, + grid: { + borderWidth: 1, + borderColor: '#e7e7e7', + } + }; + + $.plot("#finding_age", dataset, options); +} + +function open_findings(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#open_findings", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + + }); +} + +function closed_findings(d1, d2, d3, d4, d5, ticks) { + var data = [ + { + label: "Critical", + data: d1, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 1, + fillColor: "#d9534f" + }, + color: "#d9534f" + }, + { + label: "High", + data: d2, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 2, + fillColor: "#f0ad4e" + }, + color: "#f0ad4e" + }, + { + label: "Medium", + data: d3, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 3, + fillColor: "#f0de28" + }, + color: "#f0de28" + }, + { + label: "Low", + data: d4, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#337ab7" + }, + color: "#337ab7" + }, + { + label: "info", + data: d5, + bars: { + show: true, + fill: true, + lineWidth: 1, + order: 4, + fillColor: "#80699B" + }, + color: "#80699B" + } + ]; + + $.plot("#closed_findings", data, { + series: { + stack: true, + bars: { + show: true, + barWidth: .9, + 'align': "center", + }, + + }, + grid: { + hoverable: false, + borderWidth: 1, + borderColor: '#e7e7e7', + + }, + tooltip: false, + legend: { + show: false, + position: "ne" + }, + xaxis: { + ticks: ticks, + }, + + }); +} + +/* + test_pdf_report.html +*/ \ No newline at end of file diff --git a/dojo/templates/dojo/dashboard-metrics.html b/dojo/templates/dojo/dashboard-metrics.html index ba08c1c65b..40e7cd3a5c 100644 --- a/dojo/templates/dojo/dashboard-metrics.html +++ b/dojo/templates/dojo/dashboard-metrics.html @@ -58,7 +58,7 @@

{{ name }} For {{ start_date.date }} - {{ end_date.date }}
-
+
@@ -71,7 +71,7 @@

{{ name }} For {{ start_date.date }} - {{ end_date.date }}
-
+
@@ -84,7 +84,7 @@

{{ name }} For {{ start_date.date }} - {{ end_date.date }}
-
+
@@ -97,7 +97,7 @@

{{ name }} For {{ start_date.date }} - {{ end_date.date }}
-
+
@@ -196,6 +196,7 @@

{{ name }} For {{ start_date.date }} - {{ end_date.date }} {% endif %} + {% endblock %} diff --git a/dojo/templates/dojo/dashboard.html b/dojo/templates/dojo/dashboard.html index 368102fc28..ad1663c0fc 100644 --- a/dojo/templates/dojo/dashboard.html +++ b/dojo/templates/dojo/dashboard.html @@ -108,7 +108,7 @@
-
+
@@ -121,7 +121,7 @@
-
+
@@ -242,128 +242,34 @@ {% endif %} + diff --git a/dojo/templates/dojo/endpoint_pdf_report.html b/dojo/templates/dojo/endpoint_pdf_report.html index f7f9b455c3..b6daa96aae 100644 --- a/dojo/templates/dojo/endpoint_pdf_report.html +++ b/dojo/templates/dojo/endpoint_pdf_report.html @@ -257,16 +257,12 @@

Notes
+ + + - + {% endblock %} diff --git a/dojo/templates/dojo/product_endpoint_pdf_report.html b/dojo/templates/dojo/product_endpoint_pdf_report.html index ecb669c7f3..d0de8ae9d7 100644 --- a/dojo/templates/dojo/product_endpoint_pdf_report.html +++ b/dojo/templates/dojo/product_endpoint_pdf_report.html @@ -311,15 +311,9 @@
Notes
{% endif %} + + {% endif %} + + + {% endblock %} diff --git a/dojo/templates/dojo/view_endpoint.html b/dojo/templates/dojo/view_endpoint.html index 9db8165d47..2f9be86951 100644 --- a/dojo/templates/dojo/view_endpoint.html +++ b/dojo/templates/dojo/view_endpoint.html @@ -156,7 +156,7 @@

-
+
@@ -311,6 +311,7 @@

Active Verified Findings

+ {% endblock %} diff --git a/dojo/templates/dojo/view_engineer.html b/dojo/templates/dojo/view_engineer.html index c8df929759..08266daf9f 100644 --- a/dojo/templates/dojo/view_engineer.html +++ b/dojo/templates/dojo/view_engineer.html @@ -581,278 +581,72 @@

{{ name }}

+ diff --git a/dojo/templates/dojo/view_product_details.html b/dojo/templates/dojo/view_product_details.html index 355a27057e..c591f42051 100644 --- a/dojo/templates/dojo/view_product_details.html +++ b/dojo/templates/dojo/view_product_details.html @@ -592,6 +592,7 @@