feat: Add bootstrap styling and update layout

This commit is contained in:
2025-09-12 06:46:32 +02:00
parent ed17d6e2d6
commit 7cbf75d6a8
5 changed files with 12 additions and 6 deletions

6
assets/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{ {
"Startup":"program to make life easier", "Startup":"program to make life easier",
"DATA_PATH":"./data/transactions.csv.gz" "DATA_PATH":"./data/blank.csv"
} }

View File

@ -20,7 +20,7 @@ def main() -> None:
print(os.getenv("MY_ENV_VAR")) print(os.getenv("MY_ENV_VAR"))
print(config["Startup"]) print(config["Startup"])
# load the data and create the data manager # load the data and create the data manager
data = load_mtbf_data("data/blank.csv") data = load_mtbf_data(config["DATA_PATH"])
app = Dash(external_stylesheets=[BS]) app = Dash(external_stylesheets=[BS])
app.title = "Reliability Dashboard" app.title = "Reliability Dashboard"

View File

@ -12,7 +12,7 @@ def render(app: Dash, data: pd.DataFrame) -> html.Div:
[ [
Input(ids.YEAR_DROPDOWN, "value"), Input(ids.YEAR_DROPDOWN, "value"),
Input(ids.WEEK_DROPDOWN, "value"), Input(ids.WEEK_DROPDOWN, "value"),
Input(ids.HITS_SELECTOR, "value"), Input(ids.PU_HITS_SELECTOR, "value"),
Input(ids.SINGLE_HITTER_FILTER, "value"), Input(ids.SINGLE_HITTER_FILTER, "value"),
], ],
) )
@ -53,7 +53,7 @@ def render(app: Dash, data: pd.DataFrame) -> html.Div:
return html.Div( return html.Div(
children=[ children=[
dcc.RadioItems( dcc.RadioItems(
id=ids.HITS_SELECTOR, id=ids.PU_HITS_SELECTOR,
options=[ options=[
{'label': 'P-Hits', 'value': 'p-hits'}, {'label': 'P-Hits', 'value': 'p-hits'},
{'label': 'U-Hits', 'value': 'u-hits'}, {'label': 'U-Hits', 'value': 'u-hits'},

View File

@ -21,6 +21,8 @@ def create_layout(app: Dash, data: pd.DataFrame) -> html.Div:
dcc.Tabs(id="tabs", value='tab-dashboard', children=[ dcc.Tabs(id="tabs", value='tab-dashboard', children=[
dcc.Tab(label='Dashboard', value='tab-dashboard', children=[ dcc.Tab(label='Dashboard', value='tab-dashboard', children=[
html.Div(style=tab_content_style, children=[ html.Div(style=tab_content_style, children=[
bar_chart.render(app, data),
data_table.render(app, data),
html.Div( html.Div(
className="dropdown-container", className="dropdown-container",
children=[ children=[
@ -28,8 +30,6 @@ def create_layout(app: Dash, data: pd.DataFrame) -> html.Div:
week_dropdown.render(app, data), week_dropdown.render(app, data),
], ],
), ),
bar_chart.render(app, data),
data_table.render(app, data),
]) ])
]), ]),
dcc.Tab(label='Source Table', value='tab-source-table', children=[ dcc.Tab(label='Source Table', value='tab-source-table', children=[