feat: global design

This commit is contained in:
Bertrand Benjamin 2024-07-27 18:45:20 +02:00
parent cdad13788a
commit f9bfb917bd
2 changed files with 30 additions and 13 deletions

View File

@ -21,10 +21,10 @@ app.layout = html.Div([
), ),
dcc.Link("Config", dcc.Link("Config",
href="/config", href="/config",
className="flex-none hover:bg-gray-300 p-4 align-middle" className="flex-none hover:bg-amber-100 p-4 align-middle"
) )
], ],
className="bg-gray-100 flex flex-row" className="bg-amber-300 flex flex-row shadow"
), ),
dash.page_container dash.page_container
]) ])

View File

@ -5,21 +5,31 @@ from ..libs.stage.stage import AbstractStage
def html_list_schema(stage:AbstractStage, with_tables=True): def html_list_schema(stage:AbstractStage, with_tables=True):
""" Build html list of schema in stage """ """ Build html list of schema in stage """
ul_classes = "ml-2"
if with_tables: if with_tables:
return html.Ul( return html.Ul(
[ [
html.Li( html.Li(
children = [ children = [
html.Span(schema), html.Span(
schema,
className="text-lg text-bold"
),
html_list_table(stage, schema) html_list_table(stage, schema)
] ],
className=""
) for schema in stage.schemas() ) for schema in stage.schemas()
] ],
className=ul_classes
) )
return html.Ul( return html.Ul(
[ [
html.Li(schema) for schema in stage.schemas() html.Li(
] schema,
className="text-lg text-bold"
) for schema in stage.schemas()
],
className=ul_classes
) )
@ -29,23 +39,30 @@ def html_list_table(stage:AbstractStage, schema:str):
return html.Ul( return html.Ul(
[ [
html.Li(table) for table in stage.tables(schema=schema) html.Li(table) for table in stage.tables(schema=schema)
] ],
className="ml-4"
) )
layout = html.Div([ layout = html.Div([
html.H1('This is our Home page'),
html.Div(children=[ html.Div(children=[
html.Ul( html.Ul(
children=[ children=[
html.Li( html.Li(
children=[ children=[
html.Span(stagename), html.Span(
stagename,
className="text-2xl text-center p-2 bg-amber-100 rounded shadow"
),
html_list_schema(stage) html_list_schema(stage)
] ],
className="flex-1 bg-gray-100 rounded flex flex-col shadow"
) for stagename, stage in stages.items() ) for stagename, stage in stages.items()
] ],
className="flex flex-row space-x-2"
) )
]), ],
className="w-full mt-4 px-2"
),
]) ])