JirasakJo commited on
Commit
f6384d3
·
verified ·
1 Parent(s): 2d62ad1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -18
app.py CHANGED
@@ -47,13 +47,24 @@ def load_custom_css():
47
  border-bottom: 3px solid #1E3A8A; /* Keep a blue line for a clean design */
48
  }
49
 
50
- h3, h4 {
51
- color: #ff0000; /* Black sub-headers */
 
52
  font-weight: 600 !important;
53
- font-size: 1.6rem !important; /* Increase font size for sub-headers */
54
  margin-top: 1.5rem !important;
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
57
  /* Paragraphs and text */
58
  p, span, li {
59
  font-size: 1.2rem !important; /* Larger font size for regular text */
@@ -203,7 +214,7 @@ def save_feedback_to_json():
203
  def add_feedback(query: str, answer: str, is_correct: bool):
204
  """Add feedback entry to session state and save to JSON and GitHub"""
205
  feedback_entry = {
206
- "timestamp": datetime.now().isoformat(),
207
  "query": query,
208
  "answer": answer,
209
  "is_correct": is_correct
@@ -382,12 +393,10 @@ def main():
382
  with info_col:
383
  # Enhanced system information section
384
  st.markdown("""
385
- <div style="background-color: #F9FAFB; padding: 1.5rem; border-radius: 12px; margin-bottom: 2rem;">
386
  <h3>ℹ️ เกี่ยวกับระบบ</h3>
387
- <p style="color: #ff0015;">
388
- ระบบนี้ใช้เทคโนโลยี <strong>RAG (Retrieval-Augmented Generation)</strong>
389
- ในการค้นหาและตอบคำถามเกี่ยวกับปฏิทินการศึกษา
390
- </p>
391
  <h4 style="color: #1E3A8A; margin-top: 1rem;">สามารถสอบถามข้อมูลเกี่ยวกับ:</h4>
392
  <ul style="list-style-type: none; padding-left: 0;">
393
  <li>📅 กำหนดการต่างๆ ในปฏิทินการศึกษา</li>
@@ -401,16 +410,14 @@ def main():
401
 
402
  # Enhanced system status section
403
  st.markdown("""
404
- <div style="background-color: #f9fafb; padding: 1.5rem; border-radius: 12px;">
405
  <h3>🔄 สถานะระบบ</h3>
406
- <div style="margin-top: 1rem;">
407
- <p><strong>⏰ เวลาปัจจุบัน:</strong><br>
408
- {}</p>
409
- <p><strong>📡 สถานะระบบ:</strong><br>
410
- <span class="status-indicator {}">
411
- {} {}
412
- </span></p>
413
- </div>
414
  </div>
415
  """.format(
416
  (datetime.now() + timedelta(hours=7)).strftime('%Y-%m-%d %H:%M:%S'),
 
47
  border-bottom: 3px solid #1E3A8A; /* Keep a blue line for a clean design */
48
  }
49
 
50
+ /* Specific styling for the system status and about system headers */
51
+ h3 {
52
+ color: #ff0015 !important; /* Default color for all h3 elements */
53
  font-weight: 600 !important;
54
+ font-size: 1.6rem !important;
55
  margin-top: 1.5rem !important;
56
  }
57
 
58
+ div.status-header {
59
+ color: #1E3A8A !important; /* Change the text color for status section */
60
+ font-size: 1.4rem !important; /* Adjust font size if necessary */
61
+ }
62
+
63
+ div.about-header {
64
+ color: #ff0015 !important; /* Change the text color for about section */
65
+ font-size: 1.4rem !important; /* Adjust font size if necessary */
66
+ }
67
+
68
  /* Paragraphs and text */
69
  p, span, li {
70
  font-size: 1.2rem !important; /* Larger font size for regular text */
 
214
  def add_feedback(query: str, answer: str, is_correct: bool):
215
  """Add feedback entry to session state and save to JSON and GitHub"""
216
  feedback_entry = {
217
+ "timestamp": (datetime.now() + timedelta(hours=7)).isoformat(),
218
  "query": query,
219
  "answer": answer,
220
  "is_correct": is_correct
 
393
  with info_col:
394
  # Enhanced system information section
395
  st.markdown("""
396
+ <div class="about-header">
397
  <h3>ℹ️ เกี่ยวกับระบบ</h3>
398
+ <p>ระบบนี้ใช้เทคโนโลยี <strong>RAG (Retrieval-Augmented Generation)</strong>
399
+ ในการค้นหาและตอบคำถามเกี่ยวกับปฏิทินการศึกษา</p>
 
 
400
  <h4 style="color: #1E3A8A; margin-top: 1rem;">สามารถสอบถามข้อมูลเกี่ยวกับ:</h4>
401
  <ul style="list-style-type: none; padding-left: 0;">
402
  <li>📅 กำหนดการต่างๆ ในปฏิทินการศึกษา</li>
 
410
 
411
  # Enhanced system status section
412
  st.markdown("""
413
+ <div class="status-header">
414
  <h3>🔄 สถานะระบบ</h3>
415
+ <p><strong>⏰ เวลาปัจจุบัน:</strong><br>
416
+ {}</p>
417
+ <p><strong>📡 สถานะระบบ:</strong><br>
418
+ <span class="status-indicator {}">
419
+ {} {}
420
+ </span></p>
 
 
421
  </div>
422
  """.format(
423
  (datetime.now() + timedelta(hours=7)).strftime('%Y-%m-%d %H:%M:%S'),