Redesign waiting room: Slowpoke illustration, queue info, timeout policy
Browse files- app/session_queue.py +27 -8
app/session_queue.py
CHANGED
|
@@ -143,23 +143,42 @@ def queue_gate() -> bool:
|
|
| 143 |
# Scrolling multilingual banner
|
| 144 |
language_banner()
|
| 145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
st.markdown(
|
| 147 |
"<div style='text-align:center; margin-top:20px;'>"
|
| 148 |
-
f"<img src='{
|
| 149 |
"</div>",
|
| 150 |
unsafe_allow_html=True,
|
| 151 |
)
|
| 152 |
st.markdown(
|
| 153 |
-
"<h3 style='text-align:center;'>Slowbro is
|
|
|
|
|
|
|
|
|
|
| 154 |
unsafe_allow_html=True,
|
| 155 |
)
|
| 156 |
|
| 157 |
-
|
| 158 |
-
st.
|
| 159 |
-
|
| 160 |
-
f"{n_active}/{_MAX_CONCURRENT}
|
| 161 |
-
|
| 162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
)
|
| 164 |
|
| 165 |
# โโ Rolling cultural facts โโ
|
|
|
|
| 143 |
# Scrolling multilingual banner
|
| 144 |
language_banner()
|
| 145 |
|
| 146 |
+
_SLOWPOKE_IMG = (
|
| 147 |
+
"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites"
|
| 148 |
+
"/pokemon/other/official-artwork/79.png"
|
| 149 |
+
)
|
| 150 |
+
|
| 151 |
+
n_active = active_count()
|
| 152 |
+
spots_left = spots_available()
|
| 153 |
+
|
| 154 |
+
# โโ Slowpoke waiting illustration โโ
|
| 155 |
st.markdown(
|
| 156 |
"<div style='text-align:center; margin-top:20px;'>"
|
| 157 |
+
f"<img src='{_SLOWPOKE_IMG}' width='120' />"
|
| 158 |
"</div>",
|
| 159 |
unsafe_allow_html=True,
|
| 160 |
)
|
| 161 |
st.markdown(
|
| 162 |
+
"<h3 style='text-align:center;'>Slowbro is busy crunching numbers...</h3>"
|
| 163 |
+
"<p style='text-align:center; color:gray;'>"
|
| 164 |
+
"All seats are taken! But don't worry โ Slowpoke is keeping "
|
| 165 |
+
"your spot warm. You'll get in as soon as someone finishes.</p>",
|
| 166 |
unsafe_allow_html=True,
|
| 167 |
)
|
| 168 |
|
| 169 |
+
# โโ Queue status โโ
|
| 170 |
+
q1, q2 = st.columns(2)
|
| 171 |
+
with q1:
|
| 172 |
+
st.metric("Active users", f"{n_active} / {_MAX_CONCURRENT}")
|
| 173 |
+
with q2:
|
| 174 |
+
st.metric("Seats available", str(spots_left))
|
| 175 |
+
|
| 176 |
+
# โโ Session policy note โโ
|
| 177 |
+
st.warning(
|
| 178 |
+
"**How the queue works:** Each user gets a seat for as long as "
|
| 179 |
+
"they're active. Sessions expire after **2 minutes** of inactivity "
|
| 180 |
+
"to keep things moving โ but if you're running a model, your seat "
|
| 181 |
+
"is safe until estimation completes."
|
| 182 |
)
|
| 183 |
|
| 184 |
# โโ Rolling cultural facts โโ
|