diff --git a/README.md b/README.md index 524bd6d..67795b6 100644 --- a/README.md +++ b/README.md @@ -99,4 +99,4 @@ For archival purposes, as option 2 was the initial approach, we provide: All the best practices can be seen in the [demo_app API implementation](https://github.com/ai4os-hub/ai4os-demo-app/blob/main/ai4os_demo_app/api.py). Here is how the UI looks like (left-hand side are inputs, right-hand side are outputs): -![](demo-ui.png) +![](./_static/images/demo-ui.png) diff --git a/demo-ui.png b/_static/images/demo-ui.png similarity index 100% rename from demo-ui.png rename to _static/images/demo-ui.png diff --git a/favicon.ico b/_static/images/favicon.ico similarity index 100% rename from favicon.ico rename to _static/images/favicon.ico diff --git a/_static/images/logo-ai4eosc.png b/_static/images/logo-ai4eosc.png new file mode 100644 index 0000000..816a257 Binary files /dev/null and b/_static/images/logo-ai4eosc.png differ diff --git a/_static/images/logo-imagine.png b/_static/images/logo-imagine.png new file mode 100644 index 0000000..a84cc74 Binary files /dev/null and b/_static/images/logo-imagine.png differ diff --git a/launch.py b/launch.py index 1cab2e3..0bbfe59 100644 --- a/launch.py +++ b/launch.py @@ -137,7 +137,6 @@ def main(api_url, ui_port): theme=gr.themes.Default( primary_hue=gr.themes.colors.cyan, ), - css=".ai4eosc-logo {border-radius: 10px;}", ) interfaces.append(interface) @@ -156,7 +155,7 @@ def main(api_url, ui_port): server_port=ui_port, show_error = True, debug=False, - favicon_path='./favicon.ico' + favicon_path='./_static/images/favicon.ico' ) diff --git a/ui_utils.py b/ui_utils.py index 46cfabf..649d384 100644 --- a/ui_utils.py +++ b/ui_utils.py @@ -18,6 +18,7 @@ import inspect import json import mimetypes +import os from pathlib import Path import re import requests @@ -370,6 +371,27 @@ def generate_footer(metadata): version_text = f"deepaas_ui/{git_branch}@{git_commit[:5]}" version_link = f"https://github.com/ai4os/deepaas_ui/tree/{git_commit}" + # Get module description + description = metadata.get('description', '') + if not description: + # In old modules, description was named "summary" + description = metadata.get('summary', '') + + # Get the appropriate logo (default is "ai4eosc") + namespace = os.getenv('NOMAD_NAMESPACE', 'ai4eosc') + namespace = namespace if namespace in ['imagine'] else 'ai4eosc' # other namespace don't have logo + homepages = { + 'ai4eosc': 'https://ai4eosc.eu/', + 'imagine': 'https://www.imagine-ai.eu/', + } + logo = f""" + +
+ +
+
+ """ + # Generate the footer author = metadata.get('author', '') if isinstance(author, list): @@ -377,14 +399,10 @@ def generate_footer(metadata): footer = f""" Author(s): {author}
- Summary: {metadata.get('summary', '')}
+ Description:: {metadata.get('summary', '')}
UI version: {version_text}


- -
- -
-
+ {logo} """ footer = inspect.cleandoc(footer) return footer