diff --git a/src/great_ai/great_ai/deploy/routes/bootstrap_dashboard.py b/src/great_ai/great_ai/deploy/routes/bootstrap_dashboard.py index 01520a9..660db1e 100644 --- a/src/great_ai/great_ai/deploy/routes/bootstrap_dashboard.py +++ b/src/great_ai/great_ai/deploy/routes/bootstrap_dashboard.py @@ -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)) diff --git a/src/great_ai/great_ai/deploy/routes/dashboard/assets/index.css b/src/great_ai/great_ai/deploy/routes/dashboard/assets/index.css index d463de9..e287b4f 100644 --- a/src/great_ai/great_ai/deploy/routes/dashboard/assets/index.css +++ b/src/great_ai/great_ai/deploy/routes/dashboard/assets/index.css @@ -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; diff --git a/src/great_ai/great_ai/deploy/routes/dashboard/create_dash_app.py b/src/great_ai/great_ai/deploy/routes/dashboard/create_dash_app.py index 7c2acae..6b4c5ed 100644 --- a/src/great_ai/great_ai/deploy/routes/dashboard/create_dash_app.py +++ b/src/great_ai/great_ai/deploy/routes/dashboard/create_dash_app.py @@ -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, ), diff --git a/src/great_ai/great_ai/deploy/routes/dashboard/get_description.py b/src/great_ai/great_ai/deploy/routes/dashboard/get_description.py index 433442c..8982f24 100644 --- a/src/great_ai/great_ai/deploy/routes/dashboard/get_description.py +++ b/src/great_ai/great_ai/deploy/routes/dashboard/get_description.py @@ -4,26 +4,29 @@ 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", + [ + f"{snake_case_to_text(function_name)} - dashboard", + html.Span(version, className="version-tag"), + ], style={"color": accent_color}, ), dcc.Markdown( strip_lines( f""" - > View the live data of your deployment here. + > View the live data of your deployment here. - ## Using the API + ## Using the API - You can find the available endpoints at [/docs](/docs). + You can find the available endpoints at [/docs](/docs). - ## Details + ## Details - {function_docs} + {function_docs} """ ), className="description",