JirasakJo commited on
Commit
395f685
·
verified ·
1 Parent(s): a545d47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +46 -42
app.py CHANGED
@@ -620,76 +620,82 @@ def main():
620
  with info_col:
621
  # About System Section
622
  st.markdown("""
623
- <div style="background-color: #1E1E1E; padding: 1.5rem; border-radius: 12px; margin-bottom: 2rem;">
624
- <div class="flex items-center mb-4">
625
- <span class="text-blue-500" style="font-size: 1.5rem;">ℹ️</span>
626
- <span style="font-size: 1.25rem; color: #E5E7EB; margin-left: 0.5rem;">เกี่ยวกับระบบ</span>
 
627
  </div>
628
 
629
- <p class="text-blue-600 mb-6" style="color: #60A5FA;">
 
630
  ระบบนี้ใช้เทคโนโลยี <strong>RAG (Retrieval-Augmented Generation)</strong>
631
  ในการค้นหาและตอบคำถามเกี่ยวกับปฏิทินการศึกษา
632
  </p>
633
 
 
634
  <h4 style="color: #9CA3AF; font-size: 1.1rem; margin-bottom: 1rem;">
635
  สามารถสอบถามข้อมูลเกี่ยวกับ:
636
  </h4>
637
 
638
- <div class="space-y-3">
639
- <div class="flex items-center space-x-3" style="color: #9CA3AF;">
640
- <span style="color: #3B82F6;">📅</span>
641
- <span>กำหนดการต่างๆ ในปฏิทินการศึกษา</span>
 
642
  </div>
643
- <div class="flex items-center space-x-3" style="color: #9CA3AF;">
644
- <span style="color: #3B82F6;">🎯</span>
645
- <span>วันสำคัญและกิจกรรม</span>
646
  </div>
647
- <div class="flex items-center space-x-3" style="color: #9CA3AF;">
648
- <span style="color: #3B82F6;">📝</span>
649
- <span>การลงทะเบียนเรียน</span>
650
  </div>
651
- <div class="flex items-center space-x-3" style="color: #9CA3AF;">
652
- <span style="color: #3B82F6;">📚</span>
653
- <span>กำหนดการสอบ</span>
654
  </div>
655
- <div class="flex items-center space-x-3" style="color: #9CA3AF;">
656
- <span style="color: #3B82F6;">🏖️</span>
657
- <span>วันหยุดการศึกษา</span>
658
  </div>
659
  </div>
660
  </div>
661
 
662
  <!-- System Status Section -->
663
- <div style="background-color: #1E1E1E; padding: 1.5rem; border-radius: 12px;">
664
- <div class="flex items-center mb-4">
665
- <span class="text-blue-500" style="font-size: 1.5rem;">🔄</span>
666
- <span style="font-size: 1.25rem; color: #E5E7EB; margin-left: 0.5rem;">สถานะระบบ</span>
 
667
  </div>
668
 
669
- <div class="space-y-4">
670
- <div class="flex items-start space-x-3">
671
- <span style="color: #3B82F6;">⏰</span>
 
672
  <div>
673
- <p style="color: #9CA3AF; font-weight: 600;">เวลาปัจจุบัน</p>
674
- <p style="color: #6B7280;">{}</p>
675
  </div>
676
  </div>
677
 
678
- <div class="flex items-start space-x-3">
679
- <span style="color: #3B82F6;">📡</span>
680
  <div>
681
- <p style="color: #9CA3AF; font-weight: 600;">สถานะระบบ</p>
682
- <span style="display: inline-flex; align-items: center; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.875rem; font-weight: 500; background-color: {}; color: {};">
683
  {} {}
684
  </span>
685
  </div>
686
  </div>
687
 
688
- <div class="flex items-start space-x-3">
689
- <span style="color: #3B82F6;">💾</span>
690
  <div>
691
- <p style="color: #9CA3AF; font-weight: 600;">สถานะ GitHub Sync</p>
692
- <span style="display: inline-flex; align-items: center; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.875rem; font-weight: 500; background-color: {}; color: {};">
693
  {} {}
694
  </span>
695
  </div>
@@ -698,12 +704,10 @@ def main():
698
  </div>
699
  """.format(
700
  (datetime.now() + timedelta(hours=7)).strftime('%Y-%m-%d %H:%M:%S'),
701
- "#064E3B" if st.session_state.pipeline else "#991B1B",
702
- "#DEF7EC" if st.session_state.pipeline else "#FDE8E8",
703
  "🟢" if st.session_state.pipeline else "🔴",
704
  "พร้อมใช้งาน" if st.session_state.pipeline else "ไม่พร้อมใช้งาน",
705
- "#064E3B" if st.session_state.github_sync_enabled else "#991B1B",
706
- "#DEF7EC" if st.session_state.github_sync_enabled else "#FDE8E8",
707
  "🟢" if st.session_state.github_sync_enabled else "🔴",
708
  "เชื่อมต่อแล้ว" if st.session_state.github_sync_enabled else "ไม่ได้เชื่อมต่อ"
709
  ), unsafe_allow_html=True)
 
620
  with info_col:
621
  # About System Section
622
  st.markdown("""
623
+ <div style="background-color: #1E1E1E; border-radius: 12px; padding: 20px; margin-bottom: 20px;">
624
+ <!-- Header -->
625
+ <div style="display: flex; align-items: center; margin-bottom: 16px;">
626
+ <span style="color: #60A5FA; font-size: 24px;">ℹ️</span>
627
+ <span style="color: #E5E7EB; margin-left: 8px; font-size: 18px;">เกี่ยวกับระบบ</span>
628
  </div>
629
 
630
+ <!-- Description -->
631
+ <p style="color: #60A5FA; margin-bottom: 24px;">
632
  ระบบนี้ใช้เทคโนโลยี <strong>RAG (Retrieval-Augmented Generation)</strong>
633
  ในการค้นหาและตอบคำถามเกี่ยวกับปฏิทินการศึกษา
634
  </p>
635
 
636
+ <!-- Section Header -->
637
  <h4 style="color: #9CA3AF; font-size: 1.1rem; margin-bottom: 1rem;">
638
  สามารถสอบถามข้อมูลเกี่ยวกับ:
639
  </h4>
640
 
641
+ <!-- Menu Items -->
642
+ <div style="margin-bottom: 16px;">
643
+ <div style="display: flex; align-items: center; margin-bottom: 12px;">
644
+ <span style="color: #3B82F6; margin-right: 12px;">📅</span>
645
+ <span style="color: #9CA3AF;">กำหนดการต่างๆ ในปฏิทินการศึกษา</span>
646
  </div>
647
+ <div style="display: flex; align-items: center; margin-bottom: 12px;">
648
+ <span style="color: #3B82F6; margin-right: 12px;">🎯</span>
649
+ <span style="color: #9CA3AF;">วันสำคัญและกิจกรรม</span>
650
  </div>
651
+ <div style="display: flex; align-items: center; margin-bottom: 12px;">
652
+ <span style="color: #3B82F6; margin-right: 12px;">📝</span>
653
+ <span style="color: #9CA3AF;">การลงทะเบียนเรียน</span>
654
  </div>
655
+ <div style="display: flex; align-items: center; margin-bottom: 12px;">
656
+ <span style="color: #3B82F6; margin-right: 12px;">📚</span>
657
+ <span style="color: #9CA3AF;">กำหนดการสอบ</span>
658
  </div>
659
+ <div style="display: flex; align-items: center;">
660
+ <span style="color: #3B82F6; margin-right: 12px;">🏖️</span>
661
+ <span style="color: #9CA3AF;">วันหยุดการศึกษา</span>
662
  </div>
663
  </div>
664
  </div>
665
 
666
  <!-- System Status Section -->
667
+ <div style="background-color: #1E1E1E; border-radius: 12px; padding: 20px;">
668
+ <!-- Header -->
669
+ <div style="display: flex; align-items: center; margin-bottom: 16px;">
670
+ <span style="color: #60A5FA; font-size: 24px;">🔄</span>
671
+ <span style="color: #E5E7EB; margin-left: 8px; font-size: 18px;">สถานะระบบ</span>
672
  </div>
673
 
674
+ <!-- Status Items -->
675
+ <div style="margin-bottom: 16px;">
676
+ <div style="display: flex; align-items: start; margin-bottom: 16px;">
677
+ <span style="color: #3B82F6; margin-right: 12px;">⏰</span>
678
  <div>
679
+ <p style="color: #9CA3AF; font-weight: 600; margin: 0;">เวลาปัจจุบัน</p>
680
+ <p style="color: #6B7280; margin: 4px 0 0 0;">{}</p>
681
  </div>
682
  </div>
683
 
684
+ <div style="display: flex; align-items: start; margin-bottom: 16px;">
685
+ <span style="color: #3B82F6; margin-right: 12px;">📡</span>
686
  <div>
687
+ <p style="color: #9CA3AF; font-weight: 600; margin: 0;">สถานะระบบ</p>
688
+ <span style="display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 9999px; font-size: 14px; color: #E5E7EB; background-color: {};">
689
  {} {}
690
  </span>
691
  </div>
692
  </div>
693
 
694
+ <div style="display: flex; align-items: start;">
695
+ <span style="color: #3B82F6; margin-right: 12px;">💾</span>
696
  <div>
697
+ <p style="color: #9CA3AF; font-weight: 600; margin: 0;">สถานะ GitHub Sync</p>
698
+ <span style="display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 9999px; font-size: 14px; color: #E5E7EB; background-color: {};">
699
  {} {}
700
  </span>
701
  </div>
 
704
  </div>
705
  """.format(
706
  (datetime.now() + timedelta(hours=7)).strftime('%Y-%m-%d %H:%M:%S'),
707
+ "#047857" if st.session_state.pipeline else "#991B1B",
 
708
  "🟢" if st.session_state.pipeline else "🔴",
709
  "พร้อมใช้งาน" if st.session_state.pipeline else "ไม่พร้อมใช้งาน",
710
+ "#047857" if st.session_state.github_sync_enabled else "#991B1B",
 
711
  "🟢" if st.session_state.github_sync_enabled else "🔴",
712
  "เชื่อมต่อแล้ว" if st.session_state.github_sync_enabled else "ไม่ได้เชื่อมต่อ"
713
  ), unsafe_allow_html=True)