Spaces:
Sleeping
Sleeping
Move set_page_config to entry script only; wrap in try/except to survive multipage navigation
Browse files
frontend/dashboard.py
CHANGED
|
@@ -35,14 +35,20 @@ from utils.metrics_engine import (
|
|
| 35 |
# PAGE CONFIG
|
| 36 |
# ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 37 |
|
| 38 |
-
st.set_page_config(
|
| 39 |
-
page_title="AtliQ Hospitality Dashboard",
|
| 40 |
-
page_icon="π¨",
|
| 41 |
-
layout="wide",
|
| 42 |
-
initial_sidebar_state="expanded",
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
# Custom CSS for better KPI cards
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
st.markdown("""
|
| 47 |
<style>
|
| 48 |
[data-testid="stMetricValue"] { font-size: 1.8rem; }
|
|
|
|
| 35 |
# PAGE CONFIG
|
| 36 |
# ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
# Custom CSS for better KPI cards
|
| 39 |
+
try:
|
| 40 |
+
st.set_page_config(
|
| 41 |
+
page_title="AtliQ Hospitality Dashboard",
|
| 42 |
+
page_icon="π¨",
|
| 43 |
+
layout="wide",
|
| 44 |
+
initial_sidebar_state="expanded",
|
| 45 |
+
)
|
| 46 |
+
except Exception:
|
| 47 |
+
# set_page_config can only be called once per session.
|
| 48 |
+
# If a sub-page already triggered Streamlit, swallow the error
|
| 49 |
+
# so the rest of the dashboard still renders.
|
| 50 |
+
pass
|
| 51 |
+
|
| 52 |
st.markdown("""
|
| 53 |
<style>
|
| 54 |
[data-testid="stMetricValue"] { font-size: 1.8rem; }
|
frontend/pages/02_Chat_with_Data.py
CHANGED
|
@@ -21,12 +21,6 @@ Features:
|
|
| 21 |
import streamlit as st
|
| 22 |
from agents.agents import query_data_agent
|
| 23 |
|
| 24 |
-
st.set_page_config(
|
| 25 |
-
page_title="Chat with Data β AtliQ",
|
| 26 |
-
page_icon="π¬",
|
| 27 |
-
layout="wide",
|
| 28 |
-
)
|
| 29 |
-
|
| 30 |
|
| 31 |
# ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 32 |
# PAGE CONFIG
|
|
|
|
| 21 |
import streamlit as st
|
| 22 |
from agents.agents import query_data_agent
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
# ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 26 |
# PAGE CONFIG
|
frontend/pages/03_KPI_Monitoring.py
CHANGED
|
@@ -18,13 +18,6 @@ Features:
|
|
| 18 |
"""
|
| 19 |
|
| 20 |
import streamlit as st
|
| 21 |
-
|
| 22 |
-
st.set_page_config(
|
| 23 |
-
page_title="KPI Monitoring β AtliQ",
|
| 24 |
-
page_icon="π¨",
|
| 25 |
-
layout="wide",
|
| 26 |
-
)
|
| 27 |
-
|
| 28 |
import pandas as pd
|
| 29 |
import numpy as np
|
| 30 |
import plotly.express as px
|
|
|
|
| 18 |
"""
|
| 19 |
|
| 20 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
import pandas as pd
|
| 22 |
import numpy as np
|
| 23 |
import plotly.express as px
|
frontend/pages/04_Document_Intelligence.py
CHANGED
|
@@ -9,13 +9,6 @@ from pathlib import Path
|
|
| 9 |
sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent))
|
| 10 |
|
| 11 |
import streamlit as st
|
| 12 |
-
|
| 13 |
-
st.set_page_config(
|
| 14 |
-
page_title="Document Intelligence β AtliQ",
|
| 15 |
-
page_icon="π",
|
| 16 |
-
layout="wide",
|
| 17 |
-
)
|
| 18 |
-
|
| 19 |
import pandas as pd
|
| 20 |
import plotly.graph_objects as go
|
| 21 |
import networkx as nx
|
|
|
|
| 9 |
sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent))
|
| 10 |
|
| 11 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
import pandas as pd
|
| 13 |
import plotly.graph_objects as go
|
| 14 |
import networkx as nx
|