From 9a145b9c4bb74d7c2da64d255982715bc69beceb Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 6 Dec 2025 02:14:58 +0400 Subject: [PATCH] fix: improve storage pre-filling with better debugging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Clear storageSelection before pre-filling - Add detailed logging for slot filling process - Store filled drives in storageSelection for summary display - Improve error handling and debugging output 🤖 Generated with [Claude Code](https://claude.com/claude.com) Co-Authored-By: Claude --- .../new-baremetal.html | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Documents/Vibe Coding Projects/dedicatednodes-redesign/dedicatednodes-bare-metal/new-baremetal.html b/Documents/Vibe Coding Projects/dedicatednodes-redesign/dedicatednodes-bare-metal/new-baremetal.html index d2903ad..46216cd 100644 --- a/Documents/Vibe Coding Projects/dedicatednodes-redesign/dedicatednodes-bare-metal/new-baremetal.html +++ b/Documents/Vibe Coding Projects/dedicatednodes-redesign/dedicatednodes-bare-metal/new-baremetal.html @@ -4840,6 +4840,11 @@ var wpcf7 = { // Fill slots based on storage requirements if (storageRequirements && storageRequirements.length > 0) { + console.log("Pre-filling storage with requirements:", storageRequirements); + + // Clear storageSelection to start fresh + storageSelection = {}; + storageRequirements.forEach(req => { for (let i = 0; i < req.qty; i++) { // Find an empty slot @@ -4849,6 +4854,8 @@ var wpcf7 = { ); if (emptySlot) { + console.log(`Filling slot ${emptySlot.id} with ${req.spec}`); + // Find matching drive type const match = emptySlot.values.find(v => { const vText = v.text.toLowerCase(); @@ -4874,6 +4881,13 @@ var wpcf7 = { configState[emptySlot.label] = 0; // Included in base price configIds[emptySlot.id] = match.id; + // Store in storageSelection for summary + const displayName = match.text.replace(/\s?\(.*?\)/, ''); + storageSelection[emptySlot.id] = { + name: displayName, + price: 0 // Free for included drives + }; + // Track as original drive window.originalDrives.push({ slotId: emptySlot.id, @@ -4881,10 +4895,18 @@ var wpcf7 = { text: match.text, price: match.price }); + + console.log(`✓ Filled with: ${match.text}`); + } else { + console.error(`✗ Could not find matching drive for: ${req.spec}`); } + } else { + console.error(`✗ No empty slots available for: ${req.spec}`); } } }); + + console.log("Final storageSelection:", storageSelection); } } else { // Pre-set configState for custom servers