webui: calibrate CSV export, trigger threshold and unit display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
4908c039a5
commit
3cb998c5da
@@ -40,7 +40,9 @@
|
||||
var offset = obj.offset === undefined ? 0 : obj.offset;
|
||||
if (!isFiniteNum(scale) || scale === 0) return null;
|
||||
if (!isFiniteNum(offset)) return null;
|
||||
var unit = String(obj.unit == null ? '' : obj.unit).trim();
|
||||
// Commas and quotes would corrupt the CSV export header; drop them here so
|
||||
// every consumer sees an already-safe unit.
|
||||
var unit = String(obj.unit == null ? '' : obj.unit).replace(/[",]/g, '').trim();
|
||||
// Cap at MAX_UNIT_LEN UTF-8 bytes, matching both hubs' Normalise() exactly.
|
||||
// TextEncoder/TextDecoder are available natively in all modern browsers and
|
||||
// Node v11+; no build step or bundler is needed.
|
||||
|
||||
Reference in New Issue
Block a user