From 0edd257a167c9eda7a425f107ce49fc985eda12c Mon Sep 17 00:00:00 2001 From: hPrnicessPi3 Date: Thu, 15 May 2025 18:05:07 -0600 Subject: [PATCH] v0.3-dev --- CHANGELOG.txt | 6 +++++- VERSION.txt | 2 +- index.php | 23 ++++++++++++++++++----- js/nmaprincesspi.js | 23 +++++++++++++++++++++-- run_clear_scans.php | 17 +++++++++++++++++ todo.txt | 5 +++-- 6 files changed, 65 insertions(+), 11 deletions(-) create mode 100644 run_clear_scans.php diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a8435e0..67f0ad3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,4 +4,8 @@ v0.1-dev v0.2-dev added polling system to monitor output added logs dir - refactored js \ No newline at end of file + refactored js + +v0.3-dev + added toggleable list of previous scans + added link to clear all old scans \ No newline at end of file diff --git a/VERSION.txt b/VERSION.txt index a7b0b36..aa63509 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -v0.2-dev \ No newline at end of file +v0.3-dev \ No newline at end of file diff --git a/index.php b/index.php index e164271..1581487 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,10 @@ - +$scan
\n"; +} +?> @@ -14,10 +20,17 @@
-

-
- +
+ Show Previous Scans +
+ +
+
+
+ \ No newline at end of file diff --git a/js/nmaprincesspi.js b/js/nmaprincesspi.js index 92fd010..f5abe69 100644 --- a/js/nmaprincesspi.js +++ b/js/nmaprincesspi.js @@ -6,6 +6,24 @@ function getID(ID) { return document.getElementById(ID); } +function toggleShow(ID, htmlUpdateID=false, htmlUpdateShowing=false, htmlUpdateHidden=false) { + let elemClasses = getID(ID).classList; + + if(elemClasses.contains('hidden')) { + elemClasses.remove('hidden'); + + if(htmlUpdateID !== false && htmlUpdateShowing !== false && htmlUpdateHidden !== false) { + getID(htmlUpdateID).innerHTML = htmlUpdateShowing; + } + } else { + elemClasses.add('hidden'); + + if(htmlUpdateID !== false && htmlUpdateShowing !== false && htmlUpdateHidden !== false) { + getID(htmlUpdateID).innerHTML = htmlUpdateHidden; + } + } +} + function copyToClipboard(ID) { let copyText = getID(ID); copyText.select(); @@ -72,7 +90,7 @@ function xhrRunNmapScan(xhrRet) { // let xhrResponseText = xhrRet.target.responseText; xhrJson = JSON.parse(xhrRet.target.responseText); - getID('link').innerHTML = 'Scan Report Here ('+xhrJson.webName+')'; + getID('link').innerHTML = 'Scan Report ('+xhrJson.webName+')'; getID('link').style.display = "inline"; if(typeof pollInterval !== 'undefined') { @@ -103,4 +121,5 @@ function runNmapScan() { let postData = 'nmapcmd='+encodeURIComponent(nmapcmd); doXhr('run_scan.php', xhrRunNmapScan, 'POST', postData); -} \ No newline at end of file +} + diff --git a/run_clear_scans.php b/run_clear_scans.php new file mode 100644 index 0000000..fce28af --- /dev/null +++ b/run_clear_scans.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/todo.txt b/todo.txt index d2d726f..d5c1477 100644 --- a/todo.txt +++ b/todo.txt @@ -8,8 +8,9 @@ error handling php script fail input validation fail containerize -scans listing -c work on scans filename? +x scans listing +clear scans buttons +x work on scans filename? fix perms auth system input/output validation