feat: add schema and table listing

This commit is contained in:
2024-07-27 17:39:09 +02:00
parent a533443caf
commit 13f80d8553
10 changed files with 185 additions and 6 deletions

View File

View File

@@ -1,4 +1,3 @@
import dash
from dash import html
from dotenv import dotenv_values
import os
@@ -9,8 +8,6 @@ env = {
}
dash.register_page(__name__, path='/config')
layout = html.Div([
html.H1('This is our Config page'),
html.Ul(children = [html.Li(f"{k} = {v}") for k,v in env.items()]),

View File

@@ -1,9 +1,51 @@
import dash
from dash import html
from ..datalake import stages
from ..libs.stage.stage import AbstractStage
def html_list_schema(stage:AbstractStage, with_tables=True):
""" Build html list of schema in stage """
if with_tables:
return html.Ul(
[
html.Li(
children = [
html.Span(schema),
html_list_table(stage, schema)
]
) for schema in stage.schemas()
]
)
return html.Ul(
[
html.Li(schema) for schema in stage.schemas()
]
)
def html_list_table(stage:AbstractStage, schema:str):
""" Build html list of table in stage """
return html.Ul(
[
html.Li(table) for table in stage.tables(schema=schema)
]
)
dash.register_page(__name__, path='/')
layout = html.Div([
html.H1('This is our Home page'),
html.Div('This is our Home page content.'),
html.Div(children=[
html.Ul(
children=[
html.Li(
children=[
html.Span(stagename),
html_list_schema(stage)
]
) for stagename, stage in stages.items()
]
)
]),
])