From 12975bf0c30feef8c14ebdfa41fa9faddbb6f951 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Fri, 12 Feb 2016 21:25:49 -0600 Subject: [PATCH] Adding the JS to handle submitting the "ignore cert errors" with a campaign. Adding JS to handle showing errors on email submissions --- static/js/app/campaign_results.js | 43 ++++++++++++++++++------------- static/js/app/campaigns.js | 2 ++ 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/static/js/app/campaign_results.js b/static/js/app/campaign_results.js index efddfd36..efba5e8b 100644 --- a/static/js/app/campaign_results.js +++ b/static/js/app/campaign_results.js @@ -139,21 +139,28 @@ function renderTimeline(data) { ' ' + moment(event.time).format('MMMM Do YYYY h:mm') + '' if (event.details) { results += '
View Details
' - results += '
' - results += ' ' - results += ' ' details = JSON.parse(event.details) - $.each(Object.keys(details.payload), function(i, param) { - if (param == "rid") { - return true; - } - results += ' ' - results += ' ' - results += ' ' - results += ' ' - }) - results += '
ParameterValue(s)
' + param + '' + details.payload[param] + '
' - results += '
' + if (details.payload) { + results += '
' + results += ' ' + results += ' ' + $.each(Object.keys(details.payload), function(i, param) { + if (param == "rid") { + return true; + } + results += ' ' + results += ' ' + results += ' ' + results += ' ' + }) + results += '
ParameterValue(s)
' + param + '' + details.payload[param] + '
' + results += '
' + } + if (details.error) { + results += '
' + results += 'Error ' + details.error + results += '
' + } } results += '' } @@ -174,15 +181,15 @@ $(document).ready(function() { // Setup viewing the details of a result $("#resultsTable").on("click", ".timeline-event-details", function() { // Show the parameters - payloadTable = $(this).parent().find(".timeline-event-table") - if (payloadTable.is(":visible")) { + payloadResults = $(this).parent().find(".timeline-event-results") + if (payloadResults.is(":visible")) { $(this).find("i").removeClass("fa-caret-down") $(this).find("i").addClass("fa-caret-right") - payloadTable.hide() + payloadResults.hide() } else { $(this).find("i").removeClass("fa-caret-right") $(this).find("i").addClass("fa-caret-down") - payloadTable.show() + payloadResults.show() } }) // Setup our graphs diff --git a/static/js/app/campaigns.js b/static/js/app/campaigns.js index e6c7052b..d12d4736 100644 --- a/static/js/app/campaigns.js +++ b/static/js/app/campaigns.js @@ -35,6 +35,7 @@ function launch() { host: $("input[name=host]").val(), username: $("input[name=username]").val(), password: $("input[name=password]").val(), + ignore_cert_errors: $("#ignore_cert_errors").prop("checked") }, groups: groups } @@ -73,6 +74,7 @@ function sendTestEmail() { host: $("input[name=host]").val(), username: $("input[name=username]").val(), password: $("input[name=password]").val(), + ignore_cert_errors: $("#ignore_cert_errors").prop("checked") } } btnHtml = $("#sendTestModalSubmit").html()