diff --git a/src/python/impactx/dashboard/Toolbar/toolbarMain.py b/src/python/impactx/dashboard/Toolbar/toolbarMain.py index 4b71b0aca..eeca56bc5 100644 --- a/src/python/impactx/dashboard/Toolbar/toolbarMain.py +++ b/src/python/impactx/dashboard/Toolbar/toolbarMain.py @@ -85,35 +85,21 @@ def dashboard_info(): class Toolbars: """ - Builds section toolbars for various pages. + Builds toolbar for dashboard. """ @staticmethod - def input_toolbar(): - """ - Builds toolbar for the 'Input' page. - """ - - (ToolbarElements.dashboard_info(),) - vuetify.VSpacer() - ToolbarElements.export_input_data() - - @staticmethod - def run_toolbar(): - """ - Builds toolbar for the 'Run' page. - """ - - (ToolbarElements.dashboard_info(),) - (vuetify.VSpacer(),) - (ToolbarElements.run_simulation_button(),) - - @staticmethod - def analyze_toolbar(): - """ - Builds toolbar for the 'Analyze' page. - """ - - (ToolbarElements.dashboard_info(),) - vuetify.VSpacer() - ToolbarElements.plot_options() + def dashboard_toolbar(toolbar_name: str) -> None: + toolbar_name = toolbar_name.lower() + if toolbar_name == "input": + (ToolbarElements.dashboard_info(),) + vuetify.VSpacer() + ToolbarElements.export_input_data() + elif toolbar_name == "run": + (ToolbarElements.dashboard_info(),) + (vuetify.VSpacer(),) + (ToolbarElements.run_simulation_button(),) + elif toolbar_name == "analyze": + (ToolbarElements.dashboard_info(),) + vuetify.VSpacer() + ToolbarElements.plot_options() diff --git a/src/python/impactx/dashboard/__main__.py b/src/python/impactx/dashboard/__main__.py index 4f15fa468..dd973d6fd 100644 --- a/src/python/impactx/dashboard/__main__.py +++ b/src/python/impactx/dashboard/__main__.py @@ -72,11 +72,11 @@ def application(): layout.title.hide() with layout.toolbar: with vuetify.Template(v_if="$route.path == '/Analyze'"): - Toolbars.analyze_toolbar() + Toolbars.dashboard_toolbar("analyze") with vuetify.Template(v_if="$route.path == '/Input'"): - Toolbars.input_toolbar() + Toolbars.dashboard_toolbar("input") with vuetify.Template(v_if="$route.path == '/Run'"): - Toolbars.run_toolbar() + Toolbars.dashboard_toolbar("run") with layout.drawer as drawer: drawer.width = 200