(message, type = 'info')
| 11181 | addConsoleMessage(`Host ${ip} scan failed: ${data.error}`, 'error'); |
| 11182 | } |
| 11183 | } catch (error) { |
| 11184 | console.error('Error scanning host:', error); |
| 11185 | addConsoleMessage(`Host scan error: ${error.message}`, 'error'); |
| 11186 | } |
| 11187 | } |
| 11188 | |
| 11189 | function updateScanProgress() { |
| 11190 | const progressText = document.getElementById('scan-progress-text'); |
| 11191 | const progressBar = document.getElementById('scan-progress-bar'); |
| 11192 | const currentTarget = document.getElementById('current-scan-target'); |
| 11193 | |
| 11194 | const percentage = currentScanState.totalHosts > 0 ? |
| 11195 | (currentScanState.scannedHosts / currentScanState.totalHosts) * 100 : 0; |
| 11196 | |
| 11197 | if (progressText) { |
| 11198 | progressText.textContent = `${currentScanState.scannedHosts}/${currentScanState.totalHosts} hosts`; |
| 11199 | } |
| 11200 | |
| 11201 | if (progressBar) { |
| 11202 | progressBar.style.width = `${percentage}%`; |
| 11203 | } |
| 11204 | |
| 11205 | if (currentTarget) { |
| 11206 | currentTarget.textContent = currentScanState.currentTarget ? |
| 11207 | `Currently scanning: ${currentScanState.currentTarget}` : ''; |
| 11208 | } |
| 11209 | } |
| 11210 | |
| 11211 | function escapeSelector(value) { |
| 11212 | if (window.CSS && typeof CSS.escape === 'function') { |
| 11213 | return CSS.escape(value); |
no outgoing calls
no test coverage detected