From 73240d425af9d2b95aa8cc797945c17fb7875136 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Sat, 25 Oct 2025 13:11:29 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=88=98=EC=8B=A0=ED=95=A8=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EC=A0=95=EB=B3=B4=20=ED=91=9C=EC=8B=9C=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0=20=EB=B0=8F=20=EC=9D=BD=EC=9D=8C=20=EC=B2=98=EB=A6=AC?= =?UTF-8?q?=20=EA=B8=B0=EB=8A=A5=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ“‹ Enhanced Information Display: - ์—…๋กœ๋“œ ์‹œ๊ฐ„ ์ƒ์„ธ ํ‘œ์‹œ (๋‚ ์งœ + ์‹œ๊ฐ„) - ์‚ฌ์ง„ ์ •๋ณด ๊ฐœ์„  (์‚ฌ์ง„ ๊ฐœ์ˆ˜ ํ‘œ์‹œ: '์‚ฌ์ง„ 2์žฅ', '์‚ฌ์ง„ ์—†์Œ') - ์‹ ๊ณ  ID ํ‘œ์‹œ๋กœ ์‹๋ณ„์„ฑ ํ–ฅ์ƒ - ๊ณต์ˆ˜ ์ •๋ณด ๋ฐ ์ƒ์„ธ ๋ฉ”๋ชจ ํ‘œ์‹œ - 4๊ฐœ ์ •๋ณด ๊ทธ๋ฆฌ๋“œ ๋ ˆ์ด์•„์›ƒ (์‹ ๊ณ ์ž, ์นดํ…Œ๊ณ ๋ฆฌ, ์‚ฌ์ง„, ์‹œ๊ฐ„) ๐ŸŽจ Visual Improvements: - ์ƒ‰์ƒ๋ณ„ ์•„์ด์ฝ˜์œผ๋กœ ์ •๋ณด ๊ตฌ๋ถ„ (๐Ÿ‘ค๐Ÿท๏ธ๐Ÿ“ทโฐ) - ์ค‘์š” ์ •๋ณด ๊ฐ•์กฐ ํ‘œ์‹œ (๊ตต์€ ๊ธ€์”จ) - ์—…๋กœ๋“œ ์ •๋ณด ๋ฐฐ๊ฒฝ ๊ตฌ๋ถ„ (ํšŒ์ƒ‰ ๋ฐฐ๊ฒฝ) - ์ขŒ์ธก ํŒŒ๋ž€์ƒ‰ ํ…Œ๋‘๋ฆฌ๋กœ ์นด๋“œ ๊ตฌ๋ถ„ - ํ˜ธ๋ฒ„ ํšจ๊ณผ ๋ฐ ํด๋ฆญ ๊ฐ€๋Šฅํ•œ ์ œ๋ชฉ ๐Ÿ—‘๏ธ Removed Read Status Features: - ์ฝ์Œ ์ƒํƒœ ๋ณ€์ˆ˜ ๋ฐ Set ์ œ๊ฑฐ - ์ฝ์Œ ์ฒ˜๋ฆฌ ๋ฒ„ํŠผ ์™„์ „ ์ œ๊ฑฐ - ๋ชจ๋‘ ์ฝ์Œ ์ฒ˜๋ฆฌ ๋ฒ„ํŠผ ์ œ๊ฑฐ - localStorage ์ฝ์Œ ์ƒํƒœ ๋กœ์ง ์ œ๊ฑฐ - ์ฝ์Œ/์•ˆ์ฝ์Œ ๊ตฌ๋ถ„ UI ์ œ๊ฑฐ ๐Ÿ“Š New Dashboard Statistics: - ์ „์ฒด: ์ˆ˜์‹ ํ•จ์— ๋‚จ์•„์žˆ๋Š” ๋ชฉ๋ก ๊ฐœ์ˆ˜ - ๊ธˆ์ผ ์‹ ๊ทœ: ์˜ค๋Š˜ ์˜ฌ๋ผ์˜จ ๋ชฉ๋ก ์ˆซ์ž (ํ™•์ธ๋œ ๊ฒƒ ํฌํ•จ) - ๊ธˆ์ผ ์ฒ˜๋ฆฌ: ์˜ค๋Š˜ ์ฒ˜๋ฆฌ๋œ ๊ฑด์ˆ˜ - ๋ฏธํ•ด๊ฒฐ: ์˜ค๋Š˜๊บผ ์ œ์™ธํ•œ ๋‚จ์•„์žˆ๋Š” ๊ฒƒ๋“ค ๐Ÿ”ง Code Improvements: - ํ†ต๊ณ„ ๊ณ„์‚ฐ ๋กœ์ง ๊ฐœ์„  (ํด๋ผ์ด์–ธํŠธ ๊ธฐ๋ฐ˜) - ๋‚ ์งœ/์‹œ๊ฐ„ ์ฒ˜๋ฆฌ ๊ฐœ์„  - ์‚ฌ์ง„ ๊ฐœ์ˆ˜ ๋™์  ๊ณ„์‚ฐ - ๋ถˆํ•„์š”ํ•œ ์ฝ์Œ ์ƒํƒœ ๊ด€๋ จ ์ฝ”๋“œ ์ •๋ฆฌ Expected Result: โœจ ๋” ์ƒ์„ธํ•˜๊ณ  ์œ ์šฉํ•œ ์ •๋ณด ํ‘œ์‹œ โœจ ๊น”๋”ํ•˜๊ณ  ์ง๊ด€์ ์ธ ์นด๋“œ ๋ ˆ์ด์•„์›ƒ โœจ ๋ถˆํ•„์š”ํ•œ ์ฝ์Œ ์ฒ˜๋ฆฌ ๊ธฐ๋Šฅ ์ œ๊ฑฐ๋กœ ๋‹จ์ˆœํ™” โœจ ์ƒˆ๋กœ์šด ๊ธฐ์ค€์˜ ์˜๋ฏธ์žˆ๋Š” ํ†ต๊ณ„ ์ œ๊ณต --- frontend/issues-inbox.html | 197 ++++++++++++++++++++++--------------- 1 file changed, 120 insertions(+), 77 deletions(-) diff --git a/frontend/issues-inbox.html b/frontend/issues-inbox.html index 67a458a..8e5dddf 100644 --- a/frontend/issues-inbox.html +++ b/frontend/issues-inbox.html @@ -137,10 +137,6 @@

์ƒˆ๋กœ ๋“ฑ๋ก๋œ ์‹ ๊ณ  ์‚ฌํ•ญ์„ ํ™•์ธํ•˜๊ณ  ์ฒ˜๋ฆฌํ•˜์„ธ์š”

- -
`; }).join(''); } - // ์ˆ˜์‹ ํ•จ ํ†ต๊ณ„ ๋กœ๋“œ (์‹ค์ œ API ์—ฐ๋™) + // ํ†ต๊ณ„ ๋กœ๋“œ (์ƒˆ๋กœ์šด ๊ธฐ์ค€) async function loadStatistics() { try { - const response = await fetch('/api/inbox/statistics', { - headers: { - 'Authorization': `Bearer ${localStorage.getItem('access_token')}`, - 'Content-Type': 'application/json' + // ํ˜„์žฌ ์ˆ˜์‹ ํ•จ ์ด์Šˆ๋“ค์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ†ต๊ณ„ ๊ณ„์‚ฐ + const today = new Date(); + const todayStart = new Date(today.getFullYear(), today.getMonth(), today.getDate()); + + // ์ „์ฒด: ์ˆ˜์‹ ํ•จ์— ๋‚จ์•„์žˆ๋Š” ๋ชฉ๋ก ๊ฐœ์ˆ˜ (pending_review ์ƒํƒœ) + const totalCount = issues.length; + + // ๊ธˆ์ผ ์‹ ๊ทœ: ์˜ค๋Š˜ ์˜ฌ๋ผ์˜จ ๋ชฉ๋ก ์ˆซ์ž (ํ™•์ธ๋œ ๊ฒƒ ํฌํ•จ) + const todayNewCount = issues.filter(issue => { + const reportDate = new Date(issue.report_date); + return reportDate >= todayStart; + }).length; + + // ๊ธˆ์ผ ์ฒ˜๋ฆฌ: ์˜ค๋Š˜ ์ฒ˜๋ฆฌ๋œ ๊ฑด์ˆ˜ (API์—์„œ ๊ฐ€์ ธ์™€์•ผ ํ•จ) + let todayProcessedCount = 0; + try { + const processedResponse = await fetch('/api/inbox/statistics', { + headers: { + 'Authorization': `Bearer ${localStorage.getItem('access_token')}`, + 'Content-Type': 'application/json' + } + }); + if (processedResponse.ok) { + const stats = await processedResponse.json(); + todayProcessedCount = stats.today_processed || 0; } - }); - - if (response.ok) { - const stats = await response.json(); - document.getElementById('newIssuesCount').textContent = stats.pending_review || 0; - document.getElementById('pendingIssuesCount').textContent = stats.total_in_management || 0; - document.getElementById('todayProcessedCount').textContent = stats.today_processed || 0; - document.getElementById('totalIssuesCount').textContent = stats.total_issues || 0; - } else { - console.error('ํ†ต๊ณ„ ๋กœ๋“œ ์‹คํŒจ'); + } catch (e) { + console.log('์ฒ˜๋ฆฌ๋œ ๊ฑด์ˆ˜ ์กฐํšŒ ์‹คํŒจ:', e); } + + // ๋ฏธํ•ด๊ฒฐ: ์˜ค๋Š˜๊บผ ์ œ์™ธํ•œ ๋‚จ์•„์žˆ๋Š” ๊ฒƒ๋“ค + const unresolvedCount = issues.filter(issue => { + const reportDate = new Date(issue.report_date); + return reportDate < todayStart; + }).length; + + // ํ†ต๊ณ„ ์—…๋ฐ์ดํŠธ + document.getElementById('totalCount').textContent = totalCount; + document.getElementById('todayNewCount').textContent = todayNewCount; + document.getElementById('todayProcessedCount').textContent = todayProcessedCount; + document.getElementById('unresolvedCount').textContent = unresolvedCount; + + console.log('๐Ÿ“Š ํ†ต๊ณ„ ์—…๋ฐ์ดํŠธ:', { + ์ „์ฒด: totalCount, + ๊ธˆ์ผ์‹ ๊ทœ: todayNewCount, + ๊ธˆ์ผ์ฒ˜๋ฆฌ: todayProcessedCount, + ๋ฏธํ•ด๊ฒฐ: unresolvedCount + }); + } catch (error) { console.error('ํ†ต๊ณ„ ๋กœ๋“œ ์˜ค๋ฅ˜:', error); + // ์˜ค๋ฅ˜ ์‹œ ๊ธฐ๋ณธ๊ฐ’ ์„ค์ • + document.getElementById('totalCount').textContent = '0'; + document.getElementById('todayNewCount').textContent = '0'; + document.getElementById('todayProcessedCount').textContent = '0'; + document.getElementById('unresolvedCount').textContent = '0'; } } - // ์ฝ์Œ ์ฒ˜๋ฆฌ - function markAsRead(issueId) { - readStatus.add(issueId); - localStorage.setItem('inbox_read_status', JSON.stringify([...readStatus])); - displayIssues(); - } - - // ๋ชจ๋‘ ์ฝ์Œ ์ฒ˜๋ฆฌ - function markAllAsRead() { - filteredIssues.forEach(issue => readStatus.add(issue.id)); - localStorage.setItem('inbox_read_status', JSON.stringify([...readStatus])); - displayIssues(); - } // ์ƒˆ๋กœ๊ณ ์นจ function refreshInbox() { loadIssues(); } - // ๋ถ€์ ํ•ฉ ์ƒ์„ธ ๋ณด๊ธฐ + // ์‹ ๊ณ  ์ƒ์„ธ ๋ณด๊ธฐ function viewIssueDetail(issueId) { - markAsRead(issueId); window.location.href = `/issue-view.html#detail-${issueId}`; } @@ -1063,3 +1105,4 @@ +