temp: save local progress before merge

This commit is contained in:
2026-06-02 10:23:18 +09:00
parent bf7fb0ffe6
commit bb859dddfc
21 changed files with 13296 additions and 171 deletions

View File

@@ -9,9 +9,14 @@ export function renderHwDashboard(container: HTMLElement) {
const allHw = state.masterData.hw || [];
// 1. 데이터 가공
const pcIds = new Set((state.masterData.pc || []).map((p: any) => p.id));
const serverIds = new Set((state.masterData.server || []).map((s: any) => s.id));
let totalAge = 0;
let countWithDate = 0;
let over5YearsCount = 0;
let agingPcCount = 0;
let agingServerCount = 0;
let latestAsset: any | null = null;
let latestYear = 0;
@@ -30,6 +35,11 @@ export function renderHwDashboard(container: HTMLElement) {
if (age >= 5) {
over5YearsCount++;
ageGroups.critical++;
if (pcIds.has(a.id)) {
agingPcCount++;
} else if (serverIds.has(a.id)) {
agingServerCount++;
}
} else if (age >= 3) {
ageGroups.warning++;
} else {
@@ -74,11 +84,24 @@ export function renderHwDashboard(container: HTMLElement) {
</div>
</div>
<div class="dashboard-card" style="min-height:auto;">
<span style="font-size:1rem; font-weight:700; color:var(--text-main);">5년 이상 노후 자산 비율</span>
<div style="font-size: 0.8125rem; color:var(--text-muted); margin-bottom: 1rem;">총 ${over5YearsCount}대 해당</div>
<div style="font-size: 2rem; font-weight:700; color:${over5Rate >= 20 ? 'var(--dash-danger)' : 'var(--dash-primary)'};">${over5Rate}%</div>
<div style="width: 100%; height: 4px; background-color: var(--border-color); border-radius: 2px; overflow: hidden; margin-top: 0.5rem;">
<div style="width: ${over5Rate}%; height: 100%; background-color: ${over5Rate >= 20 ? 'var(--dash-danger)' : 'var(--dash-primary)'};"></div>
<span style="font-size:1rem; font-weight:700; color:var(--text-main);">교체 대상 장비 (5년 노후)</span>
<div style="font-size: 0.8125rem; color:var(--text-muted); margin-bottom: 0.75rem;">총 ${over5YearsCount}대 해당</div>
<div style="display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; margin-bottom: 0.5rem;">
<div>
<span style="font-size: 0.75rem; color: var(--text-muted); display: block;">개인/공용 PC</span>
<strong style="font-size: 1.5rem; font-weight: 700; color: var(--dash-primary);">${agingPcCount}대</strong>
</div>
<div style="width: 1px; height: 28px; background-color: var(--border-color); margin: 0 1rem;"></div>
<div>
<span style="font-size: 0.75rem; color: var(--text-muted); display: block;">서버 장비</span>
<strong style="font-size: 1.5rem; font-weight: 700; color: #3b82f6;">${agingServerCount}대</strong>
</div>
</div>
<div style="width: 100%; height: 6px; background-color: var(--border-color); border-radius: 3px; overflow: hidden; margin-top: 0.75rem; display: flex;">
<div style="width: ${over5YearsCount > 0 ? (agingPcCount / over5YearsCount) * 100 : 0}%; height: 100%; background-color: var(--dash-primary);"></div>
<div style="width: ${over5YearsCount > 0 ? (agingServerCount / over5YearsCount) * 100 : 0}%; height: 100%; background-color: #3b82f6;"></div>
</div>
</div>
<div class="dashboard-card" style="min-height:auto;">