Update app.py
Browse files
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 |
-
|
51 |
-
|
|
|
52 |
font-weight: 600 !important;
|
53 |
-
font-size: 1.6rem !important;
|
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
|
386 |
<h3>ℹ️ เกี่ยวกับระบบ</h3>
|
387 |
-
<p
|
388 |
-
|
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
|
405 |
<h3>🔄 สถานะระบบ</h3>
|
406 |
-
<
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
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'),
|