Spaces:
Running
Running
drguilhermeapolinario
commited on
Create teste.py
Browse files- pages/teste.py +102 -0
pages/teste.py
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from streamlit_option_menu import option_menu
|
3 |
+
|
4 |
+
from inicio import show_inicio
|
5 |
+
from chatbot_flamengo import show_chatbot_flamengo
|
6 |
+
from pdf_chat import show_pdf_chat
|
7 |
+
from notas_tecnicas import show_notas_tecnicas
|
8 |
+
from psiquiatria import show_psiquiatria
|
9 |
+
from medicina_familia import show_medicina_familia
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
if st.button("Home"):
|
14 |
+
st.switch_page("your_app.py")
|
15 |
+
if st.button("Page 1"):
|
16 |
+
st.switch_page("pages/page_1.py")
|
17 |
+
if st.button("Page 2"):
|
18 |
+
st.switch_page("pages/page_2.py")
|
19 |
+
|
20 |
+
|
21 |
+
with st.expander("Visualização", expanded=True):
|
22 |
+
selected_tab = option_menu(
|
23 |
+
menu_title=None,
|
24 |
+
options=["Faixa Etária", "Gênero", "Cor", "Deficiência", "Doenças", "Escolaridade", "Identidade de Gênero"],
|
25 |
+
icons=["person", "gender-female", "person-plus", "person-wheelchair", "capsule-pill", "school", "transgender"],
|
26 |
+
menu_icon="cast",
|
27 |
+
default_index=0,
|
28 |
+
orientation="horizontal",
|
29 |
+
styles={
|
30 |
+
"container": {"padding": "0!important", "background-color": "#262730"},
|
31 |
+
"icon": {"color": "#4FCBFC", "font-size": "18px"},
|
32 |
+
"nav-link": {
|
33 |
+
"font-size": "14px",
|
34 |
+
"text-align": "center",
|
35 |
+
"margin": "0px",
|
36 |
+
"padding": "10px",
|
37 |
+
"--hover-color": "#363940",
|
38 |
+
"color": "#FFFFFF",
|
39 |
+
},
|
40 |
+
"nav-link-selected": {"background-color": "#0083B8"},
|
41 |
+
"separator": {"border-color": "#4B4B4B"},
|
42 |
+
},
|
43 |
+
)
|
44 |
+
|
45 |
+
|
46 |
+
def show_inicio():
|
47 |
+
st.title("Página Inicial")
|
48 |
+
st.write("Bem-vindo à página inicial!")
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
+
|
53 |
+
Agora, use o selected_tab retornado pelo option_menu para determinar qual página mostrar:
|
54 |
+
python
|
55 |
+
st.set_page_config(page_title="Seu App", page_icon="🌙", layout="wide", initial_sidebar_state="expanded")
|
56 |
+
|
57 |
+
# Inject custom CSS to set the background color
|
58 |
+
st.markdown("""
|
59 |
+
<style>
|
60 |
+
.stApp {
|
61 |
+
background-color: #0E1117;
|
62 |
+
color: #FAFAFA;
|
63 |
+
}
|
64 |
+
</style>
|
65 |
+
""", unsafe_allow_html=True)
|
66 |
+
|
67 |
+
selected_tab = option_menu(
|
68 |
+
menu_title=None,
|
69 |
+
options=["Início", "Chatbot-Flamengo", "PDF-Chat", "Notas Técnicas", "Psiquiatria", "Medicina de família"],
|
70 |
+
icons=["person", "gender-female", "person-plus", "person-wheelchair", "capsule-pill", "school"],
|
71 |
+
menu_icon="cast",
|
72 |
+
default_index=0,
|
73 |
+
orientation="horizontal",
|
74 |
+
styles={
|
75 |
+
"container": {"padding": "0!important", "background-color": "#262730"},
|
76 |
+
"icon": {"color": "#4FCBFC", "font-size": "18px"},
|
77 |
+
"nav-link": {
|
78 |
+
"font-size": "14px",
|
79 |
+
"text-align": "center",
|
80 |
+
"margin": "0px",
|
81 |
+
"padding": "10px",
|
82 |
+
"--hover-color": "#363940",
|
83 |
+
"color": "#FFFFFF",
|
84 |
+
},
|
85 |
+
"nav-link-selected": {"background-color": "#0083B8"},
|
86 |
+
"separator": {"border-color": "#4B4B4B"},
|
87 |
+
},
|
88 |
+
)
|
89 |
+
|
90 |
+
# Renderize a página correspondente com base na seleção
|
91 |
+
if selected_tab == "Início":
|
92 |
+
show_inicio()
|
93 |
+
elif selected_tab == "Chatbot-Flamengo":
|
94 |
+
show_chatbot_flamengo()
|
95 |
+
elif selected_tab == "PDF-Chat":
|
96 |
+
show_pdf_chat()
|
97 |
+
elif selected_tab == "Notas Técnicas":
|
98 |
+
show_notas_tecnicas()
|
99 |
+
elif selected_tab == "Psiquiatria":
|
100 |
+
show_psiquiatria()
|
101 |
+
elif selected_tab == "Medicina de família":
|
102 |
+
show_medicina_familia()
|