From e3ee2d74a9a4f3a46caec887e4acf506fca83809 Mon Sep 17 00:00:00 2001 From: Jeff Tang <47529643+jmtang2018@users.noreply.github.com> Date: Fri, 27 Sep 2024 12:42:14 -0400 Subject: [PATCH 1/2] add tabs --- README.md | 2 +- SECURITY.md | 4 +- src/dashboard.py | 124 ++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 116 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 5ed8f2f..c00e8f9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Docs for the Bridge2AI Voice Project. -[![Github](https://img.shields.io/badge/github-0.3.0-green?style=flat&logo=github)](https://github.com/eipm/bridge2ai-docs) [![Python 3.11.5](https://img.shields.io/badge/python-3.12.0-blue.svg)](https://www.python.org/downloads/release/python-3120/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![DOI](https://zenodo.org/badge/860006845.svg)](https://zenodo.org/doi/10.5281/zenodo.13834653) +[![Github](https://img.shields.io/badge/github-0.4.0-green?style=flat&logo=github)](https://github.com/eipm/bridge2ai-docs) [![Python 3.11.5](https://img.shields.io/badge/python-3.12.0-blue.svg)](https://www.python.org/downloads/release/python-3120/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![DOI](https://zenodo.org/badge/860006845.svg)](https://zenodo.org/doi/10.5281/zenodo.13834653) ## 🤝 License diff --git a/SECURITY.md b/SECURITY.md index 74a49fa..4241bd8 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -7,8 +7,8 @@ currently being supported with security updates. | Version | Supported | | ------- | ------------------ | -| v0.3.0 | :white_check_mark: | -| < v0.3.0 | :x: | +| v0.4.0 | :white_check_mark: | +| < v0.4.0 | :x: | ## Reporting a Vulnerability diff --git a/src/dashboard.py b/src/dashboard.py index 4a50fbb..798b940 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -5,24 +5,126 @@ custom_style = """ """ + +def coming_soom_message(tab_name): + # Your Streamlit application code + st.title('Bridge2AI Voice Dashboard') + st.write(f"{tab_name} - Coming soon!") + + # Add an image to the page + image_path = "images/Wave.png" # Replace with your image file name + st.image(image_path, caption='', use_column_width=True) + +def about_page(tab_name): + coming_soom_message(tab_name) + +def healthsheet_page(tab_name): + coming_soom_message(tab_name) + +def study_dashboard_page(tab_name): + coming_soom_message(tab_name) -st.set_page_config( - page_title="Bridge2AI Voice Dashboard", - page_icon="images/B2AI Logo.ico", - layout="wide") +def study_metadata_page(tab_name): + coming_soom_message(tab_name) -st.markdown(custom_style, unsafe_allow_html=True) +def dataset_metadata_page(tab_name): + coming_soom_message(tab_name) + +def dataset_structure_preview_page(tab_name): + coming_soom_message(tab_name) + +def dataset_quality_dashboard_page(tab_name): + coming_soom_message(tab_name) + +def dataset_uses_page(tab_name): + coming_soom_message(tab_name) + +def create_tabs(tabs_func): + tab_names = list(tabs_func.keys()) + tabs = st.tabs(tab_names) + for tab, name in zip(tabs, tab_names): + with tab: + tabs_func[name](name) + +def config_page(version): + st.set_page_config( + page_title="Bridge2AI Voice Dashboard", + page_icon="images/B2AI Logo.ico", + layout="wide") -# Your Streamlit application code -st.title('Bridge2AI Voice Dashboard') -st.write("Coming soon!") + st.markdown(custom_style, unsafe_allow_html=True) + + # Add the footer + footer = f""" + + """ + st.markdown(footer, unsafe_allow_html=True) + + +def main(): + # Define the version variable + version = "0.4.0" + # Map tab names to functions + tab_functions = { + "About": about_page, + "Healthsheet": healthsheet_page, + "Study Dashboard": study_dashboard_page, + "Study Metadata": study_metadata_page, + "Dataset Metadata": dataset_metadata_page, + "Dataset Structure Preview": dataset_structure_preview_page, + "Dataset Quality Dashboard": dataset_quality_dashboard_page, + "Dataset Uses": dataset_uses_page + } + + # Set page configuration + config_page(version) + # Create tabs + create_tabs(tab_functions) -# Add an image to the page -image_path = "images/Wave.png" # Replace with your image file name -st.image(image_path, caption='', use_column_width=True) +if __name__ == "__main__": + main() From 5cc75080f9e7e523efbc4eb960c16ef4e87e2216 Mon Sep 17 00:00:00 2001 From: Jeff Tang <47529643+jmtang2018@users.noreply.github.com> Date: Fri, 27 Sep 2024 12:46:09 -0400 Subject: [PATCH 2/2] fixed typo --- src/dashboard.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/dashboard.py b/src/dashboard.py index 798b940..898a220 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -46,7 +46,7 @@ """ -def coming_soom_message(tab_name): +def coming_soon_message(tab_name): # Your Streamlit application code st.title('Bridge2AI Voice Dashboard') st.write(f"{tab_name} - Coming soon!") @@ -56,28 +56,28 @@ def coming_soom_message(tab_name): st.image(image_path, caption='', use_column_width=True) def about_page(tab_name): - coming_soom_message(tab_name) + coming_soon_message(tab_name) def healthsheet_page(tab_name): - coming_soom_message(tab_name) + coming_soon_message(tab_name) def study_dashboard_page(tab_name): - coming_soom_message(tab_name) + coming_soon_message(tab_name) def study_metadata_page(tab_name): - coming_soom_message(tab_name) + coming_soon_message(tab_name) def dataset_metadata_page(tab_name): - coming_soom_message(tab_name) + coming_soon_message(tab_name) def dataset_structure_preview_page(tab_name): - coming_soom_message(tab_name) + coming_soon_message(tab_name) def dataset_quality_dashboard_page(tab_name): - coming_soom_message(tab_name) + coming_soon_message(tab_name) def dataset_uses_page(tab_name): - coming_soom_message(tab_name) + coming_soon_message(tab_name) def create_tabs(tabs_func): tab_names = list(tabs_func.keys())