(form)
| 12773 | disabled: button.disabled, |
| 12774 | title: button.title |
| 12775 | }; |
| 12776 | deepScanButtonStates.set(ip, state); |
| 12777 | console.log(`💾 Saved deep scan button state for ${ip}:`, state); |
| 12778 | } |
| 12779 | } |
| 12780 | |
| 12781 | function restoreDeepScanButtonState(ip) { |
| 12782 | const buttonId = `deep-scan-btn-${ip.replace(/\./g, '-')}`; |
| 12783 | const button = document.getElementById(buttonId); |
| 12784 | const state = deepScanButtonStates.get(ip); |
| 12785 | |
| 12786 | if (button && state) { |
| 12787 | button.textContent = state.text; |
| 12788 | button.className = state.classes; |
| 12789 | button.disabled = state.disabled; |
| 12790 | button.title = state.title; |
| 12791 | button.dataset.scanStatus = state.status; |
| 12792 | console.log(`🔄 Restored deep scan button state for ${ip}:`, state); |
| 12793 | } else if (button && !state) { |
| 12794 | console.log(`⚠️ No saved state found for ${ip}, keeping default button state`); |
| 12795 | } |
| 12796 | } |
| 12797 | |
| 12798 | function clearDeepScanButtonState(ip) { |
| 12799 | if (deepScanButtonStates.has(ip)) { |
| 12800 | deepScanButtonStates.delete(ip); |
| 12801 | console.log(`🗑️ Cleared deep scan button state for ${ip}`); |
| 12802 | } |
| 12803 | } |
| 12804 | |
| 12805 | function cleanupOldDeepScanStates() { |
| 12806 | // Remove states for IPs that no longer have buttons in the DOM |
| 12807 | let cleanedCount = 0; |
| 12808 | for (const [ip] of deepScanButtonStates) { |
| 12809 | const buttonId = `deep-scan-btn-${ip.replace(/\./g, '-')}`; |
| 12810 | if (!document.getElementById(buttonId)) { |
| 12811 | deepScanButtonStates.delete(ip); |
| 12812 | cleanedCount++; |
| 12813 | } |
| 12814 | } |
| 12815 | if (cleanedCount > 0) { |
| 12816 | console.log(`🧹 Cleaned up ${cleanedCount} old deep scan button states`); |
| 12817 | } |
| 12818 | } |
| 12819 | |
| 12820 | // Real-time scanning control functions |
| 12821 | async function startRealtimeScan() { |
| 12822 | const startBtn = document.getElementById('start-network-scan'); |
| 12823 | const stopBtn = document.getElementById('stop-network-scan'); |
| 12824 |
no test coverage detected