Spaces:
Sleeping
Sleeping
Update app.py
#5
by
MiaadAlsulami
- opened
app.py
CHANGED
|
@@ -6,6 +6,14 @@ import requests
|
|
| 6 |
# Set page configuration (must be the first Streamlit command)
|
| 7 |
st.set_page_config(page_title="Ticket System", layout="centered", initial_sidebar_state="expanded")
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# Apply custom CSS for design
|
| 10 |
st.markdown(
|
| 11 |
"""
|
|
@@ -164,7 +172,8 @@ def main():
|
|
| 164 |
employee_ticket_status_page()
|
| 165 |
|
| 166 |
def submit_ticket_page():
|
| 167 |
-
st.image("logo.png", width=200)
|
|
|
|
| 168 |
st.markdown('<h1 style="color: #084C3C;">Submit a Ticket</h1>', unsafe_allow_html=True)
|
| 169 |
st.markdown('<p style="color: #084C3C;">Please fill out the form below to submit a ticket.</p>', unsafe_allow_html=True)
|
| 170 |
|
|
@@ -182,7 +191,8 @@ def submit_ticket_page():
|
|
| 182 |
st.success(f"Your ticket has been submitted successfully. Customer ID: {customer_id}")
|
| 183 |
|
| 184 |
def check_ticket_status_page():
|
| 185 |
-
st.image("logo.png", width=200)
|
|
|
|
| 186 |
st.markdown('<h1 style="color: #084C3C;">Check Ticket Status</h1>', unsafe_allow_html=True)
|
| 187 |
st.markdown('<p style="color: #084C3C;">Enter your Customer ID to view your tickets.</p>', unsafe_allow_html=True)
|
| 188 |
|
|
@@ -202,7 +212,8 @@ def check_ticket_status_page():
|
|
| 202 |
st.warning("Please enter your Customer ID.")
|
| 203 |
|
| 204 |
def faq_info_page():
|
| 205 |
-
st.image("logo.png", width=200)
|
|
|
|
| 206 |
st.markdown('<h1 style="color: #084C3C;">FAQ & Information</h1>', unsafe_allow_html=True)
|
| 207 |
|
| 208 |
faq_data = [
|
|
@@ -217,7 +228,8 @@ def faq_info_page():
|
|
| 217 |
st.markdown(f'<p style="color: #084C3C;">{answer}</p>', unsafe_allow_html=True)
|
| 218 |
|
| 219 |
def respond_to_ticket_page():
|
| 220 |
-
st.image("logo.png", width=200)
|
|
|
|
| 221 |
st.markdown('<h1 style="color: #084C3C;">Respond to a Ticket</h1>', unsafe_allow_html=True)
|
| 222 |
ticket_data = {
|
| 223 |
"Ticket Number": ["141", "565", "999"],
|
|
@@ -235,7 +247,8 @@ def respond_to_ticket_page():
|
|
| 235 |
st.button("Submit Response")
|
| 236 |
|
| 237 |
def employee_ticket_status_page():
|
| 238 |
-
st.image("logo.png", width=200)
|
|
|
|
| 239 |
st.markdown('<h1 style="color: #084C3C;">Ticket Status</h1>', unsafe_allow_html=True)
|
| 240 |
customer_id = st.text_input("Customer ID")
|
| 241 |
if st.button("Check Ticket Status"):
|
|
@@ -247,7 +260,8 @@ def employee_ticket_status_page():
|
|
| 247 |
st.dataframe(df)
|
| 248 |
|
| 249 |
def ticket_dashboard_page():
|
| 250 |
-
st.image("logo.png", width=200)
|
|
|
|
| 251 |
st.markdown('<h1 style="color: #084C3C;">Ticket Dashboard</h1>', unsafe_allow_html=True)
|
| 252 |
st.components.v1.iframe(
|
| 253 |
"https://app.powerbi.com/view?r=eyJrIjoiMDEwNzA2YjUtNGY0MC00NTFjLTg1ZTctYTZlZjQzOTUwNWUxIiwidCI6ImI0NTNkOTFiLTZhYzEtNGI2MS1iOGI4LTVlNjVlNDIyMjMzZiIsImMiOjl9",
|
|
@@ -257,7 +271,8 @@ def ticket_dashboard_page():
|
|
| 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)
|
| 262 |
customer_data = {
|
| 263 |
"Customer ID": ["C001", "C002", "C003"],
|
|
@@ -274,7 +289,8 @@ def customer_dashboard_page():
|
|
| 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)
|
| 279 |
|
| 280 |
# Define employee data
|
|
|
|
| 6 |
# Set page configuration (must be the first Streamlit command)
|
| 7 |
st.set_page_config(page_title="Ticket System", layout="centered", initial_sidebar_state="expanded")
|
| 8 |
|
| 9 |
+
def center_logo(image_path, width=200):
|
| 10 |
+
# Use columns to center the logo
|
| 11 |
+
col1, col2, col3 = st.columns([1, 2, 1]) # Adjust the ratios to center the logo
|
| 12 |
+
with col2: # Place the logo in the middle column
|
| 13 |
+
st.image(image_path, width=width, use_container_width=False) # Adjust width as needed
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
# Apply custom CSS for design
|
| 18 |
st.markdown(
|
| 19 |
"""
|
|
|
|
| 172 |
employee_ticket_status_page()
|
| 173 |
|
| 174 |
def submit_ticket_page():
|
| 175 |
+
#st.image("logo.png", width=200)
|
| 176 |
+
center_logo("logo.png") # Center the logo
|
| 177 |
st.markdown('<h1 style="color: #084C3C;">Submit a Ticket</h1>', unsafe_allow_html=True)
|
| 178 |
st.markdown('<p style="color: #084C3C;">Please fill out the form below to submit a ticket.</p>', unsafe_allow_html=True)
|
| 179 |
|
|
|
|
| 191 |
st.success(f"Your ticket has been submitted successfully. Customer ID: {customer_id}")
|
| 192 |
|
| 193 |
def check_ticket_status_page():
|
| 194 |
+
#st.image("logo.png", width=200)
|
| 195 |
+
center_logo("logo.png") # Center the logo
|
| 196 |
st.markdown('<h1 style="color: #084C3C;">Check Ticket Status</h1>', unsafe_allow_html=True)
|
| 197 |
st.markdown('<p style="color: #084C3C;">Enter your Customer ID to view your tickets.</p>', unsafe_allow_html=True)
|
| 198 |
|
|
|
|
| 212 |
st.warning("Please enter your Customer ID.")
|
| 213 |
|
| 214 |
def faq_info_page():
|
| 215 |
+
#st.image("logo.png", width=200)
|
| 216 |
+
center_logo("logo.png") # Center the logo
|
| 217 |
st.markdown('<h1 style="color: #084C3C;">FAQ & Information</h1>', unsafe_allow_html=True)
|
| 218 |
|
| 219 |
faq_data = [
|
|
|
|
| 228 |
st.markdown(f'<p style="color: #084C3C;">{answer}</p>', unsafe_allow_html=True)
|
| 229 |
|
| 230 |
def respond_to_ticket_page():
|
| 231 |
+
#st.image("logo.png", width=200)
|
| 232 |
+
center_logo("logo.png") # Center the logo
|
| 233 |
st.markdown('<h1 style="color: #084C3C;">Respond to a Ticket</h1>', unsafe_allow_html=True)
|
| 234 |
ticket_data = {
|
| 235 |
"Ticket Number": ["141", "565", "999"],
|
|
|
|
| 247 |
st.button("Submit Response")
|
| 248 |
|
| 249 |
def employee_ticket_status_page():
|
| 250 |
+
#st.image("logo.png", width=200)
|
| 251 |
+
center_logo("logo.png") # Center the logo
|
| 252 |
st.markdown('<h1 style="color: #084C3C;">Ticket Status</h1>', unsafe_allow_html=True)
|
| 253 |
customer_id = st.text_input("Customer ID")
|
| 254 |
if st.button("Check Ticket Status"):
|
|
|
|
| 260 |
st.dataframe(df)
|
| 261 |
|
| 262 |
def ticket_dashboard_page():
|
| 263 |
+
#st.image("logo.png", width=200)
|
| 264 |
+
center_logo("logo.png") # Center the logo
|
| 265 |
st.markdown('<h1 style="color: #084C3C;">Ticket Dashboard</h1>', unsafe_allow_html=True)
|
| 266 |
st.components.v1.iframe(
|
| 267 |
"https://app.powerbi.com/view?r=eyJrIjoiMDEwNzA2YjUtNGY0MC00NTFjLTg1ZTctYTZlZjQzOTUwNWUxIiwidCI6ImI0NTNkOTFiLTZhYzEtNGI2MS1iOGI4LTVlNjVlNDIyMjMzZiIsImMiOjl9",
|
|
|
|
| 271 |
)
|
| 272 |
|
| 273 |
def customer_dashboard_page():
|
| 274 |
+
#st.image("logo.png", width=200)
|
| 275 |
+
center_logo("logo.png") # Center the logo
|
| 276 |
st.markdown('<h1 style="color: #084C3C;">Customer Dashboard</h1>', unsafe_allow_html=True)
|
| 277 |
customer_data = {
|
| 278 |
"Customer ID": ["C001", "C002", "C003"],
|
|
|
|
| 289 |
)
|
| 290 |
|
| 291 |
def management_dashboard_page():
|
| 292 |
+
#st.image("logo.png", width=200)
|
| 293 |
+
center_logo("logo.png") # Center the logo
|
| 294 |
st.markdown('<h1 style="color: #084C3C;">Management Dashboard</h1>', unsafe_allow_html=True)
|
| 295 |
|
| 296 |
# Define employee data
|