Skip to content

Commit

Permalink
Add logout button
Browse files Browse the repository at this point in the history
  • Loading branch information
Odrec committed Oct 18, 2024
1 parent 7479728 commit 7859ed6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
API_URL = os.getenv("API_URL")
FFMPEG_PATH = os.getenv("FFMPEG_PATH") or "ffmpeg"
TEMP_PATH = os.getenv("TEMP_PATH") or "/tmp/transcription-whisper"
LOGOUT_URL = os.getenv("LOGOUT_URL")

base_temp_dir = os.path.expanduser(TEMP_PATH)
os.makedirs(base_temp_dir, exist_ok=True)
Expand Down Expand Up @@ -233,6 +234,26 @@ def callback_disable_controls():
else:
delete_button_clicked = False

# Add Logout button if LOGOUT_URL is set
if LOGOUT_URL:
st.sidebar.markdown(f"""
<a href="{LOGOUT_URL}" target="_self">
<button style="
background-color:#f44336;
border:none;
color:white;
padding:10px 20px;
text-align:center;
text-decoration:none;
display:inline-block;
font-size:16px;
margin:4px 2px;
cursor:pointer;
border-radius:4px;
">Logout</button>
</a>
""", unsafe_allow_html=True)

conversion_placeholder = st.empty() # Placeholder for conversion message
upload_placeholder = st.empty() # Placeholder for upload message

Expand Down

0 comments on commit 7859ed6

Please sign in to comment.