Update app.py
Browse files
app.py
CHANGED
@@ -95,156 +95,6 @@ def load_custom_css():
|
|
95 |
background-color: #FDE8E8;
|
96 |
color: rgb(255, 255, 255);
|
97 |
}
|
98 |
-
|
99 |
-
.bg-white {
|
100 |
-
background-color: white;
|
101 |
-
}
|
102 |
-
|
103 |
-
.rounded-xl {
|
104 |
-
border-radius: 0.75rem;
|
105 |
-
}
|
106 |
-
|
107 |
-
.shadow-sm {
|
108 |
-
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
109 |
-
}
|
110 |
-
|
111 |
-
.border {
|
112 |
-
border-width: 1px;
|
113 |
-
}
|
114 |
-
|
115 |
-
.border-gray-200 {
|
116 |
-
border-color: #E5E7EB;
|
117 |
-
}
|
118 |
-
|
119 |
-
.mb-6 {
|
120 |
-
margin-bottom: 1.5rem;
|
121 |
-
}
|
122 |
-
|
123 |
-
.space-y-3 > * + * {
|
124 |
-
margin-top: 0.75rem;
|
125 |
-
}
|
126 |
-
|
127 |
-
.space-y-4 > * + * {
|
128 |
-
margin-top: 1rem;
|
129 |
-
}
|
130 |
-
|
131 |
-
.space-x-3 > * + * {
|
132 |
-
margin-left: 0.75rem;
|
133 |
-
}
|
134 |
-
|
135 |
-
.text-blue-500 {
|
136 |
-
color: #3B82F6;
|
137 |
-
}
|
138 |
-
|
139 |
-
.text-blue-600 {
|
140 |
-
color: #2563EB;
|
141 |
-
}
|
142 |
-
|
143 |
-
.text-gray-600 {
|
144 |
-
color: #4B5563;
|
145 |
-
}
|
146 |
-
|
147 |
-
.text-gray-700 {
|
148 |
-
color: #374151;
|
149 |
-
}
|
150 |
-
|
151 |
-
.text-gray-800 {
|
152 |
-
color: #1F2937;
|
153 |
-
}
|
154 |
-
|
155 |
-
.bg-green-100 {
|
156 |
-
background-color: #DEF7EC;
|
157 |
-
}
|
158 |
-
|
159 |
-
.bg-red-100 {
|
160 |
-
background-color: #FDE8E8;
|
161 |
-
}
|
162 |
-
|
163 |
-
.text-green-800 {
|
164 |
-
color: #03543F;
|
165 |
-
}
|
166 |
-
|
167 |
-
.text-red-800 {
|
168 |
-
color: #9B1C1C;
|
169 |
-
}
|
170 |
-
|
171 |
-
.rounded-full {
|
172 |
-
border-radius: 9999px;
|
173 |
-
}
|
174 |
-
|
175 |
-
.flex {
|
176 |
-
display: flex;
|
177 |
-
}
|
178 |
-
|
179 |
-
.items-center {
|
180 |
-
align-items: center;
|
181 |
-
}
|
182 |
-
|
183 |
-
.items-start {
|
184 |
-
align-items: flex-start;
|
185 |
-
}
|
186 |
-
|
187 |
-
.text-2xl {
|
188 |
-
font-size: 1.5rem;
|
189 |
-
line-height: 2rem;
|
190 |
-
}
|
191 |
-
|
192 |
-
.text-xl {
|
193 |
-
font-size: 1.25rem;
|
194 |
-
line-height: 1.75rem;
|
195 |
-
}
|
196 |
-
|
197 |
-
.text-lg {
|
198 |
-
font-size: 1.125rem;
|
199 |
-
line-height: 1.75rem;
|
200 |
-
}
|
201 |
-
|
202 |
-
.text-sm {
|
203 |
-
font-size: 0.875rem;
|
204 |
-
line-height: 1.25rem;
|
205 |
-
}
|
206 |
-
|
207 |
-
.font-bold {
|
208 |
-
font-weight: 700;
|
209 |
-
}
|
210 |
-
|
211 |
-
.font-semibold {
|
212 |
-
font-weight: 600;
|
213 |
-
}
|
214 |
-
|
215 |
-
.font-medium {
|
216 |
-
font-weight: 500;
|
217 |
-
}
|
218 |
-
|
219 |
-
.mr-2 {
|
220 |
-
margin-right: 0.5rem;
|
221 |
-
}
|
222 |
-
|
223 |
-
.mb-4 {
|
224 |
-
margin-bottom: 1rem;
|
225 |
-
}
|
226 |
-
|
227 |
-
.mb-3 {
|
228 |
-
margin-bottom: 0.75rem;
|
229 |
-
}
|
230 |
-
|
231 |
-
.p-6 {
|
232 |
-
padding: 1.5rem;
|
233 |
-
}
|
234 |
-
|
235 |
-
.px-3 {
|
236 |
-
padding-left: 0.75rem;
|
237 |
-
padding-right: 0.75rem;
|
238 |
-
}
|
239 |
-
|
240 |
-
.py-1 {
|
241 |
-
padding-top: 0.25rem;
|
242 |
-
padding-bottom: 0.25rem;
|
243 |
-
}
|
244 |
-
|
245 |
-
.inline-flex {
|
246 |
-
display: inline-flex;
|
247 |
-
}
|
248 |
</style>
|
249 |
""", unsafe_allow_html=True)
|
250 |
|
@@ -618,96 +468,48 @@ def main():
|
|
618 |
st.rerun()
|
619 |
|
620 |
with info_col:
|
621 |
-
#
|
622 |
st.markdown("""
|
623 |
-
<div style="background-color: #
|
624 |
-
|
625 |
-
<
|
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 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
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 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
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>
|
702 |
-
</div>
|
703 |
</div>
|
704 |
</div>
|
705 |
""".format(
|
706 |
(datetime.now() + timedelta(hours=7)).strftime('%Y-%m-%d %H:%M:%S'),
|
707 |
-
"
|
708 |
"🟢" if st.session_state.pipeline else "🔴",
|
709 |
"พร้อมใช้งาน" if st.session_state.pipeline else "ไม่พร้อมใช้งาน",
|
710 |
-
"
|
711 |
"🟢" if st.session_state.github_sync_enabled else "🔴",
|
712 |
"เชื่อมต่อแล้ว" if st.session_state.github_sync_enabled else "ไม่ได้เชื่อมต่อ"
|
713 |
), unsafe_allow_html=True)
|
|
|
95 |
background-color: #FDE8E8;
|
96 |
color: rgb(255, 255, 255);
|
97 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
</style>
|
99 |
""", unsafe_allow_html=True)
|
100 |
|
|
|
468 |
st.rerun()
|
469 |
|
470 |
with info_col:
|
471 |
+
# System information
|
472 |
st.markdown("""
|
473 |
+
<div style="background-color: #F9FAFB; padding: 1.5rem; border-radius: 12px; margin-bottom: 2rem;">
|
474 |
+
<h3 style="color: #1E3A8A;">ℹ️ เกี่ยวกับระบบ</h3>
|
475 |
+
<p style="color: #ff0015;">
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
ระบบนี้ใช้เทคโนโลยี <strong>RAG (Retrieval-Augmented Generation)</strong>
|
477 |
ในการค้นหาและตอบคำถามเกี่ยวกับปฏิทินการศึกษ��
|
478 |
</p>
|
479 |
+
<h4 style="color: #1E3A8A; margin-top: 1rem;">สามารถสอบถามข้อมูลเกี่ยวกับ:</h4>
|
480 |
+
<ul style="list-style-type: none; padding-left: 0;">
|
481 |
+
<li>📅 กำหนดการต่างๆ ในปฏิทินการศึกษา</li>
|
482 |
+
<li>🎯 วันสำคัญและกิจกรรม</li>
|
483 |
+
<li>📝 การลงทะเบียนเรียน</li>
|
484 |
+
<li>📚 กำหนดการสอบ</li>
|
485 |
+
<li>🏖️ วันหยุดการศึกษา</li>
|
486 |
+
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
487 |
</div>
|
488 |
+
""", unsafe_allow_html=True)
|
489 |
+
|
490 |
+
# System status
|
491 |
+
st.markdown("""
|
492 |
+
<div style="background-color: #f9fafb; padding: 1.5rem; border-radius: 12px;">
|
493 |
+
<h3 style="color: #1E3A8A;">🔄 สถานะระบบ</h3>
|
494 |
+
<div style="margin-top: 1rem;">
|
495 |
+
<p><strong>⏰ เวลาปัจจุบัน:</strong><br>
|
496 |
+
{}</p>
|
497 |
+
<p><strong>📡 สถานะระบบ:</strong><br>
|
498 |
+
<span class="status-indicator {}">
|
499 |
+
{} {}
|
500 |
+
</span></p>
|
501 |
+
<p><strong>💾 สถานะ GitHub Sync:</strong><br>
|
502 |
+
<span class="status-indicator {}">
|
503 |
+
{} {}
|
504 |
+
</span></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
</div>
|
506 |
</div>
|
507 |
""".format(
|
508 |
(datetime.now() + timedelta(hours=7)).strftime('%Y-%m-%d %H:%M:%S'),
|
509 |
+
"status-online" if st.session_state.pipeline else "status-offline",
|
510 |
"🟢" if st.session_state.pipeline else "🔴",
|
511 |
"พร้อมใช้งาน" if st.session_state.pipeline else "ไม่พร้อมใช้งาน",
|
512 |
+
"status-online" if st.session_state.github_sync_enabled else "status-offline",
|
513 |
"🟢" if st.session_state.github_sync_enabled else "🔴",
|
514 |
"เชื่อมต่อแล้ว" if st.session_state.github_sync_enabled else "ไม่ได้เชื่อมต่อ"
|
515 |
), unsafe_allow_html=True)
|