consolidation & ux improvements
This commit is contained in:
@@ -8,22 +8,10 @@ import { checkDependencies, updateResultItem } from '../utils.js';
|
||||
export class FAT12_16Filesystem extends BaseFilesystem {
|
||||
calculate(variantId) {
|
||||
if (variantId !== 'fat1216') return;
|
||||
const values = {};
|
||||
|
||||
const values = this.getInputValues(variantId);
|
||||
const results = {};
|
||||
// Gather all input values for this variant
|
||||
const variant = this.variants.find(v => v.id === variantId);
|
||||
if (!variant) return;
|
||||
[...variant.constants, ...variant.inputs].forEach(field => {
|
||||
const el = document.getElementById(field.id);
|
||||
if (el) {
|
||||
let val = el.value;
|
||||
if (val && val.startsWith('0x')) {
|
||||
values[field.id] = parseInt(val, 16);
|
||||
} else {
|
||||
values[field.id] = Number(val) || 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.calculateFAT1216(values, results);
|
||||
}
|
||||
constructor() {
|
||||
@@ -211,22 +199,10 @@ export class FAT12_16Filesystem extends BaseFilesystem {
|
||||
export class FAT32Filesystem extends BaseFilesystem {
|
||||
calculate(variantId) {
|
||||
if (variantId !== 'fat32') return;
|
||||
const values = {};
|
||||
|
||||
const values = this.getInputValues(variantId);
|
||||
const results = {};
|
||||
// Gather all input values for this variant
|
||||
const variant = this.variants.find(v => v.id === variantId);
|
||||
if (!variant) return;
|
||||
[...variant.constants, ...variant.inputs].forEach(field => {
|
||||
const el = document.getElementById(field.id);
|
||||
if (el) {
|
||||
let val = el.value;
|
||||
if (val && val.startsWith('0x')) {
|
||||
values[field.id] = parseInt(val, 16);
|
||||
} else {
|
||||
values[field.id] = Number(val) || 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.calculateFAT32(values, results);
|
||||
}
|
||||
constructor() {
|
||||
|
||||
Reference in New Issue
Block a user