-            
                 
             
                 
                 
Dateisystem-Offset-Rechner
@@ -37,7 +44,7 @@Über
Dateisystem Offset-Rechner für Bildung und Forensik.
-Version 0.4.0
+Version 0.5.0
Support
diff --git a/webroot/js/filesystems/base.js b/webroot/js/filesystems/base.js index 034931e..21dbc8d 100644 --- a/webroot/js/filesystems/base.js +++ b/webroot/js/filesystems/base.js @@ -1,4 +1,6 @@ -// Base filesystem class that defines the common interface for all filesystem implementations + +// Base filesystem class that defines the common interface for all filesystem implementations. +// Now supports multi-value result rows (bytes, sectors, etc.) in a single output line. import { parseHex, validateInput, checkDependencies, updateResultItem } from '../utils.js'; @@ -18,13 +20,20 @@ export class BaseFilesystem { const variant = this.variants.find(v => v.id === variantId); if (!variant) return ''; + // Helper function to format labels with offset information + const formatLabel = (label) => { + // Match patterns like "(Boot-Offset 0x00)", "(MFT-Header-Offset 0x14)", "(Offset 0x00)" and wrap offset info + const offsetPattern = /(\((Boot-Offset|MFT-Header-Offset|Offset) [^)]+\))/g; + return label.replace(offsetPattern, '$1'); + }; + return `Konstanten
                     ${variant.constants.map(constant => `
                         
                 
-                            
+                            
                             
                             
                         
@@ -34,18 +43,32 @@ export class BaseFilesystem {
         `;
     }
 
+    // Generate HTML for timestamp converter section (to be overridden by subclasses)
+    generateTimestampConverterHTML(variantId) {
+        // Default implementation returns empty string
+        // Subclasses can override to provide filesystem-specific converters
+        return '';
+    }
+
     // Generate HTML for input parameters section
     generateInputsHTML(variantId) {
         const variant = this.variants.find(v => v.id === variantId);
         if (!variant) return '';
 
+        // Helper function to format labels with offset information
+        const formatLabel = (label) => {
+            // Match patterns like "(Boot-Offset 0x00)", "(MFT-Header-Offset 0x14)", "(Offset 0x00)" and wrap offset info
+            const offsetPattern = /(\((Boot-Offset|MFT-Header-Offset|Offset) [^)]+\))/g;
+            return label.replace(offsetPattern, '$1');
+        };
+
         return `
             Eingabeparameter
                     ${variant.inputs.map(input => `
                         
                 
                         
@@ -100,10 +138,15 @@ export class BaseFilesystem {
 
     // Generate complete tab content HTML
     generateTabContentHTML(variantId, calculatorHTML) {
+        const timestampHTML = this.generateTimestampConverterHTML(variantId);
+        
         return `
             
                 
-                            
+                            
                             
                             
                         
@@ -60,21 +83,36 @@ export class BaseFilesystem {
         const variant = this.variants.find(v => v.id === variantId);
         if (!variant) return '';
 
+        // Helper: get display units for a result (bytes, sectors, ...)
+        function getDisplayUnits(result) {
+            // Heuristic: if label contains (Bytes) or (Sektor), show both
+            const label = result.label.toLowerCase();
+            const units = [];
+            if (label.includes('bytes') || label.includes('byte')) units.push('bytes');
+            if (label.includes('sektor')) units.push('sectors');
+            // Add more as needed
+            return units;
+        }
+
         return `
             Berechnete Werte
${variant.resultGroups.map(group => `${group.name}
- ${group.results.map(result => ` -
-                                ${result.label}:
-                                
                 `).join('')}
             
-                                    -
-                                    
+                        ${group.results.map(result => {
+                            // For each result, show all representations in one row
+                            // The calculation logic must fill in all values in the result-value element, separated by //
+                            return `
+                                
-                        `).join('')}
+                            `;
+                        }).join('')}
                     
+                                    ${result.label}:
+                                    
-                            
+                                        -
+                                        
+                                    
                                 
-                    ${this.generateConstantsHTML(variantId)}
+                    
                         
+                        ${this.generateConstantsHTML(variantId)}
+                        ${timestampHTML}
+