aegis_gui.layout

 1import dash
 2from dash import html, dcc
 3import dash_bootstrap_components as dbc
 4from aegis_gui.utilities import sim_tracker
 5from aegis_gui.utilities.utilities import get_icon
 6from aegis_gui import offcanvas
 7from aegis_gui.guisettings.GuiSettings import gui_settings
 8
 9
10def get_app_layout():
11    return html.Div(
12        id="body-container",
13        children=[
14            dcc.Location(id="url", refresh=False),
15            get_sidebar(),
16            html.Div(id="main-container", children=[dash.page_container]),
17        ],
18    )
19
20
21def get_sidebar():
22    return dash.html.Div(
23        [
24            dbc.Nav(
25                children=[
26                    html.A(
27                        [
28                            html.Img(
29                                src="assets/aegis-ager.svg", width="80%", style={"margin": "0 10%"}, id="aegis-logo"
30                            )
31                        ],
32                        href=gui_settings.wrap_href(""),
33                        className="mb-5",
34                    ),
35                    dbc.NavItem(
36                        [
37                            dbc.NavLink(
38                                [
39                                    dash.html.I(className="bi bi-house-door-fill"),
40                                    "Home",
41                                    # get_icon("house-door-fill"),
42                                ],
43                                href=gui_settings.wrap_href(""),
44                                id="link-nav-home",
45                            )
46                        ]
47                    ),
48                    dbc.NavItem(
49                        [
50                            dbc.NavLink(
51                                [dash.html.I(className="bi bi-rocket-takeoff-fill"), "Launch"],
52                                href=gui_settings.wrap_href("config"),
53                                id="link-nav-config",
54                            )
55                        ]
56                    ),
57                    dbc.NavItem(
58                        [
59                            dbc.NavLink(
60                                [dash.html.I(className="bi bi-bar-chart-fill"), "Plot"],
61                                href=gui_settings.wrap_href("plot"),
62                                id="link-nav-plot",
63                            )
64                        ]
65                    ),
66                    dbc.NavItem(
67                        [
68                            dbc.NavLink(
69                                [dash.html.I(className="bi bi-eye-fill"), "Control"],
70                                href=gui_settings.wrap_href("simlog"),
71                                id="link-nav-simlog",
72                            )
73                        ]
74                    ),
75                    dbc.NavItem(
76                        [
77                            dbc.NavLink(
78                                [dash.html.I(className="bi bi-info-square-fill"), "Wiki"],
79                                href=gui_settings.wrap_href("wiki"),
80                                id="link-nav-wiki",
81                            )
82                        ]
83                    ),
84                ]
85                + sim_tracker.init_tracker_box()
86                + [offcanvas.get_offcanvas_trigger(), offcanvas.get_offcanvas()],
87                id="sidebar",
88                vertical="md",
89                pills=True,  # TODO fix because it is not showing since i changed the href logic with gui_settings.wrap_href
90                # fill=True,
91            ),
92        ],
93    )
def get_app_layout():
11def get_app_layout():
12    return html.Div(
13        id="body-container",
14        children=[
15            dcc.Location(id="url", refresh=False),
16            get_sidebar(),
17            html.Div(id="main-container", children=[dash.page_container]),
18        ],
19    )
def get_sidebar():
22def get_sidebar():
23    return dash.html.Div(
24        [
25            dbc.Nav(
26                children=[
27                    html.A(
28                        [
29                            html.Img(
30                                src="assets/aegis-ager.svg", width="80%", style={"margin": "0 10%"}, id="aegis-logo"
31                            )
32                        ],
33                        href=gui_settings.wrap_href(""),
34                        className="mb-5",
35                    ),
36                    dbc.NavItem(
37                        [
38                            dbc.NavLink(
39                                [
40                                    dash.html.I(className="bi bi-house-door-fill"),
41                                    "Home",
42                                    # get_icon("house-door-fill"),
43                                ],
44                                href=gui_settings.wrap_href(""),
45                                id="link-nav-home",
46                            )
47                        ]
48                    ),
49                    dbc.NavItem(
50                        [
51                            dbc.NavLink(
52                                [dash.html.I(className="bi bi-rocket-takeoff-fill"), "Launch"],
53                                href=gui_settings.wrap_href("config"),
54                                id="link-nav-config",
55                            )
56                        ]
57                    ),
58                    dbc.NavItem(
59                        [
60                            dbc.NavLink(
61                                [dash.html.I(className="bi bi-bar-chart-fill"), "Plot"],
62                                href=gui_settings.wrap_href("plot"),
63                                id="link-nav-plot",
64                            )
65                        ]
66                    ),
67                    dbc.NavItem(
68                        [
69                            dbc.NavLink(
70                                [dash.html.I(className="bi bi-eye-fill"), "Control"],
71                                href=gui_settings.wrap_href("simlog"),
72                                id="link-nav-simlog",
73                            )
74                        ]
75                    ),
76                    dbc.NavItem(
77                        [
78                            dbc.NavLink(
79                                [dash.html.I(className="bi bi-info-square-fill"), "Wiki"],
80                                href=gui_settings.wrap_href("wiki"),
81                                id="link-nav-wiki",
82                            )
83                        ]
84                    ),
85                ]
86                + sim_tracker.init_tracker_box()
87                + [offcanvas.get_offcanvas_trigger(), offcanvas.get_offcanvas()],
88                id="sidebar",
89                vertical="md",
90                pills=True,  # TODO fix because it is not showing since i changed the href logic with gui_settings.wrap_href
91                # fill=True,
92            ),
93        ],
94    )