feat: Implement recursive storage listing and directory browsing for backups, and add a migration option to fix cross-filters.
This commit is contained in:
@@ -65,7 +65,15 @@
|
||||
};
|
||||
|
||||
function normalizeTab(value) {
|
||||
return SETTINGS_TABS.includes(value) ? value : "environments";
|
||||
const normalized = String(value || "").trim().toLowerCase();
|
||||
const aliases = {
|
||||
environment: "environments",
|
||||
env: "environments",
|
||||
"migration-sync": "migration",
|
||||
storages: "storage",
|
||||
};
|
||||
const resolved = aliases[normalized] || normalized;
|
||||
return SETTINGS_TABS.includes(resolved) ? resolved : "environments";
|
||||
}
|
||||
|
||||
function readTabFromUrl() {
|
||||
@@ -89,8 +97,17 @@
|
||||
// Load settings on mount
|
||||
onMount(async () => {
|
||||
activeTab = readTabFromUrl();
|
||||
const syncTabFromUrl = () => {
|
||||
activeTab = readTabFromUrl();
|
||||
};
|
||||
window.addEventListener("popstate", syncTabFromUrl);
|
||||
window.addEventListener("hashchange", syncTabFromUrl);
|
||||
await loadSettings();
|
||||
await loadMigrationSettings();
|
||||
return () => {
|
||||
window.removeEventListener("popstate", syncTabFromUrl);
|
||||
window.removeEventListener("hashchange", syncTabFromUrl);
|
||||
};
|
||||
});
|
||||
|
||||
// Load consolidated settings from API
|
||||
@@ -163,9 +180,10 @@
|
||||
|
||||
// Handle tab change
|
||||
function handleTabChange(tab) {
|
||||
activeTab = normalizeTab(tab);
|
||||
const normalizedTab = normalizeTab(tab);
|
||||
activeTab = normalizedTab;
|
||||
writeTabToUrl(activeTab);
|
||||
if (tab === "migration") {
|
||||
if (normalizedTab === "migration") {
|
||||
loadMigrationSettings();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user