JAMESPARK3 commited on
Commit
2a3bbe3
Β·
verified Β·
1 Parent(s): ba78895

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -3
app.py CHANGED
@@ -513,12 +513,23 @@ def show_weather_info(data):
513
  with col4:
514
  network_ok = check_network_status()
515
  if not network_ok:
516
- status_color = "red"
517
  status_text = "λ„€νŠΈμ›Œν¬ μ—°κ²° μ—†μŒ"
518
  else:
519
- status_color = "green" if not st.session_state.api_failed else "red"
520
  status_text = "API 정상" if not st.session_state.api_failed else "API 응닡 μ—†μŒ"
521
- st.markdown(f'<p style="color:{status_color}; font-size:20px; font-weight:bold;">{status_text}</p>', unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
522
 
523
  # forecast_data 처리
524
  forecast_data = data['FCST24HOURS']['FCST24HOURS']
 
513
  with col4:
514
  network_ok = check_network_status()
515
  if not network_ok:
516
+ status_color = "#FF0000" # 빨간색
517
  status_text = "λ„€νŠΈμ›Œν¬ μ—°κ²° μ—†μŒ"
518
  else:
519
+ status_color = "#00FF00" if not st.session_state.api_failed else "#FF0000" # 녹색 λ˜λŠ” 빨간색
520
  status_text = "API 정상" if not st.session_state.api_failed else "API 응닡 μ—†μŒ"
521
+
522
+ # API μƒνƒœ ν‘œμ‹œλ₯Ό μœ„ν•œ κ³ μœ ν•œ 클래슀λ₯Ό μ‚¬μš©
523
+ st.markdown("""
524
+ <style>
525
+ .api-status {
526
+ color: %s !important;
527
+ font-size: 20px;
528
+ font-weight: bold;
529
+ }
530
+ </style>
531
+ <p class="api-status">%s</p>
532
+ """ % (status_color, status_text), unsafe_allow_html=True)
533
 
534
  # forecast_data 처리
535
  forecast_data = data['FCST24HOURS']['FCST24HOURS']