dev-yuje commited on
Commit
d18cd71
·
1 Parent(s): 495d5e7

refactor: GNB 비반응형 아이콘 제거, 업로드 이미지 기반의 민트-테일-오션블루 프리미엄 테마 전격 적용, DB 연결 상태 뱃지 개선

Browse files
Files changed (1) hide show
  1. app.py +52 -44
app.py CHANGED
@@ -230,16 +230,16 @@ def build_stats_html(stats: Dict[str, Any]) -> str:
230
  <div class="stat-val" style="font-size: 13px !important; font-weight: 800 !important; color: #334155;">GPT-4o</div>
231
  </div>
232
  <div class="stat-card">
233
- <div class="stat-lbl">🧬 검색 모드</div>
234
- <div class="stat-val" style="font-size: 13px !important; font-weight: 800 !important; color: #334155;">Hybrid (Graph+Vector)</div>
235
  </div>
236
  <div class="stat-card">
237
- <div class="stat-lbl"> 응답 방식</div>
238
- <div class="stat-val" style="font-size: 13px !important; font-weight: 800 !important; color: #334155;">Streaming</div>
239
  </div>
240
  <div class="stat-card">
241
  <div class="stat-lbl">🔐 DB 연결</div>
242
- <div class="stat-val" style="font-size: 13px !important; font-weight: 800 !important; color: #10b981;">AuraDB (Active)</div>
243
  </div>
244
  </div>
245
 
@@ -472,21 +472,24 @@ body {
472
  margin-top: 2px;
473
  }
474
 
475
- /* 서브타이틀 헤더 스타일 */
476
  .section-subtitle {
477
  font-size: 13px !important;
478
- font-weight: 750;
479
- color: #1b1c1a;
480
- margin: 15px 0 6px 0;
481
- border-bottom: 1px solid rgba(196, 195, 236, 0.35);
482
- padding-bottom: 4px;
 
 
483
  display: flex;
484
  align-items: center;
485
- gap: 4px;
486
  }
487
  .dark .section-subtitle {
488
- color: #f8fafc;
489
- border-color: rgba(129, 140, 248, 0.2);
 
490
  }
491
 
492
  /* 2x2 grid layout for chatbot example buttons (Stitch Action Grid style) */
@@ -502,54 +505,62 @@ body {
502
  [class*="examples"] button {
503
  text-align: left !important;
504
  padding: 14px 18px !important;
505
- background: rgba(255, 255, 255, 0.75) !important;
506
- border: 1px solid rgba(196, 195, 236, 0.5) !important;
507
- border-radius: 8px !important;
508
  font-size: 12px !important;
509
- font-weight: 600 !important;
510
- color: #47464e !important;
511
  line-height: 1.4 !important;
512
- box-shadow: 0 2px 5px rgba(88, 89, 125, 0.03) !important;
513
- transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
514
  white-space: normal !important;
515
  height: auto !important;
516
  min-height: 54px !important;
517
  cursor: pointer !important;
518
  }
519
  .dark [class*="examples"] button {
520
- background: rgba(30, 41, 59, 0.75) !important;
521
- border-color: rgba(129, 140, 248, 0.25) !important;
522
- color: #cbd5e1 !important;
523
  }
524
  [class*="examples"] button:hover {
525
  transform: translateY(-2px) !important;
526
- background: rgba(255, 255, 255, 0.95) !important;
527
- border-color: #5b5b7f !important;
528
- box-shadow: 0 6px 12px rgba(91, 91, 127, 0.15) !important;
 
529
  }
530
  .dark [class*="examples"] button:hover {
531
- background: rgba(30, 41, 59, 0.95) !important;
532
- border-color: rgba(129, 140, 248, 0.6) !important;
 
533
  }
534
 
535
- /* 챗봇 버튼 다크 슬레이트 스타일 (보라색 제거세련된 네비/슬레이트 통일) */
536
  button.primary,
537
  .primary-btn,
538
  button.lg.primary,
539
  button.sm.primary,
540
- button.variant-primary {
541
- background-color: #334155 !important;
 
 
542
  color: white !important;
543
- font-weight: 800 !important;
544
  border: none !important;
545
- box-shadow: 0 4px 6px rgba(51, 65, 85, 0.15) !important;
 
546
  transition: all 0.2s ease-in-out !important;
 
547
  }
548
  button.primary:hover,
549
  .primary-btn:hover,
550
- button.variant-primary:hover {
551
- background-color: #1e293b !important;
552
- box-shadow: 0 6px 12px rgba(51, 65, 85, 0.25) !important;
 
 
553
  transform: translateY(-1px) !important;
554
  }
555
 
@@ -702,11 +713,8 @@ with gr.Blocks(**blocks_kwargs) as demo:
702
  # 1. 상단 글로벌 네비게이션 바 (GNB)
703
  gr.HTML("""
704
  <div style="display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid rgba(196, 195, 236, 0.45); background-color: rgba(255, 255, 255, 0.65); backdrop-filter: blur(12px); margin: -20px -20px 20px -20px;">
705
- <div style="font-size: 20px; font-weight: 900; color: #5b5b7f; display: flex; align-items: center; gap: 12px;">
706
- FinGraph <span style="font-size: 14px; font-weight: 600; color: #5b5b7f;">GraphRAG Enhanced AI Terminal</span>
707
- </div>
708
- <div style="display: flex; gap: 18px; color: #5b5b7f; font-size: 18px; cursor: pointer;">
709
- <span>🔔</span> <span>⚙️</span> <span>👤</span>
710
  </div>
711
  </div>
712
  """)
@@ -723,8 +731,8 @@ with gr.Blocks(**blocks_kwargs) as demo:
723
  # 메인 타이틀 (챗봇 영역 상단 중앙)
724
  gr.HTML("""
725
  <div style="text-align: center; padding: 10px 0 20px 0;">
726
- <h2 style="font-size: 18px; font-weight: 800; color: #5b5b7f; margin-bottom: 5px;">FinGraph — GraphRAG AI Terminal</h2>
727
- <p style="color: #47464e; font-size: 13px;">최신 AI 뉴스를 기반으로 구축된 지식 그래프(GraphRAG)에서 답변합니다.</p>
728
  </div>
729
  """)
730
 
 
230
  <div class="stat-val" style="font-size: 13px !important; font-weight: 800 !important; color: #334155;">GPT-4o</div>
231
  </div>
232
  <div class="stat-card">
233
+ <div class="stat-lbl">🏢 대상 회사</div>
234
+ <div class="stat-val" style="font-size: 13px !important; font-weight: 800 !important; color: #334155;">{stats['companies']}개</div>
235
  </div>
236
  <div class="stat-card">
237
+ <div class="stat-lbl">🔑 뉴스 키워드</div>
238
+ <div class="stat-val" style="font-size: 13px !important; font-weight: 800 !important; color: #334155;">{stats['technologies']}개</div>
239
  </div>
240
  <div class="stat-card">
241
  <div class="stat-lbl">🔐 DB 연결</div>
242
+ <div class="stat-val" style="font-size: 12px !important; font-weight: 800 !important; color: #0d9488; margin-top: 3px;"><span style="background: rgba(13, 148, 136, 0.12); padding: 2px 6px; border-radius: 5px; display: inline-block;">Active</span></div>
243
  </div>
244
  </div>
245
 
 
472
  margin-top: 2px;
473
  }
474
 
475
+ /* 서브타이틀 헤더 스타일 (연한 에메랄드/테일 배경 + 딥 테일 글씨) */
476
  .section-subtitle {
477
  font-size: 13px !important;
478
+ font-weight: 800;
479
+ color: #0f766e !important; /* 딥 테일 글씨 */
480
+ background: rgba(20, 184, 166, 0.1) !important; /* 연한 테일 글래스 배경 */
481
+ margin: 18px 0 8px 0;
482
+ padding: 6px 10px !important;
483
+ border-radius: 6px !important;
484
+ border-left: 3px solid #14b8a6 !important; /* 선명한 테일 세로선 */
485
  display: flex;
486
  align-items: center;
487
+ gap: 6px;
488
  }
489
  .dark .section-subtitle {
490
+ color: #99f6e4 !important;
491
+ background: rgba(20, 184, 166, 0.2) !important;
492
+ border-left-color: #2dd4bf !important;
493
  }
494
 
495
  /* 2x2 grid layout for chatbot example buttons (Stitch Action Grid style) */
 
505
  [class*="examples"] button {
506
  text-align: left !important;
507
  padding: 14px 18px !important;
508
+ background: #f0fdf4 !important; /* 싱그러운 민트/연그린 배경 */
509
+ border: 1px solid #86efac !important; /* 라이트 에메랄드 테두리 */
510
+ border-radius: 10px !important;
511
  font-size: 12px !important;
512
+ font-weight: 750 !important;
513
+ color: #0f766e !important; /* 깊이 있는 테일 그린 글씨 */
514
  line-height: 1.4 !important;
515
+ box-shadow: 0 3px 6px rgba(20, 184, 166, 0.05) !important;
516
+ transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
517
  white-space: normal !important;
518
  height: auto !important;
519
  min-height: 54px !important;
520
  cursor: pointer !important;
521
  }
522
  .dark [class*="examples"] button {
523
+ background: rgba(20, 184, 166, 0.1) !important;
524
+ border-color: rgba(45, 212, 191, 0.3) !important;
525
+ color: #99f6e4 !important;
526
  }
527
  [class*="examples"] button:hover {
528
  transform: translateY(-2px) !important;
529
+ background: #dcfce7 !important; /* 호버 시 약간 더 짙은 민트 */
530
+ border-color: #4ade80 !important;
531
+ color: #15803d !important;
532
+ box-shadow: 0 6px 12px rgba(20, 184, 166, 0.12) !important;
533
  }
534
  .dark [class*="examples"] button:hover {
535
+ background: rgba(20, 184, 166, 0.25) !important;
536
+ border-color: #2dd4bf !important;
537
+ color: #ffffff !important;
538
  }
539
 
540
+ /* 챗봇 버튼 확실한 블루 포인트 스타일 (전송 버튼 분리 및 이미지 속 파란 서클 컬러 100% 동기화) */
541
  button.primary,
542
  .primary-btn,
543
  button.lg.primary,
544
  button.sm.primary,
545
+ button.variant-primary,
546
+ button[class*="submit-btn"],
547
+ [data-testid="submit-button"] {
548
+ background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%) !important; /* 선명한 오션 블루 그라데이션 */
549
  color: white !important;
550
+ font-weight: 850 !important;
551
  border: none !important;
552
+ border-radius: 8px !important;
553
+ box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2) !important;
554
  transition: all 0.2s ease-in-out !important;
555
+ cursor: pointer !important;
556
  }
557
  button.primary:hover,
558
  .primary-btn:hover,
559
+ button.variant-primary:hover,
560
+ button[class*="submit-btn"]:hover,
561
+ [data-testid="submit-button"]:hover {
562
+ background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%) !important;
563
+ box-shadow: 0 6px 12px rgba(37, 99, 235, 0.35) !important;
564
  transform: translateY(-1px) !important;
565
  }
566
 
 
713
  # 1. 상단 글로벌 네비게이션 바 (GNB)
714
  gr.HTML("""
715
  <div style="display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid rgba(196, 195, 236, 0.45); background-color: rgba(255, 255, 255, 0.65); backdrop-filter: blur(12px); margin: -20px -20px 20px -20px;">
716
+ <div style="font-size: 20px; font-weight: 900; background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: flex; align-items: center; gap: 12px;">
717
+ FinGraph <span style="font-size: 14px; font-weight: 700; color: #475569;">GraphRAG Enhanced AI Terminal</span>
 
 
 
718
  </div>
719
  </div>
720
  """)
 
731
  # 메인 타이틀 (챗봇 영역 상단 중앙)
732
  gr.HTML("""
733
  <div style="text-align: center; padding: 10px 0 20px 0;">
734
+ <h2 style="font-size: 18px; font-weight: 900; background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 5px;">FinGraph — GraphRAG AI Terminal</h2>
735
+ <p style="color: #475569; font-size: 13px; font-weight: 500;">최신 AI 뉴스를 기반으로 구축된 지식 그래프(GraphRAG)에서 답변합니다.</p>
736
  </div>
737
  """)
738