remove many unnecessary debug print, improve large entity handling

This commit is contained in:
overcuriousity
2025-09-17 13:31:35 +02:00
parent 469c133f1b
commit ec755b17ad
9 changed files with 57 additions and 121 deletions

View File

@@ -214,7 +214,6 @@ class GraphManager {
});
document.body.appendChild(this.contextMenu);
console.log('Context menu created and added to body');
}
/**
@@ -291,7 +290,6 @@ class GraphManager {
// FIXED: Right-click context menu
this.container.addEventListener('contextmenu', (event) => {
event.preventDefault();
console.log('Right-click detected at:', event.offsetX, event.offsetY);
// Get coordinates relative to the canvas
const pointer = {
@@ -300,7 +298,6 @@ class GraphManager {
};
const nodeId = this.network.getNodeAt(pointer);
console.log('Node at pointer:', nodeId);
if (nodeId) {
// Pass the original client event for positioning
@@ -341,19 +338,12 @@ class GraphManager {
// Stabilization events with progress
this.network.on('stabilizationProgress', (params) => {
const progress = params.iterations / params.total;
this.updateStabilizationProgress(progress);
});
this.network.on('stabilizationIterationsDone', () => {
this.onStabilizationComplete();
});
// Selection events
this.network.on('select', (params) => {
console.log('Selected nodes:', params.nodes);
console.log('Selected edges:', params.edges);
});
// Click away to hide context menu
document.addEventListener('click', (e) => {
if (!this.contextMenu.contains(e.target)) {
@@ -979,15 +969,6 @@ class GraphManager {
}, 2000);
}
/**
* Update stabilization progress
* @param {number} progress - Progress value (0-1)
*/
updateStabilizationProgress(progress) {
// Could show a progress indicator if needed
console.log(`Graph stabilization: ${(progress * 100).toFixed(1)}%`);
}
/**
* Handle stabilization completion
*/
@@ -1175,11 +1156,11 @@ class GraphManager {
adjacencyList
);
console.log(`Reachability analysis complete:`, {
/*console.log(`Reachability analysis complete:`, {
reachable: analysis.reachableNodes.size,
unreachable: analysis.unreachableNodes.size,
clusters: analysis.isolatedClusters.length
});
});*/
return analysis;
}
@@ -1294,7 +1275,6 @@ class GraphManager {
* Replaces the existing applyAllFilters() method
*/
applyAllFilters() {
console.log("Applying filters with enhanced reachability analysis...");
if (this.nodes.length === 0) return;
// Get filter criteria from UI
@@ -1350,23 +1330,10 @@ class GraphManager {
operation: 'hide_with_reachability',
timestamp: Date.now()
};
// Apply hiding with forensic documentation
const updates = nodesToHide.map(id => ({
id: id,
hidden: true,
forensicNote: `Hidden due to reachability analysis from ${nodeId}`
}));
this.nodes.update(updates);
this.addToHistory('hide', historyData);
console.log(`Forensic hide operation: ${nodesToHide.length} nodes hidden`, {
originalTarget: nodeId,
cascadeNodes: nodesToHide.length - 1,
isolatedClusters: analysis.isolatedClusters.length
});
return {
hiddenNodes: nodesToHide,
isolatedClusters: analysis.isolatedClusters
@@ -1449,9 +1416,7 @@ class GraphManager {
// Handle operation results
if (!operationFailed) {
this.addToHistory('delete', historyData);
console.log(`Forensic delete operation completed:`, historyData.forensicAnalysis);
this.addToHistory('delete', historyData);
return {
success: true,
deletedNodes: nodesToDelete,
@@ -1542,7 +1507,6 @@ class GraphManager {
e.stopPropagation();
const action = e.currentTarget.dataset.action;
const nodeId = e.currentTarget.dataset.nodeId;
console.log('Context menu action:', action, 'for node:', nodeId);
this.performContextMenuAction(action, nodeId);
this.hideContextMenu();
});
@@ -1562,9 +1526,7 @@ class GraphManager {
* UPDATED: Enhanced context menu actions using new methods
* Updates the existing performContextMenuAction() method
*/
performContextMenuAction(action, nodeId) {
console.log('Performing enhanced action:', action, 'on node:', nodeId);
performContextMenuAction(action, nodeId) {
switch (action) {
case 'focus':
this.focusOnNode(nodeId);

View File

@@ -120,7 +120,6 @@ class DNSReconApp {
max-width: 400px;
`;
document.body.appendChild(messageContainer);
console.log('Message container created');
}
}
@@ -135,7 +134,6 @@ class DNSReconApp {
this.initializeModalFunctionality();
this.elements.startScan.addEventListener('click', (e) => {
console.log('Start scan button clicked');
e.preventDefault();
this.startScan();
});
@@ -146,13 +144,11 @@ class DNSReconApp {
});
this.elements.stopScan.addEventListener('click', (e) => {
console.log('Stop scan button clicked');
e.preventDefault();
this.stopScan();
});
this.elements.exportResults.addEventListener('click', (e) => {
console.log('Export results button clicked');
e.preventDefault();
this.exportResults();
});
@@ -162,7 +158,6 @@ class DNSReconApp {
// Enter key support for target domain input
this.elements.targetInput.addEventListener('keypress', (e) => {
if (e.key === 'Enter' && !this.isScanning) {
console.log('Enter key pressed in domain input');
this.startScan();
}
});
@@ -287,12 +282,8 @@ class DNSReconApp {
force_rescan_target: forceRescanTarget
};
console.log('Request data:', requestData);
const response = await this.apiCall('/api/scan/start', 'POST', requestData);
console.log('API response received:', response);
if (response.success) {
this.currentSessionId = response.scan_id;
this.showSuccess('Reconnaissance scan started successfully');
@@ -345,7 +336,6 @@ class DNSReconApp {
if (response.success) {
this.showSuccess('Scan stop requested');
console.log('Scan stop requested successfully');
// Force immediate status update
setTimeout(() => {
@@ -414,7 +404,6 @@ class DNSReconApp {
}
this.pollInterval = setInterval(() => {
console.log('--- Polling tick ---');
this.updateStatus();
this.updateGraph();
this.loadProviders();
@@ -439,16 +428,11 @@ class DNSReconApp {
*/
async updateStatus() {
try {
console.log('Updating status...');
const response = await this.apiCall('/api/scan/status');
console.log('Status response:', response);
if (response.success && response.status) {
const status = response.status;
console.log('Current scan status:', status.status);
console.log('Current progress:', status.progress_percentage + '%');
console.log('Graph stats:', status.graph_statistics);
this.updateStatusDisplay(status);
@@ -478,7 +462,6 @@ class DNSReconApp {
console.log('Updating graph...');
const response = await this.apiCall('/api/graph');
console.log('Graph response:', response);
if (response.success) {
const graphData = response.graph;
@@ -527,9 +510,7 @@ class DNSReconApp {
* @param {Object} status - Status object from server
*/
updateStatusDisplay(status) {
try {
console.log('Updating status display...');
try {
// Update status text with animation
if (this.elements.scanStatus) {
const formattedStatus = this.formatStatus(status.status);
@@ -584,8 +565,6 @@ class DNSReconApp {
}
this.setUIState(status.status, status.task_queue_size);
console.log('Status display updated successfully');
} catch (error) {
console.error('Error updating status display:', error);
}
@@ -680,9 +659,7 @@ class DNSReconApp {
/**
* UI state management with immediate button updates
*/
setUIState(state, task_queue_size) {
console.log(`Setting UI state to: ${state}`);
setUIState(state, task_queue_size) {
const isQueueEmpty = task_queue_size === 0;
switch (state) {
@@ -743,7 +720,6 @@ class DNSReconApp {
*/
async loadProviders() {
try {
console.log('Loading providers...');
const response = await this.apiCall('/api/providers');
if (response.success) {
@@ -1401,7 +1377,6 @@ class DNSReconApp {
e.stopPropagation();
const nodeId = e.target.dataset.nodeId || e.target.getAttribute('data-node-id');
console.log('Node link clicked:', nodeId);
if (nodeId && this.graphManager && this.graphManager.nodes) {
const nextNode = this.graphManager.nodes.get(nodeId);
@@ -1758,7 +1733,6 @@ class DNSReconApp {
* @returns {Promise<Object>} Response data
*/
async apiCall(endpoint, method = 'GET', data = null) {
console.log(`Making API call: ${method} ${endpoint}`, data ? data : '(no data)');
try {
const options = {
@@ -1773,17 +1747,14 @@ class DNSReconApp {
console.log('Request body:', options.body);
}
console.log('Fetch options:', options);
const response = await fetch(endpoint, options);
console.log('Response status:', response.status, response.statusText);
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
const result = await response.json();
console.log('Response data:', result);
return result;
@@ -1917,9 +1888,7 @@ class DNSReconApp {
* @param {string} message - Message text
* @param {string} type - Message type (success, error, warning, info)
*/
showMessage(message, type = 'info') {
console.log(`${type.toUpperCase()}: ${message}`);
showMessage(message, type = 'info') {
// Create message element
const messageElement = document.createElement('div');
messageElement.className = `message-toast message-${type}`;