documentation for all JS files

This commit is contained in:
2025-05-28 16:01:18 +02:00
parent 1134f5b099
commit 5c5829c487
22 changed files with 984 additions and 26 deletions

View File

@@ -1,3 +1,12 @@
/**
* @fileoverview Provides debugging and maintenance functionality for the application.
* This file handles:
* - File system synchronization
* - Database state verification
* - Orphaned record cleanup
* - Mismatch detection and reporting
*/
// File system sync functionality
document.getElementById('syncFilesBtn').addEventListener('click', async function() {
const btn = this;
@@ -162,7 +171,13 @@ document.getElementById('cleanupOrphanedBtn').addEventListener('click', async fu
}
});
// Helper function to update mismatch sections
/**
* Updates a mismatch section in the UI with verification results.
* Displays counts and detailed information about mismatches.
* @function
* @param {string} sectionId - The ID of the section to update
* @param {Array} items - Array of mismatch items to display
*/
function updateMismatchSection(sectionId, items) {
const count = document.getElementById(`${sectionId}Count`);
const list = document.getElementById(`${sectionId}List`);
@@ -211,7 +226,13 @@ function updateMismatchSection(sectionId, items) {
`).join('');
}
// Helper function to format file sizes
/**
* Formats a file size in bytes to a human-readable string.
* Converts to appropriate unit (B, KB, MB, GB, TB).
* @function
* @param {number} bytes - The size in bytes
* @returns {string} The formatted size string (e.g., "1.5 MB")
*/
function formatSize(bytes) {
if (bytes === 0) return '0 B';
const k = 1024;