From 2b5a6d410b150dbcba98ce72ee8677009ba575eb Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Tue, 14 Apr 2026 14:42:15 +0900 Subject: [PATCH] =?UTF-8?q?refactor(dashboard):=20=EC=83=81=ED=99=A9?= =?UTF-8?q?=ED=8C=90=20=EC=9E=AC=EC=84=A4=EA=B3=84=20=E2=80=94=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=9E=90=20=EC=A7=80=EC=8B=9C=EC=84=9C=20=EA=B8=B0?= =?UTF-8?q?=EB=B0=98=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 대시보드를 통계판에서 상황판으로 전환: - 헤더 + 시스템 상태 인라인 (비클릭) - 핀 메모 최상단 조건부 (컴팩트 띠, 최대 3개) - 카드 4개 (문서함/메모/뉴스/승인대기) 모바일 2×2 - 최근 활동 전체 너비 7건, 2줄 스캔형 + 법령 배지 - 파이프라인 details 접힘 (실패 시 자동 open) - 제거: 도메인 분포, 법령/시스템 별도 카드, 8:4 분할 Co-Authored-By: Claude Opus 4.6 (1M context) --- app/api/dashboard.py | 4 +- frontend/src/routes/+page.svelte | 435 +++++++++++++++---------------- 2 files changed, 216 insertions(+), 223 deletions(-) diff --git a/app/api/dashboard.py b/app/api/dashboard.py index 5c9246d..8263b7c 100644 --- a/app/api/dashboard.py +++ b/app/api/dashboard.py @@ -86,11 +86,11 @@ async def get_dashboard( ) law_alerts = law_result.scalar() or 0 - # 최근 문서 5건 + # 최근 문서 7건 recent_result = await session.execute( select(Document) .order_by(Document.created_at.desc()) - .limit(5) + .limit(7) ) recent_docs = recent_result.scalars().all() diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 59d6fda..3fd506c 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -1,5 +1,7 @@
-
-

대시보드

+
+ + +
+

대시보드

+ {#if systemView} + + {systemView.label} + + + {/if} +
{#if loading} -
+ +
{#each Array(4) as _} -
+ {/each} -
-
+ + {:else if summary} -
- - {#if pinnedMemos.length > 0} -
-
- {#each pinnedMemos as memo (memo.id)} - - - {memo.content?.split('\n')[0] || '메모'} - + + {#if pinnedMemos.length > 0} +
+ {#each pinnedMemos as memo (memo.id)} + + + + {memo.content?.split('\n')[0] || '메모'} + + + {/each} + {#if pinnedMemos.length >= 3} + 더보기 → + {/if} +
+ {/if} + + + + + + +
+

최근 활동

+
+ {#if summary.law_alerts > 0} + + 법령 {summary.law_alerts} + + {/if} +
+
+ + {#if summary.recent_documents.length > 0} + + {:else} + + {/if} +
+ + +
{ if (!e.currentTarget.open) pipelineManualClosed = true; }} + > + + + + 파이프라인 + + + {#if totalFailed > 0} + 실패 {totalFailed} + {/if} + {#if totalPending > 0} + 대기 {totalPending} + {/if} + {#if totalFailed === 0 && totalPending === 0} + 처리 완료 + {/if} + + + +
+

최근 24시간

+ {#if pipelineRows.length > 0} +
+ {#each pipelineRows as row (row.stage)} +
+
+ {row.label} + + 대기 {row.pending} · + 처리 {row.processing} · + 실패 0 ? 'text-error font-medium' : ''}>{row.failed} + +
+
+ {#if row.pending > 0}
{/if} + {#if row.processing > 0}
{/if} + {#if row.failed > 0}
{/if} +
+
{/each}
-
- {/if} - - - +
- - - - - - - -
- -
-

파이프라인 상태

-
- {#if systemView} - - {systemView.label} - - - {/if} - 최근 24시간 -
-
- {#if pipelineRows.length > 0} -
- {#each pipelineRows as row (row.stage)} -
-
- {row.label} - - 대기 {row.pending} · - 처리 {row.processing} · - 실패 0 ? 'text-error' : ''}>{row.failed} - -
-
- {#if row.pending > 0}
{/if} - {#if row.processing > 0}
{/if} - {#if row.failed > 0}
{/if} -
-
- {/each} -
- {:else} - - {/if} -
-
- -
- -
-

오늘 도메인 분포

- {domainData.total}건 -
- {#if domainData.rows.length > 0} -
- {#each domainData.rows as r (r.label)} -
- {/each} -
-
    - {#each domainData.rows as r (r.label)} -
  • - {r.label} - {r.count} -
  • - {/each} -
- {:else} - - {/if} -
-
- - -
- -

최근 문서

- {#if summary.recent_documents.length > 0} - - {:else} - - {/if} -
-
- -
- - -
-

법령 알림

- -
-

{summary.law_alerts}

- {#if summary.law_alerts > 0} - 확인하기 → - {:else} -

오늘 변경 없음

- {/if} -
- - - -
-

시스템 상태

- -
- {#if systemView} -

{systemView.label}

-

{systemView.sub}

- {/if} -
-
-
{/if}
+ +