32 lines
939 B
Python
32 lines
939 B
Python
|
|
"""
|
||
|
|
Navigation callbacks for tab switching.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from dash import html, Output, Input
|
||
|
|
from dashboard.layouts import (
|
||
|
|
get_market_data_layout,
|
||
|
|
get_bot_management_layout,
|
||
|
|
get_performance_layout,
|
||
|
|
get_system_health_layout
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
def register_navigation_callbacks(app):
|
||
|
|
"""Register navigation-related callbacks."""
|
||
|
|
|
||
|
|
@app.callback(
|
||
|
|
Output('tab-content', 'children'),
|
||
|
|
Input('main-tabs', 'value')
|
||
|
|
)
|
||
|
|
def render_tab_content(active_tab):
|
||
|
|
"""Render content based on selected tab."""
|
||
|
|
if active_tab == 'market-data':
|
||
|
|
return get_market_data_layout()
|
||
|
|
elif active_tab == 'bot-management':
|
||
|
|
return get_bot_management_layout()
|
||
|
|
elif active_tab == 'performance':
|
||
|
|
return get_performance_layout()
|
||
|
|
elif active_tab == 'system-health':
|
||
|
|
return get_system_health_layout()
|
||
|
|
else:
|
||
|
|
return html.Div("Tab not found")
|