ajuste do logoff
This commit is contained in:
parent
2fadd723dc
commit
ae74686c9b
34
manager.py
34
manager.py
@ -254,8 +254,13 @@ def login_page():
|
|||||||
|
|
||||||
# Modificar a função de logout no dashboard
|
# Modificar a função de logout no dashboard
|
||||||
def dashboard():
|
def dashboard():
|
||||||
|
# Versão do sistema
|
||||||
|
APP_VERSION = "2.3"
|
||||||
|
|
||||||
show_logo()
|
show_logo()
|
||||||
st.sidebar.markdown('<div class="sidebar-header">TranscreveZAP - Menu</div>', unsafe_allow_html=True)
|
st.sidebar.markdown('<div class="sidebar-header">TranscreveZAP - Menu</div>', unsafe_allow_html=True)
|
||||||
|
st.sidebar.markdown(f'<div style="text-align: center; color: gray; font-size: 0.8em;">versão {APP_VERSION}</div>', unsafe_allow_html=True)
|
||||||
|
|
||||||
# Mostrar nome do usuário logado (se disponível)
|
# Mostrar nome do usuário logado (se disponível)
|
||||||
if hasattr(st.session_state, 'session_id'):
|
if hasattr(st.session_state, 'session_id'):
|
||||||
st.sidebar.markdown("---")
|
st.sidebar.markdown("---")
|
||||||
@ -266,15 +271,34 @@ def dashboard():
|
|||||||
["📊 Painel de Controle", "👥 Gerenciar Grupos", "🚫 Gerenciar Bloqueios", "⚙️ Configurações"]
|
["📊 Painel de Controle", "👥 Gerenciar Grupos", "🚫 Gerenciar Bloqueios", "⚙️ Configurações"]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Botão de logout
|
# Seção de logout com confirmação
|
||||||
if st.sidebar.button("🚪 Sair da Conta"):
|
st.sidebar.markdown("---")
|
||||||
confirm = st.sidebar.empty()
|
logout_container = st.sidebar.container()
|
||||||
if confirm.button("✅ Confirmar Saída"):
|
|
||||||
|
# Verifica se já existe um estado para confirmação de logout
|
||||||
|
if 'logout_confirmation' not in st.session_state:
|
||||||
|
st.session_state.logout_confirmation = False
|
||||||
|
|
||||||
|
# Botão principal de logout
|
||||||
|
if not st.session_state.logout_confirmation:
|
||||||
|
if logout_container.button("🚪 Sair da Conta"):
|
||||||
|
st.session_state.logout_confirmation = True
|
||||||
|
st.experimental_rerun()
|
||||||
|
|
||||||
|
# Botões de confirmação
|
||||||
|
if st.session_state.logout_confirmation:
|
||||||
|
col1, col2 = st.sidebar.columns(2)
|
||||||
|
|
||||||
|
if col1.button("✅ Confirmar"):
|
||||||
|
st.session_state.logout_confirmation = False
|
||||||
end_session()
|
end_session()
|
||||||
st.experimental_rerun()
|
st.experimental_rerun()
|
||||||
elif st.sidebar.button("❌ Cancelar"):
|
|
||||||
|
if col2.button("❌ Cancelar"):
|
||||||
|
st.session_state.logout_confirmation = False
|
||||||
st.experimental_rerun()
|
st.experimental_rerun()
|
||||||
|
|
||||||
|
# Renderiza a página selecionada
|
||||||
if page == "📊 Painel de Controle":
|
if page == "📊 Painel de Controle":
|
||||||
show_statistics()
|
show_statistics()
|
||||||
elif page == "👥 Gerenciar Grupos":
|
elif page == "👥 Gerenciar Grupos":
|
||||||
|
Loading…
Reference in New Issue
Block a user