|
import streamlit as st |
|
import sys |
|
import os |
|
from pathlib import Path |
|
|
|
|
|
app_dir = Path(__file__).parent |
|
sys.path.insert(0, str(app_dir)) |
|
|
|
from pages.dashboard import create_dashboard_page |
|
from pages.settings import create_settings_page |
|
from utils.config import load_config |
|
from utils.logging import setup_logging, get_logger |
|
|
|
|
|
setup_logging() |
|
logger = get_logger(__name__) |
|
|
|
def main(): |
|
"""Main application entry point""" |
|
try: |
|
|
|
st.set_page_config( |
|
page_title="MONA - Monitoring & Analytics", |
|
page_icon="π", |
|
layout="wide", |
|
initial_sidebar_state="expanded" |
|
) |
|
|
|
|
|
config = load_config() |
|
logger.info("Application started successfully") |
|
|
|
|
|
st.sidebar.title("MONA Dashboard") |
|
page = st.sidebar.selectbox( |
|
"Navigate to:", |
|
["Dashboard", "Settings", "About"] |
|
) |
|
|
|
|
|
if page == "Dashboard": |
|
create_dashboard_page() |
|
elif page == "Settings": |
|
create_settings_page() |
|
elif page == "About": |
|
create_about_page() |
|
|
|
except Exception as e: |
|
logger.error(f"Application error: {str(e)}") |
|
st.error(f"An error occurred: {str(e)}") |
|
|
|
def create_about_page(): |
|
"""Create the about page""" |
|
st.title("About MONA") |
|
st.write(""" |
|
MONA (Monitoring & Analytics) is a comprehensive dashboard application |
|
for data visualization and monitoring. |
|
|
|
**Features:** |
|
- Real-time data monitoring |
|
- Interactive dashboards |
|
- Data analytics and reporting |
|
- Customizable settings |
|
""") |
|
|
|
if __name__ == "__main__": |
|
main() |