From 0057bd3a44eb7f06af3eddf6097c603f17b30aef Mon Sep 17 00:00:00 2001 From: windpacer Date: Thu, 11 Jun 2026 04:39:19 +0900 Subject: [PATCH] fix(ui): history query - match PascalCase JSON property names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API 응답이 PascalCase(RecordedAt, Values)인데 프론트엔드가 camelCase(recordedAt, values)로 접근해 데이터 미표시 현상 수정. - hist.js: recordedAt→RecordedAt, values→Values - trend.js: consistency fix - index.html: cache busting 버전 갱신 (20260604→20260611) --- src/Hc900Crawler/wwwroot/index.html | 4 ++-- src/Hc900Crawler/wwwroot/js/hist.js | 4 ++-- src/Hc900Crawler/wwwroot/js/trend.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Hc900Crawler/wwwroot/index.html b/src/Hc900Crawler/wwwroot/index.html index 3e8ceee..d3ee134 100644 --- a/src/Hc900Crawler/wwwroot/index.html +++ b/src/Hc900Crawler/wwwroot/index.html @@ -220,7 +220,7 @@ - + @@ -229,7 +229,7 @@ - + diff --git a/src/Hc900Crawler/wwwroot/js/hist.js b/src/Hc900Crawler/wwwroot/js/hist.js index 0e35dc7..5b02638 100644 --- a/src/Hc900Crawler/wwwroot/js/hist.js +++ b/src/Hc900Crawler/wwwroot/js/hist.js @@ -159,7 +159,7 @@ function renderHistoryTable(rows, tNames, interval, baseIntervalSeconds, queryIn } // 시간 간격 조회인 경우 TimeBucket 열 사용 - const timeColumn = rows[0].timeBucket ? 'timeBucket' : 'recordedAt'; + const timeColumn = rows[0].timeBucket ? 'timeBucket' : 'RecordedAt'; tbl.innerHTML = ` @@ -174,7 +174,7 @@ function renderHistoryTable(rows, tNames, interval, baseIntervalSeconds, queryIn ${tNames.map(t => { - const raw = r.values?.[t] ?? null; + const raw = r.Values?.[t] ?? null; const display = raw != null ? esc(String(fmtVal(raw))) : ''; return ``; }).join('')} diff --git a/src/Hc900Crawler/wwwroot/js/trend.js b/src/Hc900Crawler/wwwroot/js/trend.js index 6c32ed2..1302d67 100644 --- a/src/Hc900Crawler/wwwroot/js/trend.js +++ b/src/Hc900Crawler/wwwroot/js/trend.js @@ -356,7 +356,7 @@ async function trQuery() { interval, limit: 5000 }); rows = (d && d.success !== false) ? (d.rows || []) : []; - tk = rows[0]?.timeBucket != null ? 'timeBucket' : 'recordedAt'; + tk = rows[0]?.timeBucket != null ? 'timeBucket' : 'RecordedAt'; // 집계가 0행이면(엔드포인트 이슈 등) 원시로 폴백 → 차트 공백 방지 if (!rows.length) { const r = await rawQuery(); rows = r.rows; tk = r.tk; } } else {
${fmtTs(r[timeColumn])}${display}