<% layout("/en/panel/stations/history/layout", { title: it.meteostanica.name }) %> <%~ include("/en/panel/partials/navbar") %> <% const backIcon = ` ` %> <%~ include("/en/panel/stations/partials/details", { meteostanica: it.meteostanica }) %>
<%~ backIcon %>

<%~ it?.lang?.stations?.history.properties?.[it?.property]() %>

<% if (it.data?.[0]) { %> <% if (it?.dateMap?.years) { %>
<% if (it?.dateMap?.days) { %>
<% } %> <% if (it?.dateMap?.months) { %>
<% } %>
<% } %> <% const time = [] %> <% const data = [] %> <% for (const item of it.data) { %> <% time.push(item.timeMark) %> <% if (it.property === "outdoorConnected") {%> <% data.push(item.value) %> <% continue %> <% } %> <% data.push(item.value / 100) %> <% } %>
<% } else { %>

no data :( send some using your websocket key above.

<% } %> <% function serializeToCode(obj) { %> <% // Handle null/primitive types %> <% if (obj === null) return 'null'; %> <% if (typeof obj === 'string') return `'${obj.replace(/'/g, "\\'")}'`; %> <% if (typeof obj !== 'object') return obj.toString(); %> <% // Handle Arrays %> <% if (Array.isArray(obj)) { %> <% return `[${obj.map(item => serializeToCode(item)).join(',')}]`; %> <% } %> <% // Handle Objects %> <% const entries = Object.entries(obj).map(([key, value]) => { %> <% // Ensure keys are safe (quoted if they contain special characters) %> <% const safeKey = /^[a-z$_][a-z0-9$_]*$/i.test(key) ? key : `'${key}'`; %> <% return `${safeKey}: ${serializeToCode(value)}`; %> <% }); %> <% return `{${entries.join(',')}}`; %> <% } %>