Spaces:
Sleeping
Sleeping
Update app.py
#1
by
MiaadAlsulami
- opened
app.py
CHANGED
|
@@ -10,6 +10,16 @@ st.set_page_config(page_title="Ticket System", layout="centered", initial_sideba
|
|
| 10 |
st.markdown(
|
| 11 |
"""
|
| 12 |
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
.stApp { background-color: #E4ECE3; }
|
| 14 |
section[data-testid="stSidebar"] { background-color: #084C3C; }
|
| 15 |
section[data-testid="stSidebar"] p, section[data-testid="stSidebar"] label { color: white; }
|
|
@@ -60,8 +70,6 @@ st.markdown(
|
|
| 60 |
unsafe_allow_html=True
|
| 61 |
)
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
| 65 |
# Sample user data for login
|
| 66 |
users = {
|
| 67 |
"manager123": {"password": "managerpass", "role": "Manager"},
|
|
@@ -84,8 +92,6 @@ def show_loading_animation():
|
|
| 84 |
if lottie_json:
|
| 85 |
st_lottie(lottie_json, height=300, key="loading")
|
| 86 |
|
| 87 |
-
|
| 88 |
-
|
| 89 |
def login_page():
|
| 90 |
|
| 91 |
# Add custom styling and an image at the top
|
|
@@ -110,8 +116,6 @@ def login_page():
|
|
| 110 |
else:
|
| 111 |
st.error("Invalid username or password.")
|
| 112 |
|
| 113 |
-
|
| 114 |
-
|
| 115 |
def add_return_to_login():
|
| 116 |
if "logged_in" in st.session_state and st.session_state["logged_in"]:
|
| 117 |
if st.sidebar.button("Back"):
|
|
@@ -125,7 +129,6 @@ def main():
|
|
| 125 |
|
| 126 |
add_return_to_login()
|
| 127 |
|
| 128 |
-
|
| 129 |
user_type = st.session_state.get("user_type", "Customer")
|
| 130 |
st.sidebar.title("Navigation")
|
| 131 |
|
|
@@ -253,7 +256,6 @@ def ticket_dashboard_page():
|
|
| 253 |
scrolling=True
|
| 254 |
)
|
| 255 |
|
| 256 |
-
|
| 257 |
def customer_dashboard_page():
|
| 258 |
st.image("logo.png", width=200)
|
| 259 |
st.markdown('<h1 style="color: #084C3C;">Customer Dashboard</h1>', unsafe_allow_html=True)
|
|
@@ -271,26 +273,6 @@ def customer_dashboard_page():
|
|
| 271 |
scrolling=True
|
| 272 |
)
|
| 273 |
|
| 274 |
-
# def management_dashboard_page():
|
| 275 |
-
# st.image("logo.png", width=200)
|
| 276 |
-
# st.markdown('<h1 style="color: #084C3C;">Management Dashboard</h1>', unsafe_allow_html=True)
|
| 277 |
-
# employee_data = {
|
| 278 |
-
# "Employee ID": ["E001", "E002", "E003"],
|
| 279 |
-
# "Name": ["John Doe", "Jane Smith", "Ali Ahmad"],
|
| 280 |
-
# "Performance Score": [85, 90, 88],
|
| 281 |
-
# }
|
| 282 |
-
# df_employee = pd.DataFrame(employee_data)
|
| 283 |
-
# st.dataframe(df_employee)
|
| 284 |
-
# df = pd.DataFrame(customer_data)
|
| 285 |
-
# st.dataframe(df)
|
| 286 |
-
# st.components.v1.iframe(
|
| 287 |
-
# "https://app.powerbi.com/view?r=eyJrIjoiMzQ5N2RlMDQtY2I5ZC00NWE5LWE0ZjItMjExMzgyNmNmZWFjIiwidCI6ImI0NTNkOTFiLTZhYzEtNGI2MS1iOGI4LTVlNjVlNDIyMjMzZiIsImMiOjl9",
|
| 288 |
-
# height=800,
|
| 289 |
-
# width=1000,
|
| 290 |
-
# scrolling=True
|
| 291 |
-
# )
|
| 292 |
-
|
| 293 |
-
|
| 294 |
def management_dashboard_page():
|
| 295 |
st.image("logo.png", width=200)
|
| 296 |
st.markdown('<h1 style="color: #084C3C;">Management Dashboard</h1>', unsafe_allow_html=True)
|
|
@@ -314,10 +296,6 @@ def management_dashboard_page():
|
|
| 314 |
scrolling=True
|
| 315 |
)
|
| 316 |
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
def customize_navigation_menu_dark_green():
|
| 322 |
st.markdown(
|
| 323 |
"""
|
|
@@ -339,7 +317,6 @@ def customize_navigation_menu_dark_green():
|
|
| 339 |
unsafe_allow_html=True
|
| 340 |
)
|
| 341 |
|
| 342 |
-
|
| 343 |
def customize_login_page_with_image(image_path):
|
| 344 |
st.markdown(
|
| 345 |
"""
|
|
@@ -355,8 +332,6 @@ def customize_login_page_with_image(image_path):
|
|
| 355 |
# Add the image at the top of the page
|
| 356 |
st.image(image_path, width=200, use_container_width=False)
|
| 357 |
|
| 358 |
-
|
| 359 |
-
|
| 360 |
def customize_submit_button():
|
| 361 |
st.markdown(
|
| 362 |
"""
|
|
@@ -380,8 +355,6 @@ def customize_submit_button():
|
|
| 380 |
unsafe_allow_html=True
|
| 381 |
)
|
| 382 |
|
| 383 |
-
|
| 384 |
-
|
| 385 |
def customize_button_text_color():
|
| 386 |
st.markdown(
|
| 387 |
"""
|
|
@@ -395,9 +368,7 @@ def customize_button_text_color():
|
|
| 395 |
unsafe_allow_html=True
|
| 396 |
)
|
| 397 |
|
| 398 |
-
|
| 399 |
-
|
| 400 |
if __name__ == "__main__":
|
| 401 |
customize_navigation_menu_dark_green()
|
| 402 |
customize_button_text_color()
|
| 403 |
-
main()
|
|
|
|
| 10 |
st.markdown(
|
| 11 |
"""
|
| 12 |
<style>
|
| 13 |
+
/* Hide the header */
|
| 14 |
+
header[data-testid="stHeader"] {
|
| 15 |
+
display: none;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
/* Adjust the main content area to fill the space */
|
| 19 |
+
.stApp {
|
| 20 |
+
margin-top: -50px;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
.stApp { background-color: #E4ECE3; }
|
| 24 |
section[data-testid="stSidebar"] { background-color: #084C3C; }
|
| 25 |
section[data-testid="stSidebar"] p, section[data-testid="stSidebar"] label { color: white; }
|
|
|
|
| 70 |
unsafe_allow_html=True
|
| 71 |
)
|
| 72 |
|
|
|
|
|
|
|
| 73 |
# Sample user data for login
|
| 74 |
users = {
|
| 75 |
"manager123": {"password": "managerpass", "role": "Manager"},
|
|
|
|
| 92 |
if lottie_json:
|
| 93 |
st_lottie(lottie_json, height=300, key="loading")
|
| 94 |
|
|
|
|
|
|
|
| 95 |
def login_page():
|
| 96 |
|
| 97 |
# Add custom styling and an image at the top
|
|
|
|
| 116 |
else:
|
| 117 |
st.error("Invalid username or password.")
|
| 118 |
|
|
|
|
|
|
|
| 119 |
def add_return_to_login():
|
| 120 |
if "logged_in" in st.session_state and st.session_state["logged_in"]:
|
| 121 |
if st.sidebar.button("Back"):
|
|
|
|
| 129 |
|
| 130 |
add_return_to_login()
|
| 131 |
|
|
|
|
| 132 |
user_type = st.session_state.get("user_type", "Customer")
|
| 133 |
st.sidebar.title("Navigation")
|
| 134 |
|
|
|
|
| 256 |
scrolling=True
|
| 257 |
)
|
| 258 |
|
|
|
|
| 259 |
def customer_dashboard_page():
|
| 260 |
st.image("logo.png", width=200)
|
| 261 |
st.markdown('<h1 style="color: #084C3C;">Customer Dashboard</h1>', unsafe_allow_html=True)
|
|
|
|
| 273 |
scrolling=True
|
| 274 |
)
|
| 275 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 276 |
def management_dashboard_page():
|
| 277 |
st.image("logo.png", width=200)
|
| 278 |
st.markdown('<h1 style="color: #084C3C;">Management Dashboard</h1>', unsafe_allow_html=True)
|
|
|
|
| 296 |
scrolling=True
|
| 297 |
)
|
| 298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 299 |
def customize_navigation_menu_dark_green():
|
| 300 |
st.markdown(
|
| 301 |
"""
|
|
|
|
| 317 |
unsafe_allow_html=True
|
| 318 |
)
|
| 319 |
|
|
|
|
| 320 |
def customize_login_page_with_image(image_path):
|
| 321 |
st.markdown(
|
| 322 |
"""
|
|
|
|
| 332 |
# Add the image at the top of the page
|
| 333 |
st.image(image_path, width=200, use_container_width=False)
|
| 334 |
|
|
|
|
|
|
|
| 335 |
def customize_submit_button():
|
| 336 |
st.markdown(
|
| 337 |
"""
|
|
|
|
| 355 |
unsafe_allow_html=True
|
| 356 |
)
|
| 357 |
|
|
|
|
|
|
|
| 358 |
def customize_button_text_color():
|
| 359 |
st.markdown(
|
| 360 |
"""
|
|
|
|
| 368 |
unsafe_allow_html=True
|
| 369 |
)
|
| 370 |
|
|
|
|
|
|
|
| 371 |
if __name__ == "__main__":
|
| 372 |
customize_navigation_menu_dark_green()
|
| 373 |
customize_button_text_color()
|
| 374 |
+
main()
|