MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / saveConfig

Function saveConfig

web/scripts/ragnar_modern.js:12775–12821  ·  view source on GitHub ↗
(form)

Source from the content-addressed store, hash-verified

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
12781function 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
12798function clearDeepScanButtonState(ip) {
12799 if (deepScanButtonStates.has(ip)) {
12800 deepScanButtonStates.delete(ip);
12801 console.log(`🗑️ Cleared deep scan button state for ${ip}`);
12802 }
12803}
12804
12805function 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
12821async function startRealtimeScan() {
12822 const startBtn = document.getElementById('start-network-scan');
12823 const stopBtn = document.getElementById('stop-network-scan');
12824

Callers 1

displayConfigFormFunction · 0.70

Calls 4

errorMethod · 0.80
postAPIFunction · 0.70
addConsoleMessageFunction · 0.70
refreshDashboardFunction · 0.70

Tested by

no test coverage detected