diff --git a/containers/libreportal/frontend/components/admin/config/js/config-core.js b/containers/libreportal/frontend/components/admin/config/js/config-core.js index ab9c43d..7618a87 100755 --- a/containers/libreportal/frontend/components/admin/config/js/config-core.js +++ b/containers/libreportal/frontend/components/admin/config/js/config-core.js @@ -21,33 +21,27 @@ class ConfigCore { } async loadConfig(category) { - //console.log(`ConfigCore: Loading ${category} config...`); if (this.cache.has('unified')) { - //console.log(`ConfigCore: Using cached unified config`); const cachedData = this.cache.get('unified'); window.configData = cachedData; // Make available globally return cachedData.subcategories || {}; } try { - //console.log(`ConfigCore: Fetching from /data/config/generated/configs.json`); const response = await fetch('/data/config/generated/configs.json'); - //console.log(`ConfigCore: Response status: ${response.status}`); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } const configData = await response.json(); - //console.log(`ConfigCore: Loaded config data:`, configData); this.cache.set('unified', configData); window.configData = configData; // Make available globally // Return the actual subcategories, not just the category metadata const categoryData = configData.subcategories || {}; - //console.log(`ConfigCore: Available subcategories:`, Object.keys(categoryData)); return categoryData; } catch (error) { diff --git a/containers/libreportal/frontend/components/admin/config/js/config-manager.js b/containers/libreportal/frontend/components/admin/config/js/config-manager.js index ba04ad4..ce88a87 100755 --- a/containers/libreportal/frontend/components/admin/config/js/config-manager.js +++ b/containers/libreportal/frontend/components/admin/config/js/config-manager.js @@ -1,6 +1,5 @@ // Config Manager - Main orchestrator for modular config system if (typeof window.ConfigManager === 'undefined') { - //console.log('ConfigManager: Defining new ConfigManager class...'); class ConfigManager { constructor() { @@ -17,7 +16,6 @@ if (typeof window.ConfigManager === 'undefined') { } async renderConfig(category) { - //console.log('ConfigManager: Rendering ' + category + ' config...'); const configSection = document.getElementById('config-section'); if (!configSection) { @@ -183,7 +181,6 @@ if (typeof window.ConfigManager === 'undefined') { var formHTML = ''; var self = this; // Preserve 'this' context - //console.log('ConfigManager: About to process configData entries:', Object.keys(configData)); // Filter subcategories by type const subcategoryTypes = this.utils.filterSubcategoriesByType(configData, category); @@ -191,10 +188,8 @@ if (typeof window.ConfigManager === 'undefined') { // Render regular subcategories for (const subcategoryName of subcategoryTypes.regular) { const subcategoryData = configData[subcategoryName]; - //console.log('ConfigManager: Processing regular subcategory:', subcategoryName, 'data:', subcategoryData); if (typeof subcategoryData === 'object' && subcategoryData !== null) { - //console.log('ConfigManager: Calling renderSubcategory for:', subcategoryName); formHTML += await self.renderSubcategory.call(self, category, subcategoryName, subcategoryData); } } @@ -202,7 +197,6 @@ if (typeof window.ConfigManager === 'undefined') { // Render advanced and unused sections formHTML = await this.utils.renderSectionedContent(formHTML, subcategoryTypes.advanced, subcategoryTypes.unused, self, category, configData); - //console.log('ConfigManager: Final formHTML length:', formHTML.length); if (formHTML) { // Page-level header for the config section. Mirrors the @@ -249,7 +243,6 @@ if (typeof window.ConfigManager === 'undefined') { } } - //console.log('ConfigManager: Successfully rendered ' + category + ' config'); // Force rediscover toggles to handle timing issues if (window.toggleManager && window.toggleManager.forceRediscover) { @@ -265,7 +258,6 @@ if (typeof window.ConfigManager === 'undefined') { } async renderSubcategory(category, subcategoryName, subcategoryData) { - //console.log('ConfigManager: renderSubcategory() called - category: ' + category + ', subcategory: ' + subcategoryName); var displaySubcategory = this.utils.formatSubcategoryName(subcategoryName); // Strip the parent-category prefix from the display title so the user @@ -295,65 +287,44 @@ if (typeof window.ConfigManager === 'undefined') { }); } - //console.log('ConfigManager: Processing subcategory:', subcategoryName, 'data:', subcategoryData); - //console.log('ConfigManager: configItems count: ' + configItems.length); - //console.log('ConfigManager: All config items keys:', configItems.map(item => item.key)); if (configItems.length === 0) { - //console.log('ConfigManager: No config items, returning empty string'); return ''; } - //console.log('ConfigManager: renderSubcategory called with:', { - //category, - //subcategoryName, - //displaySubcategory, - //hasData: !!subcategoryData - //}); // Check for master toggle in this subcategory var masterKey = configItems.find(function(item) { return item.master === true; }); - //console.log('ConfigManager: masterKey found: ' + !!masterKey, masterKey ? masterKey.key : null); // Look for any ENABLED options and use universal toggle renderer var enabledKey = configItems.find(function(item) { - //console.log('Checking item for ENABLED:', item.key, item.key.includes('ENABLED')); return item.key.includes('ENABLED') || item.key === 'CFG_INSTALL_MODE'; }); - //console.log('ConfigManager: enabledKey found: ' + !!enabledKey, enabledKey ? enabledKey.key : null); // Special handling for domains section var isDomains = subcategoryName.includes('domains') || subcategoryName.includes('network_domains'); - //console.log('ConfigManager: isDomains:', isDomains); // Special handling for IP whitelist section var isWhitelist = subcategoryName === 'network_whitelist' || subcategoryName.includes('whitelist'); - //console.log('ConfigManager: subcategoryName:', subcategoryName, 'isWhitelist:', isWhitelist); var resultHTML = ''; if (isDomains) { - //console.log('ConfigManager: Using domains renderer'); // Render domains section with special handling resultHTML = await this.domainManager.renderDomainsSection(configItems, displaySubcategory, subcategoryDescription); } else if (isWhitelist) { - //console.log('ConfigManager: Using whitelist renderer'); resultHTML = await this.whitelistManager.renderWhitelistSection(configItems, displaySubcategory, subcategoryDescription); } else if (enabledKey) { - //console.log('ConfigManager: Using universal toggle renderer'); // Use universal toggle renderer for any ENABLED option or CFG_INSTALL_MODE resultHTML = window.toggleManager ? window.toggleManager.renderToggleSection(enabledKey, configItems, displaySubcategory, subcategoryDescription) : ''; } else if (masterKey) { - //console.log('ConfigManager: Using master toggle renderer'); // Render with master toggle resultHTML = this.renderer.renderSubcategoryWithMaster(masterKey, configItems, displaySubcategory, subcategoryDescription); } else { - //console.log('ConfigManager: Using regular renderer'); // Render regular subcategory resultHTML = this.renderer.renderSubcategorySection(configItems, displaySubcategory, subcategoryDescription); } - //console.log('ConfigManager: resultHTML length:', resultHTML.length); return resultHTML; } @@ -383,5 +354,4 @@ if (typeof window.ConfigManager === 'undefined') { // Export to global scope window.ConfigManager = ConfigManager; } else { - //console.log('ConfigManager: Already exists, using existing instance'); } diff --git a/containers/libreportal/frontend/components/admin/config/js/config-sidebar.js b/containers/libreportal/frontend/components/admin/config/js/config-sidebar.js index ebc82bc..a54cec0 100755 --- a/containers/libreportal/frontend/components/admin/config/js/config-sidebar.js +++ b/containers/libreportal/frontend/components/admin/config/js/config-sidebar.js @@ -5,7 +5,6 @@ class ConfigSidebar { } populateSidebar() { - //console.log('ConfigSidebar: Populating sidebar with categories...'); this.categoriesList = document.getElementById('config-categories-list'); if (!this.categoriesList) { @@ -157,7 +156,6 @@ class ConfigSidebar { // Set initial active category this.setActiveCategory(window.configCategory || 'overview'); - //console.log('ConfigSidebar: Sidebar populated with ' + categoriesArray.length + ' categories'); } setActiveCategory(categoryId) { diff --git a/containers/libreportal/frontend/components/admin/config/js/config-utils.js b/containers/libreportal/frontend/components/admin/config/js/config-utils.js index 9151abc..cf1bd64 100755 --- a/containers/libreportal/frontend/components/admin/config/js/config-utils.js +++ b/containers/libreportal/frontend/components/admin/config/js/config-utils.js @@ -94,10 +94,8 @@ class ConfigUtils { for (const subcategoryName of unusedSubcategories) { const subcategoryData = configData[subcategoryName]; - //console.log('ConfigUtils: Processing unused subcategory:', subcategoryName, 'data:', subcategoryData); if (typeof subcategoryData === 'object' && subcategoryData !== null) { - //console.log('ConfigUtils: Calling renderSubcategory for:', subcategoryName); formHTML += await self.renderSubcategory.call(self, category, subcategoryName, subcategoryData); } } diff --git a/containers/libreportal/frontend/components/admin/config/js/config-validator.js b/containers/libreportal/frontend/components/admin/config/js/config-validator.js index 607c06b..141f2e5 100755 --- a/containers/libreportal/frontend/components/admin/config/js/config-validator.js +++ b/containers/libreportal/frontend/components/admin/config/js/config-validator.js @@ -35,7 +35,6 @@ window.ConfigValidator = function() { continue; } - //console.log(`Config file exists: ${config.name}`); } catch (error) { results.valid = false; diff --git a/containers/libreportal/frontend/components/admin/config/js/domain-manager.js b/containers/libreportal/frontend/components/admin/config/js/domain-manager.js index 189b9a3..126b344 100755 --- a/containers/libreportal/frontend/components/admin/config/js/domain-manager.js +++ b/containers/libreportal/frontend/components/admin/config/js/domain-manager.js @@ -13,7 +13,6 @@ class DomainManager { } return false; } catch (error) { - //console.log('DomainManager: Traefik status check failed, assuming not installed:', error.message); return false; } } @@ -192,7 +191,6 @@ class DomainManager { } addNewDomain() { - //console.log('Add Domain button clicked!'); try { // Find the highest existing domain number @@ -208,7 +206,6 @@ class DomainManager { // Check if we've reached the maximum of 9 domains (count only existing domains, not empty slots) if (domainNumbers.length >= 9) { - //console.log('Maximum of 9 domains reached'); return; } @@ -258,7 +255,6 @@ class DomainManager { console.error('DomainManager not available for deleteDomain'); return; } - //console.log(`Delete domain button clicked for: ${domainKey}`); try { // Find the domain-building-block and remove it @@ -324,7 +320,6 @@ class DomainManager { // Standalone domain management functions - immediately available window.addDomain = function() { - //console.log('Add Domain button clicked!'); try { // Before adding new domain, validate that all existing domains have valid format @@ -357,7 +352,6 @@ window.addDomain = function() { // Check if we've reached the maximum of 9 domains if (domainNumbers.length >= 9) { - //console.log('Maximum of 9 domains reached'); return; } @@ -408,7 +402,6 @@ window.addDomain = function() { }; window.deleteDomain = function(domainKey, buttonElement) { - //console.log(`Delete domain button clicked for: ${domainKey}`); try { // Find the domain-building-block and remove it @@ -506,15 +499,12 @@ function updateAddDomainButton() { // Validate domain format when user tries to add a new domain function validateDomainFormat(input, showNotifications = true) { const value = input.value.trim(); - //console.log('validateDomainFormat called with:', value, 'showNotifications:', showNotifications); - //console.log('window.notificationSystem available:', !!window.notificationSystem); if (!value) { // Clear styling for empty fields input.style.borderColor = '#dc3545'; input.title = 'Domain cannot be empty'; if (showNotifications && window.notificationSystem) { - //console.log('Attempting to show empty domain notification'); window.notificationSystem.error('Domain cannot be empty'); } else { console.error('Domain cannot be empty - notification system not available'); @@ -537,7 +527,6 @@ function validateDomainFormat(input, showNotifications = true) { input.style.borderColor = '#dc3545'; input.title = 'Invalid domain format (e.g., example.com)'; if (showNotifications && window.notificationSystem) { - //console.log('Attempting to show invalid format notification'); window.notificationSystem.error('Invalid domain format: "' + value + '". Please use a valid domain like example.com'); } else { console.error('Invalid domain format - notification system not available'); @@ -547,7 +536,6 @@ function validateDomainFormat(input, showNotifications = true) { input.style.borderColor = '#dc3545'; input.title = 'Domain already exists'; if (showNotifications && window.notificationSystem) { - //console.log('Attempting to show duplicate notification'); window.notificationSystem.error('Domain "' + value + '" already exists'); } else { console.error('Domain already exists - notification system not available'); @@ -609,7 +597,6 @@ function checkForInvalidDomainFormat(input, domainValue) { input.style.borderColor = '#dc3545'; input.title = 'Invalid domain format (e.g., example.com)'; if (window.notificationSystem) { - //console.log('Showing invalid domain format notification'); window.notificationSystem.error('Invalid domain format: "' + domainValue + '". Please use a valid domain like example.com'); } else { console.error('Invalid domain format - notification system not available'); @@ -634,7 +621,6 @@ function checkForDuplicateDomain(input, domainValue) { input.style.borderColor = '#dc3545'; input.title = 'Domain already exists'; if (window.notificationSystem) { - //console.log('Showing duplicate domain notification'); window.notificationSystem.error('Domain "' + domainValue + '" already exists'); } else { console.error('Domain already exists - notification system not available'); diff --git a/containers/libreportal/frontend/components/admin/config/js/ip-whitelist-manager.js b/containers/libreportal/frontend/components/admin/config/js/ip-whitelist-manager.js index a0ced79..391b424 100755 --- a/containers/libreportal/frontend/components/admin/config/js/ip-whitelist-manager.js +++ b/containers/libreportal/frontend/components/admin/config/js/ip-whitelist-manager.js @@ -140,22 +140,18 @@ class IPWhitelistManager { try { // Get only the visible whitelist input values (exclude hidden input) const whitelistInputs = document.querySelectorAll('input[name="CFG_IPS_WHITELIST"]:not([type="hidden"])'); - //console.log('saveWhitelistEntries: Found inputs:', whitelistInputs.length); whitelistInputs.forEach((input, index) => { - //console.log(` Input ${index}: id="${input.id}", value="${input.value}"`); }); const values = Array.from(whitelistInputs) .map(input => input.value.trim()) .filter(value => value.length > 0); // Filter out empty values - //console.log('saveWhitelistEntries: Filtered values:', values); // Find the hidden CFG_IPS_WHITELIST input and update it const hiddenInput = document.querySelector('input[name="CFG_IPS_WHITELIST"][type="hidden"]'); if (hiddenInput) { hiddenInput.value = values.join(', '); - //console.log('Saved whitelist values:', values.join(', ')); } } catch (error) { console.error('Error saving whitelist entries:', error); @@ -164,7 +160,6 @@ class IPWhitelistManager { // Validate individual whitelist entry validateWhitelistEntry(input, showNotifications = true) { - //console.log('validateWhitelistEntry called with:', input.value, 'showNotifications:', showNotifications); const value = input.value.trim(); @@ -174,14 +169,12 @@ class IPWhitelistManager { input.title = ''; if (!value) { - //console.log('Empty value - allowing for now'); // Empty is allowed for now (validation happens on add) return true; } // Special case for localhost if (value.toLowerCase() === 'localhost') { - //console.log('localhost detected - valid'); return true; } @@ -195,15 +188,8 @@ class IPWhitelistManager { const isValidDomain = domainPattern.test(value); const isValidFormat = isValidIP || isValidDomain || value.toLowerCase() === 'localhost'; - //console.log('Format validation:', { - //value: value, - //isValidIP: isValidIP, - //isValidDomain: isValidDomain, - //isValidFormat: isValidFormat - //}); if (!isValidFormat) { - //console.log('Invalid format detected - showing error'); // Flash the input field input.style.animation = 'whitelist-flash 0.5s ease-in-out 2'; input.focus(); @@ -213,10 +199,8 @@ class IPWhitelistManager { // Show notification if (showNotifications && window.notificationSystem) { - //console.log('Showing notification for invalid format'); window.notificationSystem.error(`Invalid whitelist format: "${value}". Please use a valid IP address, domain (e.g., example.com), or localhost`); } else { - //console.log('Notification system not available or showNotifications is false'); } input.title = 'Invalid IP address, domain, or localhost format (e.g., 192.168.1.100, example.com, or localhost)'; @@ -225,7 +209,6 @@ class IPWhitelistManager { // Check for duplicates const allWhitelistInputs = document.querySelectorAll('input[name="CFG_IPS_WHITELIST"]:not([type="hidden"])'); - //console.log('Checking for duplicates among', allWhitelistInputs.length, 'inputs'); const duplicates = []; @@ -238,10 +221,8 @@ class IPWhitelistManager { } }); - //console.log('Found duplicates:', duplicates); if (duplicates.length > 0) { - //console.log('Duplicate detected - showing error'); // Flash the input field input.style.animation = 'whitelist-flash 0.5s ease-in-out 2'; input.focus(); @@ -251,7 +232,6 @@ class IPWhitelistManager { // Show notification if (showNotifications && window.notificationSystem) { - //console.log('Showing notification for duplicate'); window.notificationSystem.error(`"${value}" already exists in the whitelist`); } @@ -260,7 +240,6 @@ class IPWhitelistManager { } // Valid entry - save it - //console.log('Valid entry - saving'); this.saveWhitelistEntries(); return true; } @@ -303,18 +282,15 @@ class IPWhitelistManager { } return false; } catch (error) { - //console.log('Traefik check failed:', error.message); return false; } } // Add new whitelist entry addWhitelistEntry() { - //console.log('Add whitelist entry button clicked!'); try { // Before adding new entry, validate that all existing entries have valid format - //console.log('About to call validateBeforeAddWhitelist()'); // Test if the function exists if (typeof this.validateBeforeAddWhitelist !== 'function') { @@ -323,14 +299,11 @@ class IPWhitelistManager { } const canAdd = this.validateBeforeAddWhitelist(); - //console.log('validateBeforeAddWhitelist() returned:', canAdd); if (!canAdd) { - //console.log('Validation failed - not adding new entry'); return; // Validation failed, don't add new entry } - //console.log('Validation passed - proceeding with add'); // Find the hidden CFG_IPS_WHITELIST input const hiddenInput = document.querySelector('input[name="CFG_IPS_WHITELIST"]'); @@ -345,12 +318,9 @@ class IPWhitelistManager { .map(entry => entry.trim()) .filter(entry => entry.length > 0); // Don't filter out empty strings for counting - //console.log('Current values:', currentValues); - //console.log('Current values length:', currentValues.length); // Check if we've reached the maximum if (currentValues.length >= this.maxWhitelistEntries) { - //console.log('Maximum of ' + this.maxWhitelistEntries + ' whitelist entries reached'); return; } @@ -372,13 +342,11 @@ class IPWhitelistManager { const highestNumber = allNumbers.length > 0 ? Math.max(...allNumbers) : 0; const newEntryNumber = highestNumber + 1; - //console.log('Highest existing number:', highestNumber, 'New entry number:', newEntryNumber); currentValues.push(''); // Update the hidden input hiddenInput.value = currentValues.join(', '); - //console.log('Updated hidden input to:', hiddenInput.value); // Create new entry HTML and add to DOM const newEntryHTML = ` @@ -406,41 +374,31 @@ class IPWhitelistManager { // Add the new entry to the DOM const whitelistContainer = document.querySelector('.whitelist-building-blocks'); - //console.log('Step 1: Found whitelist container:', !!whitelistContainer); if (whitelistContainer) { // Remove empty state if it exists const emptyState = whitelistContainer.querySelector('.whitelist-empty-state'); - //console.log('Step 2: Found empty state:', !!emptyState); if (emptyState) { emptyState.remove(); - //console.log('Step 3: Removed empty state'); } // Add new entry const tempDiv = document.createElement('div'); tempDiv.innerHTML = newEntryHTML; const newBlock = tempDiv.firstElementChild; - //console.log('Step 4: Created new block:', !!newBlock); whitelistContainer.appendChild(newBlock); - //console.log('Step 5: Added new block to container'); // Focus on the new input const newInput = newBlock.querySelector('input'); - //console.log('Step 6: Found new input:', !!newInput); if (newInput) { newInput.focus(); - //console.log('Step 7: Focused new input'); } // Update add button state this.updateAddEntryButton(); - //console.log('Step 8: Updated add button state'); - //console.log('Step 9: Add function completed successfully'); } else { - //console.log('Step 1: Whitelist container not found!'); } } catch (error) { @@ -450,14 +408,11 @@ class IPWhitelistManager { // Check if all entries are valid before allowing new entry addition validateBeforeAddWhitelist() { - //console.log('=== validateBeforeAddWhitelist START ==='); // Simple test - just check for empty entries const allInputs = document.querySelectorAll('input[name="CFG_IPS_WHITELIST"]:not([type="hidden"])'); - //console.log('Found', allInputs.length, 'inputs'); allInputs.forEach((input, index) => { - //console.log(`Input ${index}: value="${input.value}"`); }); for (const input of allInputs) { @@ -465,7 +420,6 @@ class IPWhitelistManager { // Check if entry is empty if (!entryValue) { - //console.log('Found empty entry - blocking add'); // Flash the empty input field input.style.animation = 'whitelist-flash 0.5s ease-in-out 2'; input.focus(); @@ -477,26 +431,20 @@ class IPWhitelistManager { if (window.notificationSystem) { window.notificationSystem.error('Whitelist entry cannot be empty'); } - //console.log('=== validateBeforeAddWhitelist END (false - empty) ==='); return false; } // Check entry format with notification (always show) if (this.checkForInvalidWhitelistFormat(input, entryValue, false)) { - //console.log('Found invalid format - blocking add'); - //console.log('=== validateBeforeAddWhitelist END (false - invalid) ==='); return false; } // Check for duplicates with notification (always show) if (this.checkForDuplicateWhitelistEntry(input, entryValue)) { - //console.log('Found duplicate entry - blocking add'); - //console.log('=== validateBeforeAddWhitelist END (false - duplicate) ==='); return false; } } - //console.log('=== validateBeforeAddWhitelist END (true) ==='); return true; } @@ -550,12 +498,6 @@ class IPWhitelistManager { const isValidIP = ipPattern.test(entryValue) || ipv6Pattern.test(entryValue); const isValidDomain = domainPattern.test(entryValue); - //console.log('checkForInvalidWhitelistFormat validation:', { - //entryValue: entryValue, - //isValidIP: isValidIP, - //isValidDomain: isValidDomain, - //isValidFormat: isValidIP || isValidDomain || entryValue.toLowerCase() === 'localhost' - //}); if (!isValidIP && !isValidDomain) { // Flash the input field @@ -579,7 +521,6 @@ class IPWhitelistManager { // Delete whitelist entry deleteWhitelistEntry(entryIndex, buttonElement) { - //console.log(`Delete whitelist entry button clicked for index: ${entryIndex}`); try { // Get the actual whitelist number from the input ID @@ -599,7 +540,6 @@ class IPWhitelistManager { const match = inputId.match(/config-CFG_IPS_WHITELIST_(\d+)/); const whitelistNumber = match ? parseInt(match[1]) : 0; - //console.log(`Actual whitelist number: ${whitelistNumber}`); // Find all whitelist numbers to determine the highest const allBlocks = document.querySelectorAll('.whitelist-building-block'); @@ -616,11 +556,9 @@ class IPWhitelistManager { }); const highestNumber = Math.max(...allNumbers); - //console.log(`Highest whitelist number: ${highestNumber}`); // Only allow deletion if this is the highest numbered entry AND it's not #1 if (whitelistNumber === 1) { - //console.log('Cannot delete entry #1'); if (window.notificationSystem) { window.notificationSystem.error('Entry 1 cannot be deleted'); } @@ -628,7 +566,6 @@ class IPWhitelistManager { } if (whitelistNumber !== highestNumber) { - //console.log('Can only delete the highest numbered entry'); if (window.notificationSystem) { window.notificationSystem.error('Can only delete the highest numbered entry'); } @@ -640,7 +577,6 @@ class IPWhitelistManager { // Remove the building block from DOM entryBlock.remove(); - //console.log('Removed entry block from DOM'); // Update the hidden input with remaining values this.saveWhitelistEntries(); @@ -827,7 +763,6 @@ function checkForDuplicateWhitelistEntry(input, entryValue) { input.style.borderColor = '#dc3545'; input.title = 'Whitelist entry already exists'; if (window.notificationSystem) { - //console.log('Showing duplicate whitelist entry notification'); window.notificationSystem.error('Whitelist entry "' + entryValue + '" already exists'); } else { console.error('Whitelist entry already exists - notification system not available'); @@ -855,7 +790,6 @@ function checkForInvalidWhitelistFormat(input, entryValue) { input.style.borderColor = '#dc3545'; input.title = 'Invalid IP address or domain format (e.g., 192.168.1.100 or example.com)'; if (window.notificationSystem) { - //console.log('Showing invalid whitelist format notification'); window.notificationSystem.error('Invalid whitelist format: "' + entryValue + '". Please use a valid IP address or domain like 192.168.1.100 or example.com'); } else { console.error('Invalid whitelist format - notification system not available'); @@ -869,15 +803,12 @@ function checkForInvalidWhitelistFormat(input, entryValue) { // Validate whitelist entry format when user tries to add a new entry function validateWhitelistEntry(input, showNotifications = true) { const value = input.value.trim(); - //console.log('validateWhitelistEntry called with:', value, 'showNotifications:', showNotifications); - //console.log('window.notificationSystem available:', !!window.notificationSystem); if (!value) { // Clear styling for empty fields input.style.borderColor = '#dc3545'; input.title = 'Whitelist entry cannot be empty'; if (showNotifications && window.notificationSystem) { - //console.log('Attempting to show empty whitelist notification'); window.notificationSystem.error('Whitelist entry cannot be empty'); } else { console.error('Whitelist entry cannot be empty - notification system not available'); @@ -905,7 +836,6 @@ function validateWhitelistEntry(input, showNotifications = true) { input.style.borderColor = '#dc3545'; input.title = 'Invalid IP address, domain, or localhost format (e.g., 192.168.1.100, example.com, or localhost)'; if (showNotifications && window.notificationSystem) { - //console.log('Attempting to show invalid whitelist format notification'); window.notificationSystem.error('Invalid whitelist format: "' + value + '". Please use a valid IP address, domain, or localhost like 192.168.1.100, example.com, or localhost'); } else { console.error('Invalid whitelist format - notification system not available'); diff --git a/containers/libreportal/frontend/components/admin/config/js/toggle-manager.js b/containers/libreportal/frontend/components/admin/config/js/toggle-manager.js index 3d508f0..095d7fc 100755 --- a/containers/libreportal/frontend/components/admin/config/js/toggle-manager.js +++ b/containers/libreportal/frontend/components/admin/config/js/toggle-manager.js @@ -6,19 +6,15 @@ class ToggleManager { } init() { - //console.log('ToggleManager: Initializing...'); // Auto-discover all toggle configurations this.discoverToggles(); - //console.log('ToggleManager: Discovered', this.toggles.size, 'toggle configurations'); // Debug: Log discovered toggles if (this.toggles.size > 0) { - //console.log('ToggleManager: No toggles found - will retry after config loads...'); // Set up a mutation observer to detect when config content is added this.setupContentObserver(); } else { - //console.log('ToggleManager: Discovered toggles:', Array.from(this.toggles.keys())); } // Also set up observer in case more toggles are added later @@ -26,7 +22,6 @@ class ToggleManager { // Retry discovery after a short delay to handle timing issues setTimeout(() => { - //console.log('ToggleManager: Retrying toggle discovery...'); this.rediscoverToggles(); }, 100); } @@ -40,7 +35,6 @@ class ToggleManager { const newToggles = Array.from(mutation.addedNodes).filter(node => node.nodeType === Node.ELEMENT_NODE && (node.dataset?.toggleConfig || node.querySelector('[data-toggle-config]'))); if (newToggles.length > 0) { - //console.log('ToggleManager: New toggle elements detected, re-discovering...'); this.rediscoverToggles(); observer.disconnect(); // Stop observing once we find toggles } @@ -60,35 +54,24 @@ class ToggleManager { // Re-discover toggles (called after content is loaded) rediscoverToggles() { - //console.log('ToggleManager: Re-discovering toggles...'); this.toggles.clear(); // Clear existing toggles this.discoverToggles(); - //console.log('ToggleManager: Re-discovered', this.toggles.size, 'toggle configurations'); if (this.toggles.size > 0) { - //console.log('ToggleManager: Successfully discovered toggles:', Array.from(this.toggles.keys())); } } // Auto-discover toggle configurations from the page discoverToggles() { - //console.log('ToggleManager: Looking for elements with [data-toggle-config]...'); // Find all elements with data-toggle-config attribute const toggleElements = document.querySelectorAll('[data-toggle-config]'); - //console.log('ToggleManager: Found', toggleElements.length, 'elements with data-toggle-config'); toggleElements.forEach((element, index) => { const config = element.dataset.toggleConfig; const sectionId = element.dataset.sectionId; const toggleType = element.dataset.toggleType || 'checkbox'; - //console.log(`ToggleManager: Processing element ${index}:`, { - //config: config, - //sectionId: sectionId, - //toggleType: toggleType, - //element: element.tagName + (element.id ? '#' + element.id : '') + (element.name ? '[name=' + element.name + ']' : '') - //}); if (config && sectionId) { this.toggles.set(config, { @@ -97,18 +80,13 @@ class ToggleManager { toggleType: toggleType, element: element }); - //console.log(`ToggleManager: Registered toggle for config: ${config}`); } else { - //console.log(`ToggleManager: Skipping element - missing config or sectionId`); } }); } // Universal toggle function - works for any config option toggle(configKey, isEnabled) { - //console.log('=== TOGGLE MANAGER DEBUG ==='); - //console.log('configKey:', configKey); - //console.log('isEnabled:', isEnabled); const toggle = this.toggles.get(configKey); if (!toggle) { @@ -116,20 +94,15 @@ class ToggleManager { return false; } - //console.log('Toggle found:', toggle); const sectionContent = document.getElementById(toggle.sectionId); const fields = sectionContent?.querySelectorAll('.config-fields input, .config-fields select, .config-fields textarea'); - //console.log('sectionContent found:', !!sectionContent); - //console.log('fields found:', fields ? fields.length : 0); if (sectionContent && fields) { if (isEnabled) { - //console.log('Enabling section...'); sectionContent.classList.remove('hidden'); fields.forEach((field, index) => { - //console.log(`Enabling field ${index}:`, field); field.disabled = false; const fieldGroup = field?.closest('.field-group'); if (fieldGroup) { @@ -138,10 +111,8 @@ class ToggleManager { } }); } else { - //console.log('Disabling section...'); sectionContent.classList.add('hidden'); fields.forEach((field, index) => { - //console.log(`Disabling field ${index}:`, field); field.disabled = true; const fieldGroup = field?.closest('.field-group'); if (fieldGroup) { @@ -151,7 +122,6 @@ class ToggleManager { }); } - //console.log('=== TOGGLE MANAGER SUCCESS ==='); return true; } else { console.error('ToggleManager: Section content or fields not found'); @@ -300,7 +270,6 @@ window.toggleManager.renderToggleSection = ToggleManager.renderToggleSection; // Add method to manually trigger discovery when config is loaded window.toggleManager.forceRediscover = function() { - //console.log('ToggleManager: Force re-discovering toggles...'); window.toggleManager.rediscoverToggles(); }; diff --git a/containers/libreportal/frontend/components/apps/core/js/app-tabbed-manager.js b/containers/libreportal/frontend/components/apps/core/js/app-tabbed-manager.js index 8cae508..b61029f 100755 --- a/containers/libreportal/frontend/components/apps/core/js/app-tabbed-manager.js +++ b/containers/libreportal/frontend/components/apps/core/js/app-tabbed-manager.js @@ -3,9 +3,6 @@ class AppTabbedManager { constructor() { - // console.log('🔍 AppTabbedManager constructor called'); - // console.log('🔍 URL in constructor:', window.location.href); - // console.log('🔍 Search params in constructor:', window.location.search); // Store original URL for task parameter detection this.originalUrl = window.location.href; @@ -13,22 +10,18 @@ class AppTabbedManager { // Check sessionStorage for task parameter (fallback) const sessionTaskId = sessionStorage.getItem('pendingTaskId'); - // console.log('🔍 Session storage task ID:', sessionTaskId); // Debug: Check if task parameter exists in original URL const originalParams = new URLSearchParams(this.originalSearch); const originalTaskId = originalParams.get('task'); - // console.log('🔍 Original task ID in constructor:', originalTaskId); // Try to get task parameter from performance navigation if available if (performance && performance.getEntriesByType) { const navigationEntries = performance.getEntriesByType('navigation'); if (navigationEntries.length > 0) { const navEntry = navigationEntries[0]; - // console.log('🔍 Navigation entry URL:', navEntry.name); const navParams = new URLSearchParams(new URL(navEntry.name).search); const navTaskId = navParams.get('task'); - // console.log('🔍 Navigation task ID:', navTaskId); } } @@ -69,7 +62,6 @@ class AppTabbedManager { setCurrentApp(appName) { if (this.currentApp === appName) return; - // console.log('🔄 setCurrentApp: switching from %s to %s', this.currentApp, appName); this.currentApp = appName; // Before clearing disabled button references, restore any static backup action buttons @@ -89,7 +81,6 @@ class AppTabbedManager { this.enableTabs(); const running = this.getRunningTaskForApp(appName); - // console.log('🔍 setCurrentApp: running task for %s = %o', appName, running); if (running) { this.activeTaskId = running.taskId; } @@ -109,7 +100,6 @@ class AppTabbedManager { } } - // console.log('🔍 Original app name from URL:', appName); // Convert full app name to slug for task filtering if (appName && window.apps) { @@ -124,14 +114,11 @@ class AppTabbedManager { const command = appData.command || ''; const parts = command.split(' '); const slug = parts[parts.length - 1]; // Return the slug - // console.log('🔄 Converted to slug:', slug, 'from appData:', appData.name); return slug; } else { - // console.log('⚠️ No app data found for:', appName); } } - // console.log('🔄 Returning original app name:', appName); return appName; } @@ -210,10 +197,6 @@ class AppTabbedManager { // Switch between tabs switchTab(tabId) { - // console.log('🔄 switchTab called with:', tabId); - // console.log('🔍 Current currentApp before switch:', this.currentApp); - // console.log('🔍 Current URL when switching:', window.location.href); - // console.log('🔍 URL search when switching:', window.location.search); // Remove active class from all main navigation tabs document.querySelectorAll('.main-tab-button').forEach(btn => { @@ -245,12 +228,10 @@ class AppTabbedManager { // Update URL (only tab, not app) - but only on app pages if (this.isAppPage()) { - // console.log('🔄 About to updateURL with tab:', tabId); this.updateURL(null, tabId); } // Load tab-specific content - // console.log('🔄 About to load tab content for tab:', tabId, 'with currentApp:', this.currentApp); this.loadTabContent(tabId); } @@ -259,8 +240,6 @@ class AppTabbedManager { const actualTabId = tabId === 'logs' ? 'tasks' : tabId; const currentAppFromUrl = this.getAppFromURL(); - // console.log('📂 loadTabContent: tabId=%s, currentApp=%s, fromUrl=%s', - // tabId, this.currentApp, currentAppFromUrl); // Update currentApp if URL has different app name. Route through setCurrentApp // so any disable state from the previous app gets cleared before we render. @@ -297,7 +276,6 @@ class AppTabbedManager { // Make sure app detail view is visible and app is loaded if (window.appsManager) { // Use showAppDetail to ensure proper initialization (same as config tab) - // console.log('🔄 Ensuring app detail is loaded for:', this.currentApp); window.appsManager.showAppDetail(this.currentApp); // Wait a bit for DOM to be ready after app detail is rendered @@ -306,11 +284,9 @@ class AppTabbedManager { switch (actualTabId) { case 'tasks': - // console.log('🔄 loadTabContent: Loading tasks for app:', this.currentApp); await this.loadAppTasks(); break; case 'backups': - // console.log('🔄 loadTabContent: Loading backups for app:', this.currentApp); await this.loadAppBackups(); // IMPORTANT: Re-apply button state if there are running tasks this.restoreButtonState(); @@ -335,7 +311,6 @@ class AppTabbedManager { break; case 'config': // Config is already handled by showAppDetail above - // console.log('🔧 Config content already loaded by showAppDetail'); // IMPORTANT: Re-apply button state if there are running tasks this.restoreButtonState(); break; @@ -355,7 +330,6 @@ class AppTabbedManager { // Load tasks specific to current app async loadAppTasks() { - // console.log('🔄 loadAppTasks called, currentApp:', this.currentApp); // Show loading spinner by showing the initial loading state const tasksContainer = document.getElementById('app-tasks'); @@ -398,32 +372,20 @@ class AppTabbedManager { try { // Load all tasks - // console.log('🔄 Loading tasks...'); - // console.log('🔍 Using currentApp for filtering:', this.currentApp); await this.tasksManager.loadTasks(); const allTasks = this.tasksManager.tasks || []; - // console.log('📊 All tasks loaded:', allTasks.length); - // console.log('📋 All tasks data:', allTasks); - // console.log('📋 Sample task app names:', allTasks.slice(0, 3).map(t => t.app)); // Filter tasks for current app const appTasks = allTasks.filter(task => task.app === this.currentApp); - // console.log('🎯 Filtering tasks for app:', this.currentApp); - // console.log('📋 Available task.app values:', [...new Set(allTasks.map(t => t.app))]); - // console.log('🎯 Filtered tasks for', this.currentApp, ':', appTasks.length); // Debug: Show what would match if we used different app names - // console.log('🔍 Debug - Testing different app names:'); ['libreportal', 'fail2ban', 'LibrePortal', 'Fail2Ban'].forEach(testApp => { const testTasks = allTasks.filter(task => task.app === testApp); - // console.log(` - "${testApp}": ${testTasks.length} tasks`); }); if (appTasks.length === 0) { - // console.log('⚠️ No tasks found for', this.currentApp, '- checking if tasks have different app names'); // Show some task details for debugging if (allTasks.length > 0) { - // console.log('📋 Sample tasks:', allTasks.slice(0, 3).map(t => ({ id: t.id, app: t.app, command: t.command }))); } tasksContainer.innerHTML = `
No tasks found for ${this.currentApp}.
`; return; @@ -441,10 +403,8 @@ class AppTabbedManager { // Handle pending task ID from URL parameter if (this.pendingTaskId) { - // console.log('🔍 Handling pending task ID after tasks loaded:', this.pendingTaskId); setTimeout(() => { if (typeof window.toggleAppTaskDetails === 'function') { - // console.log('🔍 Opening task details for pending task:', this.pendingTaskId); window.toggleAppTaskDetails(this.pendingTaskId); // Scroll to the task element after opening details @@ -466,7 +426,6 @@ class AppTabbedManager { // Scroll to specific task element with smooth animation scrollToTask(taskId) { - // console.log('🔍 Scrolling to task:', taskId); // Find the task element by ID or data attribute let taskElement = document.getElementById(`task-${taskId}`); @@ -485,7 +444,6 @@ class AppTabbedManager { } if (taskElement) { - // console.log('🔍 Found task element, scrolling to it:', taskElement); // Smooth scroll to the task element taskElement.scrollIntoView({ @@ -511,7 +469,6 @@ class AppTabbedManager { setupAppTaskFunctions() { // Create app-specific toggleTaskDetails function window.toggleAppTaskDetails = (taskId) => { - // console.log('🔍 App-specific toggleTaskDetails called for:', taskId); const details = document.getElementById(`details-${taskId}`); const toggleBtn = document.querySelector(`.task-btn.toggle-details[onclick*="toggleTaskDetails('${taskId}')"]`); @@ -599,11 +556,9 @@ class AppTabbedManager { async initialize() { // Prevent double initialization if (this.initialized) { - // console.log('⚠️ AppTabbedManager already initialized, skipping'); return; } - // console.log('🚀 AppTabbedManager initializing, currentApp:', this.currentApp); // Initialize task system if not already done (with retry) if (this.tasksManager && !this.tasksManager.commands) { @@ -612,11 +567,9 @@ class AppTabbedManager { const maxAttempts = 5; while (!initialized && attempts < maxAttempts) { - // console.log(`🔄 Attempting to initialize task system (${attempts + 1}/${maxAttempts})...`); try { initialized = this.tasksManager.initializeTaskSystem(); if (initialized) { - // console.log('✅ Task system initialized successfully'); } } catch (error) { console.error('❌ Task system initialization error:', error); @@ -670,7 +623,6 @@ class AppTabbedManager { // Set current app from URL BEFORE setting up URL monitoring const urlAppName = this.getAppFromURL(); - // console.log('🔍 Setting initial currentApp from URL:', urlAppName); this.currentApp = urlAppName; // Check for running tasks for this app and auto-switch to tasks tab if found @@ -686,22 +638,17 @@ class AppTabbedManager { // Check for task parameter and handle it AFTER tasks are loaded // Use original URL since the current URL might have been modified const urlParams = new URLSearchParams(this.originalSearch); - // console.log('🔍 Original URL search during init:', this.originalSearch); - // console.log('🔍 Original URL params during init:', Object.fromEntries(urlParams.entries())); let taskId = urlParams.get('task'); - // console.log('🔍 Task ID from original params:', taskId); // Fallback: Check sessionStorage if URL doesn't have task parameter if (!taskId) { taskId = sessionStorage.getItem('pendingTaskId'); - // console.log('🔍 Task ID from sessionStorage fallback:', taskId); // Clear sessionStorage after using it if (taskId) { sessionStorage.removeItem('pendingTaskId'); } } if (taskId) { - // console.log('🔍 Task parameter found:', taskId); // Store the task ID to handle after tasks are loaded this.pendingTaskId = taskId; // Force tasks tab @@ -722,7 +669,6 @@ class AppTabbedManager { // Set initial active tab (only if no task parameter) if (!taskId) { const initialTab = this.getTabFromURL(); - // console.log('🔄 Setting initial tab:', initialTab, 'with currentApp:', this.currentApp); this.switchTab(initialTab); } @@ -739,7 +685,6 @@ class AppTabbedManager { const newAppName = this.getAppFromURL(); // Only update if currentApp is already set and app actually changed if (this.currentApp && newAppName !== this.currentApp) { - // console.log('🔄 URL changed, updating app from', this.currentApp, 'to', newAppName); this.updateApp(newAppName); } }); @@ -776,7 +721,6 @@ class AppTabbedManager { // Create backup (placeholder function) async createBackup(appName) { // Placeholder - will be implemented with actual backup logic - // console.log(`Creating backup for ${appName}...`); } // Setup task event listeners for button state management @@ -785,8 +729,6 @@ class AppTabbedManager { const { taskId, appName, action } = event.detail; const key = this.taskKey(appName, action); - // console.log('📌 taskCreated: appName=%s, currentApp=%s, action=%s, key=%s', - // appName, this.currentApp, action, key); if (this.runningTasks.has(key)) { const existing = this.runningTasks.get(key); @@ -818,7 +760,6 @@ class AppTabbedManager { } this.runningTasks.set(key, { taskId, appName, action }); - // console.log('📌 taskCreated: stored in runningTasks, will disable=%s', appName === this.currentApp); if (appName === this.currentApp) { this.disableAppButtons(appName, action); @@ -924,8 +865,6 @@ class AppTabbedManager { // Disable app buttons during task execution disableAppButtons(appName, action) { - // console.log('🚫 disableAppButtons called: appName=%s, action=%s, currentApp=%s', - // appName, action, this.currentApp); // Also disable config and backup tabs this.disableTabs(); @@ -940,7 +879,6 @@ class AppTabbedManager { // Disable ALL buttons in the app content section const allButtons = appContent.querySelectorAll('button:not([disabled]):not(.tab-button)'); - // console.log('🚫 disableAppButtons found %d buttons to disable', allButtons.length); allButtons.forEach(button => { // Skip tab buttons (config, backup, tasks tabs) @@ -978,7 +916,6 @@ class AppTabbedManager { tempDiv.innerHTML = originalContent; const textContent = tempDiv.textContent || tempDiv.innerText || originalContent; - // console.log('🔃 Adding spinner to button:', button.textContent.trim(), 'for app:', appName); button.innerHTML = ` 1 && currentService === service) { // Case 4: Multiple services and current service matches - normal selection shouldAutoSelect = true; isAutoMatched = false; - //console.log(`🔌 PortManager: Normal selection of service "${service}" for port ${index}`); } if (shouldAutoSelect) { @@ -732,7 +716,6 @@ class PortManager { const index = parseInt(select.dataset.index); const currentService = this.ports[index]?.service || ''; - //console.log(`🔌 PortManager: Port ${index} current service: "${currentService}"`); // Clear existing options select.innerHTML = ''; @@ -751,22 +734,18 @@ class PortManager { // Case 1: Only one service and no current service - auto-select shouldAutoSelect = true; isAutoMatched = true; - //console.log(`🔌 PortManager: Auto-selecting single service "${service}" for port ${index}`); } else if (this.availableServices.length === 1 && currentService && currentService !== service) { // Case 2: Only one service but current service doesn't match - auto-match shouldAutoSelect = true; isAutoMatched = true; - //console.log(`🔌 PortManager: Auto-matching service "${service}" (was "${currentService}") for port ${index}`); } else if (this.availableServices.length === 1 && currentService === service) { // Case 3: Single service and current service matches - still show auto-match indicator shouldAutoSelect = true; isAutoMatched = true; - //console.log(`🔌 PortManager: Single service matches "${service}" for port ${index} - showing auto-match indicator`); } else if (this.availableServices.length > 1 && currentService === service) { // Case 4: Multiple services and current service matches - normal selection shouldAutoSelect = true; isAutoMatched = false; - //console.log(`🔌 PortManager: Normal selection of service "${service}" for port ${index}`); } if (shouldAutoSelect) { diff --git a/containers/libreportal/frontend/components/dashboard/js/dashboard.js b/containers/libreportal/frontend/components/dashboard/js/dashboard.js index f153f0c..141e4b0 100755 --- a/containers/libreportal/frontend/components/dashboard/js/dashboard.js +++ b/containers/libreportal/frontend/components/dashboard/js/dashboard.js @@ -114,15 +114,12 @@ function navigateToApp(appName) { // Filter apps by search term (removed - not used in dashboard) function filterApps(searchTerm) { - //console.log('Filter apps functionality removed from dashboard'); } // Filter apps by category (removed - not used in dashboard) function filterAppsByCategory(category) { - //console.log('Filter apps by category functionality removed from dashboard'); } // Populate category filter (removed - not used in dashboard) function populateCategoryFilter() { - //console.log('Category filter population removed from dashboard'); } diff --git a/containers/libreportal/frontend/components/tasks/js/tasks-data-load.js b/containers/libreportal/frontend/components/tasks/js/tasks-data-load.js index 66629ed..2854b81 100644 --- a/containers/libreportal/frontend/components/tasks/js/tasks-data-load.js +++ b/containers/libreportal/frontend/components/tasks/js/tasks-data-load.js @@ -55,7 +55,6 @@ Object.assign(TasksManager.prototype, { } // Get tasks using new system - // console.log('📥 Getting tasks using new queue system...'); // Get queue and current status let queue = []; @@ -75,7 +74,6 @@ Object.assign(TasksManager.prototype, { } } } catch (error) { - // console.log('📝 Queue file not found, starting with empty queue'); } try { @@ -92,7 +90,6 @@ Object.assign(TasksManager.prototype, { } } } catch (error) { - // console.log('📝 Current file not found, no current task'); } // Load individual task files @@ -120,7 +117,6 @@ Object.assign(TasksManager.prototype, { // Scan tasks folder for all task files (including completed ones) - OPTIMIZED try { - // console.log('🔍 Scanning tasks folder for all task files...'); const tasksResponse = await fetch('/read-directory?path=tasks'); if (tasksResponse.ok) { const files = await tasksResponse.json(); @@ -130,7 +126,6 @@ Object.assign(TasksManager.prototype, { file !== 'current.json' ); - // console.log(`📁 Found ${taskFiles.length} task files in folder`); // OPTIMIZATION: Batch load tasks instead of individual calls const missingTaskIds = taskFiles @@ -138,7 +133,6 @@ Object.assign(TasksManager.prototype, { .filter(taskId => !allTasks.find(task => task.id === taskId)); if (missingTaskIds.length > 0) { - // console.log(`📦 Batch loading ${missingTaskIds.length} missing tasks...`); try { const batchResponse = await fetch('/read-tasks-batch', { method: 'POST', @@ -151,12 +145,10 @@ Object.assign(TasksManager.prototype, { batchTasks.forEach(task => { if (task) { allTasks.push(task); - // console.log(`✅ Added completed task ${task.id} from batch load`); } }); } else { // Fallback to individual loading if batch endpoint not available - // console.log('⚠️ Batch endpoint not available, falling back to individual loading'); await this.loadTasksIndividually(missingTaskIds, allTasks); } } catch (error) { @@ -181,7 +173,6 @@ Object.assign(TasksManager.prototype, { // Sort by creation time (newest first) this.tasks.sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt)); - // console.log(`✅ Loaded ${this.tasks.length} tasks`); //// // console.log('📋 All tasks:', this.tasks); this.renderTasks(); @@ -207,7 +198,6 @@ Object.assign(TasksManager.prototype, { const task = await this.taskManager.getTask(taskId); if (task) { allTasks.push(task); - // console.log(`✅ Added completed task ${taskId} from individual load`); } } catch (error) { console.warn(`⚠️ Failed to load task ${taskId}:`, error); diff --git a/containers/libreportal/frontend/components/tasks/js/tasks-list-render.js b/containers/libreportal/frontend/components/tasks/js/tasks-list-render.js index 9c7ab38..4b7c2f4 100644 --- a/containers/libreportal/frontend/components/tasks/js/tasks-list-render.js +++ b/containers/libreportal/frontend/components/tasks/js/tasks-list-render.js @@ -149,7 +149,6 @@ Object.assign(TasksManager.prototype, { return displayNames[category] || category.charAt(0).toUpperCase() + category.slice(1); }, renderTask(task) { - // console.log(`🔍 renderTask called with task:`, task); // Debug undefined status if (!task.status) { @@ -164,24 +163,10 @@ Object.assign(TasksManager.prototype, { const hasError = task.error && task.error.length > 0; const hasLogs = task.log && Array.isArray(task.log) && task.log.length > 0; - // console.log(`🔍 Task fields check:`, { - //hasOutput: hasOutput, - //hasError: hasError, - //hasLogs: hasLogs, - //isRunning: isRunning, - //outputLength: task.output ? task.output.length : 0, - //error: task.error, - //logCount: task.log ? task.log.length : 0 - //}); const executionTime = task.startedAt && task.completedAt ? this.calculateExecutionTime(task.startedAt, task.completedAt) : null; - // console.log('🔍 renderTask debug:', { - //taskStatus: task.status, - //statusClass: statusClass, - //statusDisplay: task.status ? task.status.toUpperCase() : 'UNKNOWN' - //}); return `