feat: add schema and table listing
This commit is contained in:
0
dashboard/pages/__init__.py
Normal file
0
dashboard/pages/__init__.py
Normal 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()]),
|
||||
|
||||
@@ -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()
|
||||
]
|
||||
)
|
||||
]),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user