From 5307ee0579fba3b223f8dd24afdb8b04e5481f13 Mon Sep 17 00:00:00 2001 From: psyray Date: Mon, 30 Sep 2024 14:39:05 +0200 Subject: [PATCH 1/4] refactor: update modal handling and improve CMS detection - Refactored modal handling by standardizing the use of #modal_dialog and .modal-text for content updates across various JavaScript files. - Enhanced the CMS detection functionality by introducing a new event listener for detecting CMS on subdomains, utilizing data attributes for passing necessary information. - Updated modal dismissal buttons to use data-bs-dismiss for Bootstrap 5 compatibility. - Removed redundant IDs from modal elements in HTML templates to streamline the code and prevent potential conflicts. - Improved the handling of project-specific data by passing the current project slug to relevant functions. --- web/recon_note/templates/note/index.html | 2 +- .../static/scanEngine/js/custom_tools.js | 20 ++-- .../scanEngine/settings/llm_toolkit.html | 6 +- .../static/startScan/js/detail_scan.js | 101 +++++++++--------- .../templates/startScan/detail_scan.html | 4 +- .../templates/startScan/subdomains.html | 4 +- web/static/custom/custom.js | 60 +++++------ web/static/custom/todo.js | 20 ++-- web/static/custom/toolbox.js | 6 +- web/static/plugins/datatable/datatables.js | 2 +- web/static/plugins/todo/todolist.css | 6 +- .../templates/organization/list.html | 8 +- web/targetApp/templates/target/summary.html | 4 +- web/templates/base/_items/modal.html | 6 +- web/templates/base/_items/top_bar.html | 48 ++++----- 15 files changed, 149 insertions(+), 148 deletions(-) diff --git a/web/recon_note/templates/note/index.html b/web/recon_note/templates/note/index.html index e95e70bd1..00e5660a1 100644 --- a/web/recon_note/templates/note/index.html +++ b/web/recon_note/templates/note/index.html @@ -116,7 +116,7 @@
Add to-do
diff --git a/web/scanEngine/static/scanEngine/js/custom_tools.js b/web/scanEngine/static/scanEngine/js/custom_tools.js index 537ebfc3e..4d8cef2a6 100644 --- a/web/scanEngine/static/scanEngine/js/custom_tools.js +++ b/web/scanEngine/static/scanEngine/js/custom_tools.js @@ -7,13 +7,13 @@ function load_gf_template(pattern_name){ $.getJSON(`/api/getFileContents?gf_pattern&name=${pattern_name}&format=json`, function(response) { swal.close(); if (response.status) { - $('#modal_title').empty(); - $('#modal-content').empty(); - $("#modal-footer").empty(); + $('#modal_dialog .modal-title').empty(); + $('#modal_dialog .modal-text').empty(); + $("#modal_dialog .modal-footer").empty(); - $('#modal_title').html(`GF Pattern ` + htmlEncode(pattern_name)); + $('#modal_dialog .modal-title').html(`GF Pattern ` + htmlEncode(pattern_name)); - $('#modal-content').append(`
${htmlEncode(response['content'])}
`); + $('#modal_dialog .modal-text').append(`
${htmlEncode(response['content'])}
`); $('#modal_dialog').modal('show'); } else{ @@ -38,13 +38,13 @@ function load_nuclei_template(pattern_name){ $.getJSON(`/api/getFileContents?nuclei_template&name=${pattern_name}&format=json`, function(response) { swal.close(); if (response.status) { - $('#modal_title').empty(); - $('#modal-content').empty(); - $("#modal-footer").empty(); + $('#modal_dialog .modal-title').empty(); + $('#modal_dialog .modal-text').empty(); + $("#modal_dialog .modal-footer").empty(); - $('#modal_title').html(`Nuclei Template: ` + htmlEncode(pattern_name)); + $('#modal_dialog .modal-title').html(`Nuclei Template: ` + htmlEncode(pattern_name)); - $('#modal-content').append(`
${htmlEncode(response['content'])}
`); + $('#modal_dialog .modal-text').append(`
${htmlEncode(response['content'])}
`); $('#modal_dialog').modal('show'); } else{ diff --git a/web/scanEngine/templates/scanEngine/settings/llm_toolkit.html b/web/scanEngine/templates/scanEngine/settings/llm_toolkit.html index 525159f1a..cf5434590 100644 --- a/web/scanEngine/templates/scanEngine/settings/llm_toolkit.html +++ b/web/scanEngine/templates/scanEngine/settings/llm_toolkit.html @@ -158,9 +158,9 @@

} function showAddNewModelModal(){ - $('#modal_title').html('Add new LLM Model'); - $('#modal-content').empty(); - $('#modal-content').append(` + $('#modal_dialog .modal-title').html('Add new LLM Model'); + $('#modal_dialog .modal-text').empty(); + $('#modal_dialog .modal-text').append(`

You can find the list of supported models in Ollama Library

We recommend using llama2-uncensored model for better results.

diff --git a/web/startScan/static/startScan/js/detail_scan.js b/web/startScan/static/startScan/js/detail_scan.js index 45ad9f968..492b1f798 100644 --- a/web/startScan/static/startScan/js/detail_scan.js +++ b/web/startScan/static/startScan/js/detail_scan.js @@ -864,12 +864,12 @@ function get_dork_details(dork_type, scan_id){ // render tab modal $('.modal-title').html('Dorking Results in category: ' + dork_type + ''); $('#modal_dialog').modal('show'); - $('.modal-text').empty(); $('#modal-footer').empty(); + $('.modal-text').empty(); $('#modal_dialog .modal-footer').empty(); $('.modal-text').append(``); $.getJSON(`/api/queryDorks/?scan_id=${scan_id}&type=${dork_type}&format=json`, function(data) { - $('#modal-loader').empty(); - $('#modal-content').append(`${data['dorks'].length} results found in this dork category.`); - $('#modal-content').append(`
    `); + $('#modal_dialog #modal-loader').empty(); + $('#modal_dialog .modal-text').append(`${data['dorks'].length} results found in this dork category.`); + $('#modal_dialog .modal-text').append(`
      `); for (dork in data['dorks']){ dork_obj = data['dorks'][dork]; $("#dork-detail-modal-ul").append(`
    • ${dork_obj['description']}
    • `); @@ -1140,12 +1140,12 @@ $(".add-scan-history-todo").click(function(){ }); -function add_note_for_subdomain(subdomain_id, subdomain_name){ +function add_note_for_subdomain(subdomain_id, subdomain_name, current_project){ $('#todo-modal-subdomain-name').html(subdomain_name); $("#subdomainTodoTitle").val(''); $("#subdomainTodoDescription").val(''); - $('#add-todo-subdomain-submit-button').attr('onClick', `add_note_for_subdomain_handler(${subdomain_id});`); + $('#add-todo-subdomain-submit-button').attr('onClick', `add_note_for_subdomain_handler(${subdomain_id}, '${current_project}');`); $('#addSubdomainTaskModal').modal('show'); @@ -1153,17 +1153,16 @@ function add_note_for_subdomain(subdomain_id, subdomain_name){ } -function add_note_for_subdomain_handler(subdomain_id){ +function add_note_for_subdomain_handler(subdomain_id, current_project){ var title = document.getElementById('subdomainTodoTitle').value; var description = document.getElementById('subdomainTodoDescription').value; - var project = document.querySelector('input[name="current_project"]').value; var scan_id = parseInt(document.getElementById('summary_identifier_val').value); data = { 'title': title, 'description': description, 'subdomain_id': subdomain_id, - 'project': project, + 'project': current_project, 'scan_history_id': scan_id } @@ -1216,7 +1215,7 @@ function download_subdomains(scan_id=null, domain_id=null, domain_name=null){ $('.modal-title').html(count + ' Subdomains'); } - $('.modal-text').empty(); $('#modal-footer').empty(); + $('.modal-text').empty(); $('#modal_dialog .modal-footer').empty(); $('.modal-text').append(``); // query subdomains $.getJSON(url, function(data) { @@ -1224,17 +1223,17 @@ function download_subdomains(scan_id=null, domain_id=null, domain_name=null){ if (data['subdomains'].length) { $('#modal_dialog').modal('show'); $('.modal_count').html(data['subdomains'].length); - $('#modal-content').empty(); + $('#modal_dialog .modal-text').empty(); subdomains = ''; - $('#modal-content').append(``); + $('#modal_dialog .modal-text').append(``); for (subdomain in data['subdomains']){ subdomain_obj = data['subdomains'][subdomain]; subdomains += subdomain_obj['name'] + '\n' } $('#all_subdomains_text_area').append(subdomains); - $("#modal-footer").empty(); - $("#modal-footer").append(` Download Subdomains as txt`); - $("#modal-footer").append(` Copy Subdomains`); + $("#modal_dialog .modal-footer").empty(); + $("#modal_dialog .modal-footer").append(` Download Subdomains as txt`); + $("#modal_dialog .modal-footer").append(` Copy Subdomains`); } else{ swal.fire("No Subdomains", "Could not find any subdomains.", "warning", { @@ -1268,23 +1267,23 @@ function download_interesting_subdomains(project, scan_id=null, domain_id=null, else{ $('.modal-title').html( count + ' Interesting Subdomains'); } - $('.modal-text').empty(); $('#modal-footer').empty(); + $('.modal-text').empty(); $('#modal_dialog .modal-footer').empty(); // query subdomains $.getJSON(url, function(data) { swal.close() if (data.length) { $('#modal_dialog').modal('show'); $('.modal_count').html(data.length); - $('#modal-content').empty(); + $('#modal_dialog .modal-text').empty(); subdomains = ''; - $('#modal-content').append(``); + $('#modal_dialog .modal-text').append(``); for (subdomain in data){ subdomains += data[subdomain]['name'] + '\n' } $('#interesting_subdomains_text_area').append(subdomains); - $("#modal-footer").empty(); - $("#modal-footer").append(` Download Subdomains as txt`); - $("#modal-footer").append(` Copy Subdomains`); + $("#modal_dialog .modal-footer").empty(); + $("#modal_dialog .modal-footer").append(` Download Subdomains as txt`); + $("#modal_dialog .modal-footer").append(` Copy Subdomains`); } else{ swal.fire("No Interesting Subdomains", "Could not find any interesting subdomains.", "warning", { @@ -1317,23 +1316,23 @@ function download_interesting_endpoints(scan_id, domain_name){ else{ $('.modal-title').html( count + ' Interesting Endpoints'); } - $('.modal-text').empty(); $('#modal-footer').empty(); + $('.modal-text').empty(); $('#modal_dialog .modal-footer').empty(); // query subdomains $.getJSON(url, function(data) { swal.close(); if (data.length) { $('#modal_dialog').modal('show'); $('.modal_count').html(data.length); - $('#modal-content').empty(); + $('#modal_dialog .modal-text').empty(); endpoints = ''; - $('#modal-content').append(``); + $('#modal_dialog .modal-text').append(``); for (endpoint in data){ endpoints += data[endpoint]['http_url'] + '\n' } $('#interesting_endpoints_text_area').append(endpoints); - $("#modal-footer").empty(); - $("#modal-footer").append(` Download Endpoints as txt`); - $("#modal-footer").append(` Copy Endpoints`); + $("#modal_dialog .modal-footer").empty(); + $("#modal_dialog .modal-footer").append(` Download Endpoints as txt`); + $("#modal_dialog .modal-footer").append(` Copy Endpoints`); } else{ swal.fire("No Interesting Endpoints", "Could not find any interesting Endpoints.", "warning", { @@ -1368,24 +1367,24 @@ function download_important_subdomains(scan_id=null, domain_id=null, domain_name else{ $('.modal-title').html(count + ' Subdomains marked as important'); } - $('.modal-text').empty(); $('#modal-footer').empty(); + $('.modal-text').empty(); $('#modal_dialog .modal-footer').empty(); // query subdomains $.getJSON(url, function(data) { swal.close(); if (data['subdomains'].length) { $('#modal_dialog').modal('show'); $('.modal_count').html(data['subdomains'].length); - $('#modal-content').empty(); + $('#modal_dialog .modal-text').empty(); subdomains = ''; - $('#modal-content').append(``); + $('#modal_dialog .modal-text').append(``); for (subdomain in data['subdomains']){ subdomain_obj = data['subdomains'][subdomain]; subdomains += subdomain_obj['name'] + '\n' } $('#all_subdomains_text_area').append(subdomains); - $("#modal-footer").empty(); - $("#modal-footer").append(` Download Subdomains as txt`); - $("#modal-footer").append(` Copy Subdomains`); + $("#modal_dialog .modal-footer").empty(); + $("#modal_dialog .modal-footer").append(` Download Subdomains as txt`); + $("#modal_dialog .modal-footer").append(` Copy Subdomains`); } else{ swal.fire("No Important Endpoints", "No subdomains has been marked as important.", "warning", { @@ -1425,28 +1424,28 @@ function download_endpoints(scan_id=null, domain_id=null, domain_name='', patter else{ $('.modal-title').html(count + ' Endpoints'); } - $('.modal-text').empty(); $('#modal-footer').empty(); + $('.modal-text').empty(); $('#modal_dialog .modal-footer').empty(); // query subdomains $.getJSON(url, function(data) { swal.close(); $('#modal_dialog').modal('show'); $('.modal_count').html(data['endpoints'].length); - $('#modal-content').empty(); + $('#modal_dialog .modal-text').empty(); endpoints = ''; - $('#modal-content').append(``); + $('#modal_dialog .modal-text').append(``); for (endpoint in data['endpoints']){ endpoint_obj = data['endpoints'][endpoint]; endpoints += endpoint_obj['http_url'] + '\n' } $('#all_endpoints_text_area').append(endpoints); - $("#modal-footer").empty(); + $("#modal_dialog .modal-footer").empty(); if (domain_name) { - $("#modal-footer").append(` Download Endpoints as txt`); + $("#modal_dialog .modal-footer").append(` Download Endpoints as txt`); } else{ - $("#modal-footer").append(` Download Endpoints as txt`); + $("#modal_dialog .modal-footer").append(` Download Endpoints as txt`); } - $("#modal-footer").append(` Copy Endpoints`); + $("#modal_dialog .modal-footer").append(` Copy Endpoints`); }).fail(function(){ }); } @@ -1600,17 +1599,17 @@ function downloadSelectedSubdomains(domain_name){ if (response['status']) { $('#modal_dialog').modal('show'); $('.modal_count').html(response['results'].length); - $('#modal-content').empty(); + $('#modal_dialog .modal-text').empty(); subdomains = ''; - $('#modal-content').append(``); + $('#modal_dialog .modal-text').append(``); for (subdomain in response['results']){ subdomain_obj = response['results'][subdomain]; subdomains += subdomain_obj + '\n' } $('#selected_subdomains_text_area').append(subdomains); - $("#modal-footer").empty(); - $("#modal-footer").append(` Download Subdomains as txt`); - $("#modal-footer").append(` Copy Subdomains`); + $("#modal_dialog .modal-footer").empty(); + $("#modal_dialog .modal-footer").append(` Download Subdomains as txt`); + $("#modal_dialog .modal-footer").append(` Copy Subdomains`); } else{ Swal.fire({ @@ -1700,7 +1699,10 @@ function initiateMultipleSubscan(){ } -function detect_subdomain_cms(http_url, http_status){ +$(document).on('click', '.detect_subdomain_cms_link', function(){ + var url = $(this).data('cms-url'); + var http_status = $(this).data('http-status'); + var cmsDetectorUrl = $(this).data('url'); if (http_status == 0) { var message = `reNgine has earlier identified that this subdomain did not return any HTTP status and likely the subdomain is not alive. reNgine may not be able to detect any CMS, would you still like to continue?`; } @@ -1708,6 +1710,7 @@ function detect_subdomain_cms(http_url, http_status){ var message = `reNgine has earlier identified that this subdomain has HTTP status as ${http_status} and likely that reNgine will not detect any CMS, would you still like to continue?`; } + var cmsDetectorUrl = $(this).data('url'); if (http_status != 200 || http_status == 0) { Swal.fire({ showCancelButton: true, @@ -1717,11 +1720,11 @@ function detect_subdomain_cms(http_url, http_status){ confirmButtonText: 'Detect CMS', }).then((result) => { if (result.isConfirmed) { - cms_detector_api_call(http_url); + cms_detector_api_call(cmsDetectorUrl, url); } }); } else{ - cms_detector_api_call(http_url); + cms_detector_api_call(cmsDetectorUrl,url); } -} +}); diff --git a/web/startScan/templates/startScan/detail_scan.html b/web/startScan/templates/startScan/detail_scan.html index 136596b68..67d725c50 100644 --- a/web/startScan/templates/startScan/detail_scan.html +++ b/web/startScan/templates/startScan/detail_scan.html @@ -2375,11 +2375,11 @@

      - +

      diff --git a/web/startScan/templates/startScan/subdomains.html b/web/startScan/templates/startScan/subdomains.html index 31b1c5b08..d764881f3 100644 --- a/web/startScan/templates/startScan/subdomains.html +++ b/web/startScan/templates/startScan/subdomains.html @@ -286,11 +286,11 @@ diff --git a/web/static/custom/custom.js b/web/static/custom/custom.js index 504232cec..0b36cccf0 100644 --- a/web/static/custom/custom.js +++ b/web/static/custom/custom.js @@ -1431,9 +1431,9 @@ function get_and_render_subscan_history(endpoint, subdomain_id, subdomain_name) return response.json(); }).then(function(data) { if (data['status']) { - $('#modal_title').html('Subscan History for subdomain ' + subdomain_name); - $('#modal-content').empty(); - $('#modal-content').append(`
      `); + $('#modal_dialog .modal-title').html('Subscan History for subdomain ' + subdomain_name); + $('#modal_dialog .modal-text').empty(); + $('#modal_dialog .modal-text').append(`
      `); $('#subscan_history_table').empty(); @@ -1604,8 +1604,8 @@ function get_domain_whois(whoisLookupUrl, domain_name, addTargetUrl, project_slu function display_whois_on_modal(response, addTargetUrl, project_slug, show_add_target_btn=false) { // this function will display whois data on modal, should be followed after get_domain_whois() $('#whoisLookupResultModal').modal('show'); - $('#whoisLookupResultModal #modal-content').empty(); - $("#whoisLookupResultModal #modal-footer").empty(); + $('#whoisLookupResultModal .modal-body').empty(); + $("#whoisLookupResultModal .modal-footer").empty(); content = `
      @@ -1925,7 +1925,7 @@ function display_whois_on_modal(response, addTargetUrl, project_slug, show_add_t
      ` } - $('#whoisLookupResultModal #modal-content').append(content); + $('#whoisLookupResultModal .modal-body').append(content); $('[data-toggle="tooltip"]').tooltip(); } @@ -2211,12 +2211,12 @@ function get_ip_details(endpoint_port_url, endpoint_subdomain_url, ip_address, s var subdomain_loader = ``; // add tab modal title - $('#modal_title').html('Details for IP: ' + ip_address + ''); + $('#modal_dialog .modal-title').html('Details for IP: ' + ip_address + ''); - $('#modal-content').empty(); + $('#modal_dialog .modal-text').empty(); $('#modal-tabs').empty(); - $('#modal-content').append(``); + $('#modal_dialog .modal-text').append(``); $('#modal_tab_nav').append(``); $('#modal_tab_nav').append(``) @@ -2297,13 +2297,13 @@ function get_port_details(endpoint_ip_url, endpoint_subdomain_url, port, scan_id var ip_spinner = ``; var subdomain_spinner = ``; - $('#modal_title').html('Details for Port: ' + port + ''); + $('#modal_dialog .modal-title').html('Details for Port: ' + port + ''); - $('#modal-content').empty(); + $('#modal_dialog .modal-text').empty(); $('#modal-tabs').empty(); - $('#modal-content').append(``); + $('#modal_dialog .modal-text').append(``); $('#modal_tab_nav').append(``); $('#modal_tab_nav').append(``) @@ -2375,17 +2375,17 @@ function get_tech_details(endpoint_subdomain_url, tech, scan_id=null, domain_id= var interesting_badge = `Interesting`; // render tab modal - $('.modal-title').html('Details for Technology: ' + tech + ''); + $('#modal_dialog .modal-title').html('Details for Technology: ' + tech + ''); $('#modal_dialog').modal('show'); - $('.modal-text').empty(); - $('#modal-footer').empty(); - $('.modal-text').append(``); + $('#modal_dialog .modal-text').empty(); + $('#modal_dialog .modal-footer').empty(); + $('#modal_dialog .modal-text').append(``); // query subdomains $.getJSON(url, function(data) { - $('#modal-loader').empty(); - $('#modal-content').empty(); - $('#modal-content').append(`${data['subdomains'].length} Subdomains are using ${tech}`); + $('#modal_dialog #modal-loader').empty(); + $('#modal_dialog .modal-text').empty(); + $('#modal_dialog .modal-text').append(`${data['subdomains'].length} Subdomains are using ${tech}`); const subdomainList = $(''); for (subdomain in data['subdomains']){ subdomain_obj = data['subdomains'][subdomain]; @@ -2408,11 +2408,11 @@ function get_tech_details(endpoint_subdomain_url, tech, scan_id=null, domain_id= } } - $("#modal-content").append(subdomainList); - $("#modal-content").append(`*Subdomains highlighted are 40X HTTP Status`); + $("#modal_dialog .modal-text").append(subdomainList); + $("#modal_dialog .modal-text").append(`*Subdomains highlighted are 40X HTTP Status`); $("#subdomain-modal-loader").remove(); }).fail(function(){ - $('#modal-loader').empty(); + $('#modal_dialog #modal-loader').empty(); }); } @@ -3195,10 +3195,10 @@ async function fetch_gpt_vuln_details(endpoint_url, id, title) { function render_gpt_vuln_modal(data, title){ - $('#modal-title').empty(); - $('#modal-content').empty(); - $('#modal-footer').empty(); - $('#modal_title').html(`Vulnerability detail for ${title}`); + $('#modal_dialog .modal-title').empty(); + $('#modal_dialog .modal-text').empty(); + $('#modal_dialog .modal-footer').empty(); + $('#modal_dialog .modal-title').html(`Vulnerability detail for ${title}`); var modal_content = `

      Description

      @@ -3217,7 +3217,7 @@ function render_gpt_vuln_modal(data, title){ modal_content += '

      '; - $('#modal-content').append(modal_content); + $('#modal_dialog .modal-text').append(modal_content); $('#modal_dialog').modal('show'); } @@ -3279,9 +3279,9 @@ async function show_attack_surface_modal(endpoint_url, id){ const data = await send_gpt__attack_surface_api_request(endpoint_url,id); Swal.close(); if (data.status) { - $('#modal_title').html(`Attack Surface Suggestion for ${data.subdomain_name} (BETA)`); - $('#modal-content').empty(); - $('#modal-content').append(data.description.replace(new RegExp('\r?\n','g'), '
      ')); + $('#modal_dialog .modal-title').html(`Attack Surface Suggestion for ${data.subdomain_name} (BETA)`); + $('#modal_dialog .modal-text').empty(); + $('#modal_dialog .modal-text').append(data.description.replace(new RegExp('\r?\n','g'), '
      ')); $('#modal_dialog').modal('show'); } else{ diff --git a/web/static/custom/todo.js b/web/static/custom/todo.js index 3842fd98e..4735a99de 100644 --- a/web/static/custom/todo.js +++ b/web/static/custom/todo.js @@ -91,14 +91,14 @@ function change_todo_priority(todo_id, imp_type){ function list_subdomain_todos(subdomain_id, subdomain_name){ $('.modal-title').html(`Todos for subdomain ${subdomain_name}`); $('#modal_dialog').modal('show'); - $('#modal-content').empty(); - $('#modal-footer').empty(); - $('#modal-content').append(``); + $('#modal_dialog .modal-text').empty(); + $('#modal_dialog .modal-footer').empty(); + $('#modal_dialog .modal-text').append(``); // query subdomains $.getJSON(`/api/listTodoNotes/?subdomain_id=${subdomain_id}&format=json`, function(data) { - $('#modal-loader').empty(); - $('#modal-content').empty(); - $('#modal-content').append(``); + $('#modal_dialog #modal-loader').empty(); + $('#modal_dialog .modal-text').empty(); + $('#modal_dialog .modal-text').append(``); for (todo in data['notes']){ todo_obj = data['notes'][todo]; important_badge = ''; @@ -121,23 +121,23 @@ function list_subdomain_todos(subdomain_id, subdomain_name){ } $('.bs-tooltip').tooltip(); }).fail(function(){ - $('#modal-loader').empty(); + $('#modal_dialog #modal-loader').empty(); }); } function get_task_details(todo_id){ $('#modal_dialog').modal('show'); - $('.modal-text').empty(); $('#modal-footer').empty(); + $('.modal-text').empty(); $('#modal_dialog .modal-footer').empty(); $('.modal-text').append(``); $.getJSON(`/api/listTodoNotes/?todo_id=${todo_id}&format=json`, function(data) { - $('.modal-text').empty(); $('#modal-footer').empty(); + $('.modal-text').empty(); $('#modal_dialog .modal-footer').empty(); note = data['notes'][0]; subdomain_name = ''; if (note['subdomain_name']) { subdomain_name = ' Subdomain: ' + note['subdomain_name'] + '
      '; } $('.modal-title').html(`${htmlEncode(note['title'])}`); - $('#modal-content').append(`

      ${subdomain_name} ${htmlEncode(note['description'])}

      `); + $('#modal_dialog .modal-text').append(`

      ${subdomain_name} ${htmlEncode(note['description'])}

      `); }); } diff --git a/web/static/custom/toolbox.js b/web/static/custom/toolbox.js index 527d0fc8f..35c18e8f6 100644 --- a/web/static/custom/toolbox.js +++ b/web/static/custom/toolbox.js @@ -54,8 +54,8 @@ function cms_detector_api_call(cmsDetectorUrl, url){ }).then(response => response.json()).then(function(response) { if (response.status) { swal.close(); - $('#modal_title').html('CMS Details for ' + url); - $('#modal-content').empty(); + $('#cmsDetectorResultModal .modal-title').html('CMS Details for ' + url); + $('#cmsDetectorResultModal .modal-body').empty(); content = `
      @@ -190,7 +190,7 @@ function cms_detector_api_call(cmsDetectorUrl, url){ content += '
      ' - $('#cmsDetectorResultModal #modal-content').append(content); + $('#cmsDetectorResultModal .modal-body').append(content); $('#cmsDetectorResultModal').modal('show'); } else { Swal.fire({ diff --git a/web/static/plugins/datatable/datatables.js b/web/static/plugins/datatable/datatables.js index 103f865c5..6b6866fcd 100644 --- a/web/static/plugins/datatable/datatables.js +++ b/web/static/plugins/datatable/datatables.js @@ -194,6 +194,6 @@ o.page()!=a.data.action&&o.page(a.data.action).draw("page")};l=0;for(h=f.length; /*! Bootstrap 4 integration for DataTables' Responsive * © SpryMedia Ltd - datatables.net/license */ -!function(n){var a,t;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-responsive"],function(e){return n(e,window,document)}):"object"==typeof exports?(a=require("jquery"),t=function(e,d){d.fn.dataTable||require("datatables.net-bs4")(e,d),d.fn.dataTable.Responsive||require("datatables.net-responsive")(e,d)},"undefined"==typeof window?module.exports=function(e,d){return e=e||window,d=d||a(e),t(e,d),n(d,0,e.document)}:(t(window,a),module.exports=n(a,window,window.document))):n(jQuery,window,document)}(function(r,e,s,d){"use strict";var n=r.fn.dataTable,a=n.Responsive.display,l=a.modal,u=r('