fix(ui): history query - match PascalCase JSON property names

API 응답이 PascalCase(RecordedAt, Values)인데 프론트엔드가
camelCase(recordedAt, values)로 접근해 데이터 미표시 현상 수정.
- hist.js: recordedAt→RecordedAt, values→Values
- trend.js: consistency fix
- index.html: cache busting 버전 갱신 (20260604→20260611)
This commit is contained in:
windpacer
2026-06-11 04:39:19 +09:00
parent 8c7b25e667
commit 0057bd3a44
3 changed files with 5 additions and 5 deletions

View File

@@ -220,7 +220,7 @@
<script src="/js/core.js?v=20260604"></script>
<script src="/js/setup.js?v=20260604"></script>
<script src="/js/pb.js?v=20260604"></script>
<script src="/js/hist.js?v=20260604"></script>
<script src="/js/hist.js?v=20260611"></script>
<script src="/js/t2s.js?v=20260604"></script>
<script src="/js/fast.js?v=20260604"></script>
<script src="/js/pid.js?v=20260604"></script>
@@ -229,7 +229,7 @@
<script src="/js/kbadmin.js?v=20260604"></script>
<script src="/js/write.js?v=20260604"></script>
<script src="/js/docs.js?v=20260604"></script>
<script src="/js/trend.js?v=20260604"></script>
<script src="/js/trend.js?v=20260611"></script>
<script src="/js/ff.js?v=20260604"></script>
<script src="/js/steam.js?v=20260606"></script>
</body>

View File

@@ -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 = `
<table>
@@ -174,7 +174,7 @@ function renderHistoryTable(rows, tNames, interval, baseIntervalSeconds, queryIn
<tr>
<td class="mut" style="white-space:nowrap">${fmtTs(r[timeColumn])}</td>
${tNames.map(t => {
const raw = r.values?.[t] ?? null;
const raw = r.Values?.[t] ?? null;
const display = raw != null ? esc(String(fmtVal(raw))) : '<span style="color:var(--t3)">—</span>';
return `<td class="val">${display}</td>`;
}).join('')}

View File

@@ -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 {