Show model version on dashboard
This commit is contained in:
parent
9e183bbfc0
commit
c5012e43a4
4 changed files with 22 additions and 9 deletions
|
|
@ -12,7 +12,7 @@ PATH = Path(__file__).parent.resolve()
|
|||
|
||||
|
||||
def bootstrap_dashboard(app: FastAPI, function_name: str, documentation: str) -> None:
|
||||
dash_app = create_dash_app(function_name, documentation)
|
||||
dash_app = create_dash_app(function_name, app.version, documentation)
|
||||
|
||||
app.mount(DASHBOARD_PATH, WSGIMiddleware(dash_app))
|
||||
|
||||
|
|
|
|||
|
|
@ -127,6 +127,15 @@ main > header > div > h1 {
|
|||
margin-top: 0;
|
||||
}
|
||||
|
||||
.version-tag {
|
||||
border-radius: var(--border-radius);
|
||||
background: #ddd;
|
||||
display: inline-block;
|
||||
font-size: 1rem;
|
||||
padding: 3px 6px;
|
||||
margin-left: var(--small-padding)
|
||||
}
|
||||
|
||||
main > header > *:nth-child(2) {
|
||||
min-width: 250px;
|
||||
max-width: 550px;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from .get_footer import get_footer
|
|||
from .get_traces_table import get_traces_table
|
||||
|
||||
|
||||
def create_dash_app(function_name: str, function_docs: str) -> Flask:
|
||||
def create_dash_app(function_name: str, version: str, function_docs: str) -> Flask:
|
||||
accent_color = text_to_hex_color(function_name)
|
||||
|
||||
app = Dash(
|
||||
|
|
@ -44,6 +44,7 @@ def create_dash_app(function_name: str, function_docs: str) -> Flask:
|
|||
[
|
||||
get_description(
|
||||
function_name=function_name,
|
||||
version=version,
|
||||
function_docs=function_docs,
|
||||
accent_color=accent_color,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -4,12 +4,15 @@ from ....helper import snake_case_to_text, strip_lines
|
|||
|
||||
|
||||
def get_description(
|
||||
function_name: str, function_docs: str, accent_color: str
|
||||
function_name: str, version: str, function_docs: str, accent_color: str
|
||||
) -> html.Div:
|
||||
return html.Div(
|
||||
[
|
||||
html.H1(
|
||||
[
|
||||
f"{snake_case_to_text(function_name)} - dashboard",
|
||||
html.Span(version, className="version-tag"),
|
||||
],
|
||||
style={"color": accent_color},
|
||||
),
|
||||
dcc.Markdown(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue