Dmitry Beresnev
commited on
Commit
·
7087fa0
1
Parent(s):
a0ea8f4
fix spinner in news dashboard
Browse files- app/pages/05_Dashboard.py +19 -1
app/pages/05_Dashboard.py
CHANGED
|
@@ -298,8 +298,26 @@ def fetch_ai_tech_news():
|
|
| 298 |
# Create a status placeholder to show progress
|
| 299 |
status_placeholder = st.empty()
|
| 300 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 301 |
# Execute all news fetching operations in parallel using ThreadPoolExecutor
|
| 302 |
-
with st.spinner("
|
| 303 |
with ThreadPoolExecutor(max_workers=4) as executor:
|
| 304 |
# Submit all tasks with source name attached
|
| 305 |
futures_map = {
|
|
|
|
| 298 |
# Create a status placeholder to show progress
|
| 299 |
status_placeholder = st.empty()
|
| 300 |
|
| 301 |
+
# Custom spinner CSS for rotating circle
|
| 302 |
+
st.markdown("""
|
| 303 |
+
<style>
|
| 304 |
+
@keyframes spinner-rotate {
|
| 305 |
+
0% { transform: rotate(0deg); }
|
| 306 |
+
100% { transform: rotate(360deg); }
|
| 307 |
+
}
|
| 308 |
+
.stSpinner > div {
|
| 309 |
+
border: 3px solid #2A2E39;
|
| 310 |
+
border-top: 3px solid #3b82f6;
|
| 311 |
+
border-radius: 50%;
|
| 312 |
+
width: 40px;
|
| 313 |
+
height: 40px;
|
| 314 |
+
animation: spinner-rotate 1s linear infinite;
|
| 315 |
+
}
|
| 316 |
+
</style>
|
| 317 |
+
""", unsafe_allow_html=True)
|
| 318 |
+
|
| 319 |
# Execute all news fetching operations in parallel using ThreadPoolExecutor
|
| 320 |
+
with st.spinner("Loading news from 4 sources..."):
|
| 321 |
with ThreadPoolExecutor(max_workers=4) as executor:
|
| 322 |
# Submit all tasks with source name attached
|
| 323 |
futures_map = {
|