MCPcopy Create free account
hub / github.com/adobe/Marinus / displayIPList

Function displayIPList

web_server/public/javascripts/meta.js:315–359  ·  view source on GitHub ↗
(json_results)

Source from the content-addressed store, hash-verified

313}
314
315function displayIPList(json_results) {
316 var old_tbody = document.getElementById("outputBody");
317 var new_tbody = document.createElement('tbody');
318
319 if (json_results.length >= LIMIT || PAGE > 1) {
320 document.getElementById("ipTableTitle").innerHTML = "<b>Port " + currentPort + " Results</b>" + add_paging_html("ip", displayIPList);
321 document.getElementById("prevPage-ip").addEventListener("click", port_page_back);
322 document.getElementById("nextPage-ip").addEventListener("click", port_page_forward);
323 document.getElementById("pageLimit-ip").addEventListener("change", function () { update_limit("ip") });
324 } else {
325 document.getElementById("ipTableTitle").innerHTML = "<b> Port " + currentPort + " Results</b>";
326 }
327
328 for (let i = 0; i < json_results.length; i++) {
329 var row = new_tbody.insertRow(0);
330 var cell1 = row.insertCell(0);
331 var cell2 = row.insertCell(1);
332 var cell3 = row.insertCell(2);
333 var cell4 = row.insertCell(3);
334 var cell5 = row.insertCell(4);
335 var cell6 = row.insertCell(5);
336 cell1.innerHTML = create_anchor("/ip?search=" + json_results[i]['ip'], json_results[i]['ip']);
337 cell2.innerHTML = "<img id='" + json_results[i]['ip'] + "-tracked-mark' src='/stylesheets/octicons/svg/x-24.svg'/><br/>";
338 cell2.style = "text-align:center";
339 cell3.innerHTML = "<img id='" + json_results[i]['ip'] + "-aws-mark' src='/stylesheets/octicons/svg/x-24.svg'/><br/>";
340 cell3.style = "text-align:center";
341 cell4.innerHTML = "<img id='" + json_results[i]['ip'] + "-azure-mark' src='/stylesheets/octicons/svg/x-24.svg'/><br/>";
342 cell4.style = "text-align:center";
343 cell5.innerHTML = "<img id='" + json_results[i]['ip'] + "-gcp-mark' src='/stylesheets/octicons/svg/x-24.svg'/><br/>";
344 cell5.style = "text-align:center";
345 cell6.innerHTML = "<span id='" + json_results[i]['ip'] + "-notes'></span><br/>";
346
347 if (json_results[i]['aws'] === true) {
348 check_aws_ip(json_results[i]['ip']);
349 } else if (json_results[i]['azure'] === true) {
350 check_azure_ip(json_results[i]['ip']);
351 } else if (json_results[i]['tracked'] === true) {
352 check_known_ip(json_results[i]['ip']);
353 } else if (json_results[i]['gcp'] === true) {
354 check_gcp_ip(json_results[i]['ip']);
355 }
356 }
357 old_tbody.parentNode.replaceChild(new_tbody, old_tbody)
358 new_tbody.id = "outputBody";
359}
360
361function getPortIPList() {
362 clearErrorHandler();

Callers

nothing calls this directly

Calls 7

add_paging_htmlFunction · 0.85
update_limitFunction · 0.85
create_anchorFunction · 0.85
check_aws_ipFunction · 0.85
check_azure_ipFunction · 0.85
check_known_ipFunction · 0.85
check_gcp_ipFunction · 0.85

Tested by

no test coverage detected