working on improving component loading

This commit is contained in:
2026-01-10 19:17:17 +01:00
parent 797883dac8
commit 5201858b79
5 changed files with 104 additions and 9 deletions

View File

@@ -115,11 +115,18 @@ class TabsManager(MultipleInstance):
def _dynamic_get_content(self, tab_id):
if tab_id not in self._state.tabs:
return Div("Tab not found.")
tab_config = self._state.tabs[tab_id]
if tab_config["component"] is None:
return Div("Tab content does not support serialization.")
res = InstancesManager.get(self._session, tab_config["component"][1], None)
if res is not None:
return res
try:
return InstancesManager.get(self._session, tab_config["component"][1])
logger.debug(f"Component not created yet. Need to manually create it.")
return InstancesManager.dynamic_get(self._session, tab_config["component_parent"], tab_config["component"])
except Exception as e:
logger.error(f"Error while retrieving tab content: {e}")
return Div("Failed to retrieve tab content.")