debug: add logging for instant deploy URL building
Added extensive logging to debug: - Initial configIds before pre-filling storage - Final configIds after pre-filling - Storage selection state - All configoption parameters being set in URL This will help identify why the deploy button after customization shows incorrect storage configuration. 🤖 Generated with [Claude Code](https://claude.com/claude.com) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4899,6 +4899,7 @@ var wpcf7 = {
|
||||
// Fill slots based on storage requirements
|
||||
if (storageRequirements && storageRequirements.length > 0) {
|
||||
console.log("Pre-filling storage with requirements:", storageRequirements);
|
||||
console.log("Initial configIds before pre-filling:", configIds);
|
||||
|
||||
// Clear storageSelection to start fresh
|
||||
storageSelection = {};
|
||||
@@ -4965,6 +4966,7 @@ var wpcf7 = {
|
||||
});
|
||||
|
||||
console.log("Final storageSelection:", storageSelection);
|
||||
console.log("Final configIds after pre-filling:", configIds);
|
||||
}
|
||||
} else {
|
||||
// Pre-set configState for custom servers
|
||||
@@ -5467,18 +5469,25 @@ var wpcf7 = {
|
||||
const urlObj = new URL(selectedServer.orderUrl);
|
||||
const params = urlObj.searchParams;
|
||||
|
||||
console.log("Building Instant Order URL - ConfigIds:", configIds);
|
||||
console.log("Building Instant Order URL - Storage Selection:", storageSelection);
|
||||
|
||||
// Update only the configuration options that are tracked in configIds
|
||||
Object.entries(configIds).forEach(([id, val]) => {
|
||||
if (id && val) {
|
||||
// WHMCS format: configoption[123]
|
||||
params.set(`configoption[${id}]`, val);
|
||||
console.log(`Setting configoption[${id}] = ${val}`);
|
||||
}
|
||||
});
|
||||
|
||||
// Ensure billing cycle is enforced
|
||||
params.set('billingcycle', 'monthly');
|
||||
|
||||
return urlObj.toString();
|
||||
const finalUrl = urlObj.toString();
|
||||
console.log("Final Instant Order URL:", finalUrl);
|
||||
|
||||
return finalUrl;
|
||||
} catch (e) {
|
||||
console.error("Error building instant URL:", e);
|
||||
return selectedServer.orderUrl;
|
||||
|
||||
Reference in New Issue
Block a user