From 4ff5a67fdab05d1779650bb58087cf9a2b83aeb5 Mon Sep 17 00:00:00 2001 From: Chris Rosenau Date: Sat, 8 Nov 2025 15:08:33 -0700 Subject: [PATCH] tab memory and more stats --- resources/views/migration/index.blade.php | 35 ++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/resources/views/migration/index.blade.php b/resources/views/migration/index.blade.php index 8287848..378b9ae 100644 --- a/resources/views/migration/index.blade.php +++ b/resources/views/migration/index.blade.php @@ -19,7 +19,8 @@ } .container { - max-width: 1200px; + width: 90%; + max-width: 90%; margin: 0 auto; background: white; border-radius: 12px; @@ -550,6 +551,10 @@
{{ $m1CategoriesCount }}
Magento 1 Categories
+
+
{{ $m2CategoriesCount }}
+
Magento 2 Categories
+
@@ -877,12 +882,35 @@ function switchTab(tabName, tabElement) { document.getElementById('tab-' + tabName).classList.add('active'); tabElement.classList.add('active'); + // Save active tab to localStorage + localStorage.setItem('activeTab', tabName); + // Load category trees if switching to categories tab if (tabName === 'categories') { loadCategoryTrees(); } } + // Restore active tab from localStorage on page load + function restoreActiveTab() { + const savedTab = localStorage.getItem('activeTab'); + if (savedTab) { + // Validate that the saved tab exists + const tabContent = document.getElementById('tab-' + savedTab); + if (tabContent) { + // Find the tab button for the saved tab + const tabs = document.querySelectorAll('.tab'); + tabs.forEach(tab => { + const onclick = tab.getAttribute('onclick'); + if (onclick && onclick.includes(`'${savedTab}'`)) { + switchTab(savedTab, tab); + return; + } + }); + } + } + } + // Load category trees function loadCategoryTrees() { loadM1Tree(); @@ -1240,6 +1268,11 @@ function cancelRenameCategory(nodeDiv, labelText, badge, renameBtn, deleteBtn) { if (input) label.removeChild(input); if (actionsDiv) label.removeChild(actionsDiv); } + + // Restore active tab when page loads + document.addEventListener('DOMContentLoaded', function() { + restoreActiveTab(); + });