remove legacy fallbacks: routes now exclusively use unified resources
BREAKING: Route components no longer fall back to legacy state arrays. All data now flows through the unified resource model: - DockerRoute: uses state.resources filtered for docker-host/docker-container - HostsRoute: uses state.resources filtered for host - DashboardView: uses state.resources filtered for node/vm/container The legacy arrays (state.nodes, state.vms, etc.) are still broadcast by the backend for API compatibility, but the main UI routes no longer use them. If resources array is empty, pages will show no data rather than falling back to legacy data. This ensures a clean data model with no hidden fallback behavior.
This commit is contained in:
parent
435e0af522
commit
ef135126b9
2 changed files with 14 additions and 10 deletions
|
|
@ -544,10 +544,11 @@ The dedicated `/resources` unified view was abandoned in favor of migrating exis
|
|||
- WebSocket state now includes resources array
|
||||
- All pages can consume from unified model with legacy fallback
|
||||
|
||||
4. **Future Cleanup (Phase 6):**
|
||||
4. **Cleanup (Phase 6) - COMPLETED:**
|
||||
- [x] Remove debug console.log statements from frontend routes
|
||||
- [ ] Remove legacy arrays from State once migration is verified stable (keep fallback for safety)
|
||||
- [ ] Remove legacy AI context fallback
|
||||
- [x] Remove legacy fallback code from route components (Docker, Hosts, Dashboard)
|
||||
- [ ] Remove unused legacy arrays from backend StateFrontend (optional - still broadcast for API compatibility)
|
||||
- [ ] Remove legacy AI context fallback (optional - verify AI uses unified model first)
|
||||
- [ ] Simplify route components to use resources directly (remove adapter layer)
|
||||
|
||||
---
|
||||
|
|
|
|||
|
|
@ -184,8 +184,8 @@ function DockerRoute() {
|
|||
});
|
||||
}
|
||||
|
||||
// Fall back to legacy data
|
||||
return state.dockerHosts ?? [];
|
||||
// Return empty array if no unified resources available
|
||||
return [];
|
||||
});
|
||||
|
||||
return <DockerHosts hosts={hosts() as any} activeAlerts={activeAlerts} />;
|
||||
|
|
@ -249,8 +249,8 @@ function HostsRoute() {
|
|||
});
|
||||
}
|
||||
|
||||
// Fall back to legacy data
|
||||
return state.hosts ?? [];
|
||||
// Return empty array if no unified resources available
|
||||
return [];
|
||||
});
|
||||
|
||||
return (
|
||||
|
|
@ -913,7 +913,8 @@ function App() {
|
|||
};
|
||||
});
|
||||
}
|
||||
return state().vms ?? [];
|
||||
// Return empty array if no unified resources available
|
||||
return [];
|
||||
});
|
||||
|
||||
const containers = createMemo(() => {
|
||||
|
|
@ -956,7 +957,8 @@ function App() {
|
|||
};
|
||||
});
|
||||
}
|
||||
return state().containers ?? [];
|
||||
// Return empty array if no unified resources available
|
||||
return [];
|
||||
});
|
||||
|
||||
const nodes = createMemo(() => {
|
||||
|
|
@ -998,7 +1000,8 @@ function App() {
|
|||
};
|
||||
});
|
||||
}
|
||||
return state().nodes ?? [];
|
||||
// Return empty array if no unified resources available
|
||||
return [];
|
||||
});
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue