myio-js-library 0.1.583 → 0.1.585
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +98 -74
- package/dist/index.js +98 -74
- package/dist/myio-js-library.umd.js +98 -74
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -989,7 +989,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
989
989
|
// package.json
|
|
990
990
|
var package_default = {
|
|
991
991
|
name: "myio-js-library",
|
|
992
|
-
version: "0.1.
|
|
992
|
+
version: "0.1.585",
|
|
993
993
|
description: "A clean, standalone JS SDK for MYIO projects",
|
|
994
994
|
license: "MIT",
|
|
995
995
|
repository: "github:gh-myio/myio-js-library",
|
|
@@ -29465,6 +29465,42 @@ var TELEMETRY_CONFIG = {
|
|
|
29465
29465
|
// Temperature
|
|
29466
29466
|
temperature: { label: "Temperatura", unit: "\xB0C", icon: "\u{1F321}\uFE0F", decimals: 1 }
|
|
29467
29467
|
};
|
|
29468
|
+
var CURRENT_KEYS_MA = /* @__PURE__ */ new Set(["total_current", "current", "current_a", "current_b", "current_c"]);
|
|
29469
|
+
var POWER_FACTOR_KEYS_255 = /* @__PURE__ */ new Set(["fp_a", "fp_b", "fp_c", "powerFactor"]);
|
|
29470
|
+
function normalizeTelemetryValue(key, raw) {
|
|
29471
|
+
const v = Number(raw) || 0;
|
|
29472
|
+
if (CURRENT_KEYS_MA.has(key)) return v / 1e3;
|
|
29473
|
+
if (POWER_FACTOR_KEYS_255.has(key)) return v / 255;
|
|
29474
|
+
return v;
|
|
29475
|
+
}
|
|
29476
|
+
function scaleWatts(value, decimals) {
|
|
29477
|
+
const abs = Math.abs(value);
|
|
29478
|
+
if (abs >= 1e6) return `${(value / 1e6).toFixed(decimals)} MW`;
|
|
29479
|
+
if (abs >= 1e3) return `${(value / 1e3).toFixed(decimals)} kW`;
|
|
29480
|
+
return `${value.toFixed(0)} W`;
|
|
29481
|
+
}
|
|
29482
|
+
function formatTelemetryValue(key, value) {
|
|
29483
|
+
const config2 = TELEMETRY_CONFIG[key];
|
|
29484
|
+
if (!config2) return value.toFixed(2);
|
|
29485
|
+
if (config2.unit === "W") return scaleWatts(value, 2);
|
|
29486
|
+
return `${value.toFixed(config2.decimals)} ${config2.unit}`;
|
|
29487
|
+
}
|
|
29488
|
+
function formatAxisTick(unit, value) {
|
|
29489
|
+
if (unit === "W") {
|
|
29490
|
+
const n = Number(value);
|
|
29491
|
+
if (Math.abs(n) >= 1e3) return scaleWatts(n, 1);
|
|
29492
|
+
return `${value} W`;
|
|
29493
|
+
}
|
|
29494
|
+
return `${value}${unit ? " " + unit : ""}`;
|
|
29495
|
+
}
|
|
29496
|
+
function formatPeakValue(key, value) {
|
|
29497
|
+
const cfg = TELEMETRY_CONFIG[key] || { label: key, unit: "", icon: "", decimals: 2 };
|
|
29498
|
+
if (cfg.unit === "W") return formatPower(value, 3);
|
|
29499
|
+
return `${value.toLocaleString("pt-BR", {
|
|
29500
|
+
minimumFractionDigits: cfg.decimals ?? 2,
|
|
29501
|
+
maximumFractionDigits: cfg.decimals ?? 2
|
|
29502
|
+
})} ${cfg.unit}`;
|
|
29503
|
+
}
|
|
29468
29504
|
var PHASE_SHORT_LABEL = {
|
|
29469
29505
|
consumption: "Total",
|
|
29470
29506
|
power: "Total",
|
|
@@ -31638,11 +31674,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
31638
31674
|
});
|
|
31639
31675
|
}
|
|
31640
31676
|
function normalizeRealtimeValue(key, raw) {
|
|
31641
|
-
|
|
31642
|
-
return raw / 1e3;
|
|
31643
|
-
}
|
|
31644
|
-
if (key === "fp_a" || key === "fp_b" || key === "fp_c" || key === "powerFactor") return raw / 255;
|
|
31645
|
-
return raw;
|
|
31677
|
+
return normalizeTelemetryValue(key, raw);
|
|
31646
31678
|
}
|
|
31647
31679
|
function fillAggregatedGaps(returned, startTs, endTs, intervalMs, seedY) {
|
|
31648
31680
|
const byBucket = /* @__PURE__ */ new Map();
|
|
@@ -31795,13 +31827,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
31795
31827
|
const data = await fetchPeriodTelemetry(periodStartISO, periodEndISO);
|
|
31796
31828
|
periodHistory.clear();
|
|
31797
31829
|
periodLastKnown.clear();
|
|
31798
|
-
const toPeriodY = (key, raw) =>
|
|
31799
|
-
let y = raw ?? 0;
|
|
31800
|
-
if (key === "total_current" || key === "current") y = y / 1e3;
|
|
31801
|
-
if (key === "fp_a" || key === "fp_b" || key === "fp_c" || key === "powerFactor") y = y / 255;
|
|
31802
|
-
if (POWER_KEYS.has(key)) y = y / 1e3;
|
|
31803
|
-
return y;
|
|
31804
|
-
};
|
|
31830
|
+
const toPeriodY = (key, raw) => normalizeTelemetryValue(key, raw);
|
|
31805
31831
|
const fillGaps = selectedAgg !== "NONE";
|
|
31806
31832
|
const periodStartTs = new Date(periodStartISO).getTime();
|
|
31807
31833
|
const periodEndTs = new Date(periodEndISO).getTime();
|
|
@@ -31851,10 +31877,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
31851
31877
|
minute: "2-digit"
|
|
31852
31878
|
}
|
|
31853
31879
|
) : "";
|
|
31854
|
-
const formattedValue =
|
|
31855
|
-
minimumFractionDigits: cfg.decimals ?? 2,
|
|
31856
|
-
maximumFractionDigits: cfg.decimals ?? 2
|
|
31857
|
-
})} ${cfg.unit}`;
|
|
31880
|
+
const formattedValue = formatPeakValue(peakKey, peakPoint.y);
|
|
31858
31881
|
peakSummaryEl.textContent = `M\xE1xima: ${formattedValue} (${cfg.label}) em ${when}`;
|
|
31859
31882
|
peakSummaryEl.style.display = "block";
|
|
31860
31883
|
} else {
|
|
@@ -31879,13 +31902,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
31879
31902
|
if (!telemetryData || telemetryData.length === 0) continue;
|
|
31880
31903
|
const latest = telemetryData[0];
|
|
31881
31904
|
const config2 = TELEMETRY_CONFIG[key] || { label: key, unit: "", icon: "\u{1F4CA}", decimals: 2 };
|
|
31882
|
-
|
|
31883
|
-
if (key === "total_current" || key === "current" || key === "current_a" || key === "current_b" || key === "current_c") {
|
|
31884
|
-
numValue = numValue / 1e3;
|
|
31885
|
-
}
|
|
31886
|
-
if (key === "fp_a" || key === "fp_b" || key === "fp_c" || key === "powerFactor") {
|
|
31887
|
-
numValue = numValue / 255;
|
|
31888
|
-
}
|
|
31905
|
+
const numValue = normalizeTelemetryValue(key, latest.value);
|
|
31889
31906
|
const formattedNum = numValue.toFixed(config2.decimals);
|
|
31890
31907
|
const displayUnit = config2.unit === "fp" ? "" : config2.unit;
|
|
31891
31908
|
const formatted = displayUnit ? `${formattedNum} ${displayUnit}` : formattedNum;
|
|
@@ -32116,15 +32133,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
32116
32133
|
}
|
|
32117
32134
|
}
|
|
32118
32135
|
function getFormattedValue(key, value) {
|
|
32119
|
-
|
|
32120
|
-
if (!config2) return value.toFixed(2);
|
|
32121
|
-
if (key === "consumption" || key === "power") {
|
|
32122
|
-
if (value >= 1e3) {
|
|
32123
|
-
return `${(value / 1e3).toFixed(2)} kW`;
|
|
32124
|
-
}
|
|
32125
|
-
return `${value.toFixed(0)} W`;
|
|
32126
|
-
}
|
|
32127
|
-
return `${value.toFixed(config2.decimals)} ${config2.unit}`;
|
|
32136
|
+
return formatTelemetryValue(key, value);
|
|
32128
32137
|
}
|
|
32129
32138
|
function hexRgba(hex, alpha) {
|
|
32130
32139
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
@@ -32154,11 +32163,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
32154
32163
|
const rightAxisColor = rightAxisKey ? KEY_COLORS[rightAxisKey] || "#555" : "#555";
|
|
32155
32164
|
function makeTickCallback(unit) {
|
|
32156
32165
|
return function(value) {
|
|
32157
|
-
|
|
32158
|
-
if (value >= 1e3) return `${(value / 1e3).toFixed(1)} kW`;
|
|
32159
|
-
return `${value} W`;
|
|
32160
|
-
}
|
|
32161
|
-
return `${value}${unit ? " " + unit : ""}`;
|
|
32166
|
+
return formatAxisTick(unit, value);
|
|
32162
32167
|
};
|
|
32163
32168
|
}
|
|
32164
32169
|
const datasets = selectedChartKeys.map((key) => {
|
|
@@ -42688,7 +42693,7 @@ var WaterTankModalView = class {
|
|
|
42688
42693
|
const d = new Date(ts);
|
|
42689
42694
|
return `${pad3(d.getDate())}/${pad3(d.getMonth() + 1)} ${pad3(d.getHours())}:${pad3(d.getMinutes())}`;
|
|
42690
42695
|
};
|
|
42691
|
-
const
|
|
42696
|
+
const fmtDay3 = (ts) => {
|
|
42692
42697
|
const d = new Date(ts);
|
|
42693
42698
|
return `${pad3(d.getDate())}/${pad3(d.getMonth() + 1)}`;
|
|
42694
42699
|
};
|
|
@@ -42725,7 +42730,7 @@ var WaterTankModalView = class {
|
|
|
42725
42730
|
<div id="myio-water-tank-kpis" style="display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap;">
|
|
42726
42731
|
${kpiCard("M\xE9dia do per\xEDodo", `<div style="font-size: 22px; font-weight: 700; color: #2c3e50;">${fmtVal(avg)}</div>`)}
|
|
42727
42732
|
${kpiCard("Top 3 picos", peaks.map((p) => listRow(fmtTs(p.ts), fmtVal(p.value))).join(""))}
|
|
42728
|
-
${kpiCard("Top 3 dias mais baixos", lowestDays.map((d) => listRow(
|
|
42733
|
+
${kpiCard("Top 3 dias mais baixos", lowestDays.map((d) => listRow(fmtDay3(d.ts), fmtVal(d.avg))).join(""))}
|
|
42729
42734
|
</div>`;
|
|
42730
42735
|
}
|
|
42731
42736
|
/**
|
|
@@ -65786,13 +65791,6 @@ var INCIDENT_STATUS_LABELS = {
|
|
|
65786
65791
|
RESOLVED: "Resolvido",
|
|
65787
65792
|
CLOSED: "Fechado"
|
|
65788
65793
|
};
|
|
65789
|
-
var SEVERITY_COLORS = {
|
|
65790
|
-
CRITICAL: "#dc2626",
|
|
65791
|
-
HIGH: "#f59e0b",
|
|
65792
|
-
MEDIUM: "#3b82f6",
|
|
65793
|
-
LOW: "#6b7280",
|
|
65794
|
-
INFO: "#6b7280"
|
|
65795
|
-
};
|
|
65796
65794
|
var STYLES_ID4 = "myio-dops-styles";
|
|
65797
65795
|
function esc5(value) {
|
|
65798
65796
|
return String(value ?? "").replace(
|
|
@@ -65833,11 +65831,27 @@ async function fetchDeviceWorkOrders(config2) {
|
|
|
65833
65831
|
const items = Array.isArray(data) ? data : Array.isArray(data?.items) ? data.items : [];
|
|
65834
65832
|
return items;
|
|
65835
65833
|
}
|
|
65834
|
+
function isOpenCritical(i) {
|
|
65835
|
+
return String(i.severity) === "CRITICAL" && !["RESOLVED", "CLOSED"].includes(String(i.status));
|
|
65836
|
+
}
|
|
65837
|
+
var WEEKDAYS_PT = ["dom", "seg", "ter", "qua", "qui", "sex", "s\xE1b"];
|
|
65838
|
+
function fmtDay(day) {
|
|
65839
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(day || ""));
|
|
65840
|
+
if (!m) return day ? String(day) : "\u2014";
|
|
65841
|
+
const wd = WEEKDAYS_PT[new Date(Date.UTC(+m[1], +m[2] - 1, +m[3])).getUTCDay()];
|
|
65842
|
+
return `${m[3]}/${m[2]}/${m[1]} \xB7 ${wd}`;
|
|
65843
|
+
}
|
|
65844
|
+
function relativeAgo(ts, now) {
|
|
65845
|
+
const min = Math.max(0, Math.round((now - ts) / 6e4));
|
|
65846
|
+
if (min < 60) return `h\xE1 ${min} min`;
|
|
65847
|
+
if (min < 48 * 60) return `h\xE1 ${Math.round(min / 60)} h`;
|
|
65848
|
+
return `h\xE1 ${Math.round(min / 1440)} dias`;
|
|
65849
|
+
}
|
|
65836
65850
|
async function fetchDeviceIncidents(config2) {
|
|
65837
65851
|
const api = resolveApi(config2);
|
|
65838
65852
|
const deviceKey = String(config2.ingestionId || api.gcdrDeviceId || "");
|
|
65839
65853
|
if (!deviceKey) return [];
|
|
65840
|
-
const url = `${api.alarmsBase}/incidents?device=${encodeURIComponent(deviceKey)}&sortBy=firstDetectedAt&sortDir=desc&limit=100`;
|
|
65854
|
+
const url = `${api.alarmsBase}/incidents?device=${encodeURIComponent(deviceKey)}&severity=CRITICAL&sortBy=firstDetectedAt&sortDir=desc&limit=100`;
|
|
65841
65855
|
const res = await fetch(url, { headers: api.headers });
|
|
65842
65856
|
if (!res.ok) throw Object.assign(new Error(`Alarms incidents HTTP ${res.status}`), { status: res.status });
|
|
65843
65857
|
const body = await res.json();
|
|
@@ -65869,13 +65883,24 @@ function injectStyles9() {
|
|
|
65869
65883
|
const style = document.createElement("style");
|
|
65870
65884
|
style.id = STYLES_ID4;
|
|
65871
65885
|
style.textContent = `
|
|
65872
|
-
.dops-tab { padding: 4px 2px 20px;
|
|
65886
|
+
.dops-tab { padding: 4px 2px 20px; }
|
|
65887
|
+
.dops-tab, .dops-tab table, .dops-tab th, .dops-tab td, .dops-tab b, .dops-tab small, .dops-tab span {
|
|
65888
|
+
font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
65889
|
+
}
|
|
65890
|
+
.dops-day { white-space:nowrap; font-variant-numeric: tabular-nums; }
|
|
65891
|
+
/* o modal define td/th em 16px \u2014 fixa o tamanho nas pr\xF3prias c\xE9lulas (OSs e Incidentes) */
|
|
65892
|
+
.dops-tab .dops-table td { font-size:12px; line-height:1.45; }
|
|
65893
|
+
.dops-tab .dops-table th { font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
|
|
65894
|
+
.dops-tab .dops-table td.dops-muted { font-size:11.5px; }
|
|
65895
|
+
.dops-tab .dops-chip { font-size:11px; }
|
|
65896
|
+
.dops-tab .dops-table th.dops-col-date { width:140px; min-width:140px; }
|
|
65873
65897
|
.dops-notice { background:#f1ecfa; color:#3e1a7d; border-radius:8px; padding:8px 12px; font-size:12px; margin-bottom:14px; }
|
|
65874
65898
|
.dops-state { padding:28px 16px; text-align:center; color:#6b7280; font-size:13px; }
|
|
65875
65899
|
.dops-error { color:#b91c1c; }
|
|
65876
65900
|
.dops-summary { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
|
|
65877
65901
|
.dops-kpi { border:1px solid #e5e7eb; border-radius:8px; padding:8px 12px; min-width:110px; background:#fff; }
|
|
65878
65902
|
.dops-kpi b { display:block; font-size:18px; color:#111827; }
|
|
65903
|
+
.dops-kpi--crit b { color:#dc2626; }
|
|
65879
65904
|
.dops-kpi span { font-size:11px; color:#6b7280; text-transform:uppercase; letter-spacing:.4px; }
|
|
65880
65905
|
.dops-table { width:100%; border-collapse:collapse; font-size:12px; background:#fff; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; }
|
|
65881
65906
|
.dops-table th { text-align:left; background:#f9fafb; color:#6b7280; font-weight:700; padding:8px 10px; border-bottom:1px solid #e5e7eb; white-space:nowrap; }
|
|
@@ -65942,44 +65967,43 @@ async function renderDeviceIncidentsTab(container, config2) {
|
|
|
65942
65967
|
container.innerHTML = `<div class="dops-tab">${noDeviceHTML("Incidentes")}</div>`;
|
|
65943
65968
|
return 0;
|
|
65944
65969
|
}
|
|
65945
|
-
container.innerHTML = `<div class="dops-tab"><div class="dops-state">Carregando incidentes\u2026</div></div>`;
|
|
65970
|
+
container.innerHTML = `<div class="dops-tab"><div class="dops-state">Carregando incidentes cr\xEDticos\u2026</div></div>`;
|
|
65946
65971
|
let incidents = [];
|
|
65947
65972
|
try {
|
|
65948
|
-
incidents = await fetchDeviceIncidents(config2);
|
|
65973
|
+
incidents = (await fetchDeviceIncidents(config2)).filter(isOpenCritical);
|
|
65949
65974
|
} catch (e) {
|
|
65950
65975
|
container.innerHTML = `<div class="dops-tab"><div class="dops-state dops-error">Erro ao carregar incidentes: ${esc5(
|
|
65951
65976
|
e?.message || e
|
|
65952
65977
|
)}</div></div>`;
|
|
65953
65978
|
return 0;
|
|
65954
65979
|
}
|
|
65955
|
-
const
|
|
65956
|
-
const
|
|
65957
|
-
|
|
65958
|
-
|
|
65959
|
-
const
|
|
65960
|
-
|
|
65961
|
-
|
|
65962
|
-
|
|
65963
|
-
<td>${esc5(i.
|
|
65980
|
+
const now = Date.now();
|
|
65981
|
+
const unacked = incidents.filter((i) => String(i.status) === "OPEN").length;
|
|
65982
|
+
const detected = incidents.map((i) => Date.parse(i.firstDetectedAt || "")).filter((t) => Number.isFinite(t));
|
|
65983
|
+
const oldest = detected.length ? Math.min(...detected) : null;
|
|
65984
|
+
const newest = detected.length ? Math.max(...detected) : null;
|
|
65985
|
+
const daysOpen = oldest !== null ? Math.max(1, Math.round((now - oldest) / 864e5)) : null;
|
|
65986
|
+
const rows = incidents.map(
|
|
65987
|
+
(i) => `<tr>
|
|
65988
|
+
<td class="dops-day">${esc5(fmtDay(i.day))}</td>
|
|
65964
65989
|
<td><span class="dops-chip">${esc5(INCIDENT_STATUS_LABELS[String(i.status)] || i.status || "\u2014")}</span></td>
|
|
65965
|
-
<td>${
|
|
65966
|
-
<td>${
|
|
65967
|
-
<td>${fmtDate(i.firstDetectedAt)}</td>
|
|
65968
|
-
<td>${fmtDate(i.lastEvaluatedAt)}</td>
|
|
65990
|
+
<td class="dops-day">${fmtDate(i.firstDetectedAt)}</td>
|
|
65991
|
+
<td class="dops-day">${fmtDate(i.lastEvaluatedAt)}</td>
|
|
65969
65992
|
<td class="dops-muted">${esc5(i.description || "")}</td>
|
|
65970
|
-
</tr
|
|
65971
|
-
|
|
65993
|
+
</tr>`
|
|
65994
|
+
).join("");
|
|
65972
65995
|
container.innerHTML = `
|
|
65973
65996
|
<div class="dops-tab">
|
|
65974
|
-
<div class="dops-notice">\u{1F512} Vis\xEDvel s\xF3 para usu\xE1rios MyIO. Incidentes do alarms-backend que envolvem este dispositivo.</div>
|
|
65997
|
+
<div class="dops-notice">\u{1F512} Vis\xEDvel s\xF3 para usu\xE1rios MyIO. Incidentes <b>cr\xEDticos em aberto</b> do alarms-backend que envolvem este dispositivo.</div>
|
|
65975
65998
|
<div class="dops-summary">
|
|
65976
|
-
<div class="dops-kpi"><b>${incidents.length}</b><span>
|
|
65977
|
-
<div class="dops-kpi"><b>${
|
|
65978
|
-
<div class="dops-kpi"><b>${
|
|
65999
|
+
<div class="dops-kpi dops-kpi--crit"><b>${incidents.length}</b><span>Cr\xEDticos abertos</span></div>
|
|
66000
|
+
<div class="dops-kpi"><b>${unacked}</b><span>Sem reconhecimento</span></div>
|
|
66001
|
+
<div class="dops-kpi"><b>${daysOpen === null ? "\u2014" : daysOpen + (daysOpen === 1 ? " dia" : " dias")}</b><span>Aberto h\xE1 (mais antigo)</span></div>
|
|
66002
|
+
<div class="dops-kpi"><b>${newest === null ? "\u2014" : esc5(relativeAgo(newest, now))}</b><span>\xDAltima detec\xE7\xE3o</span></div>
|
|
65979
66003
|
</div>
|
|
65980
|
-
${incidents.length ? `<table class="dops-table"><thead><tr><th>
|
|
66004
|
+
${incidents.length ? `<table class="dops-table"><thead><tr><th>Dia</th><th>Status</th><th class="dops-col-date">Detectado</th><th class="dops-col-date">\xDAltima avalia\xE7\xE3o</th><th>Descri\xE7\xE3o</th></tr></thead><tbody>${rows}</tbody></table>` : `<div class="dops-state">Nenhum incidente cr\xEDtico em aberto para este dispositivo.</div>`}
|
|
65981
66005
|
</div>`;
|
|
65982
|
-
return
|
|
66006
|
+
return incidents.length;
|
|
65983
66007
|
}
|
|
65984
66008
|
|
|
65985
66009
|
// src/components/premium-modals/settings/commercialCatalog.ts
|
|
@@ -84409,7 +84433,7 @@ var esc6 = (s) => String(s ?? "").replace(/[&<>"']/g, (c) => ({ "&": "&", "<
|
|
|
84409
84433
|
var norm = (s) => String(s ?? "").normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
|
|
84410
84434
|
var fmtN = (n) => n.toLocaleString("pt-BR");
|
|
84411
84435
|
var pad = (n) => String(n).padStart(2, "0");
|
|
84412
|
-
var
|
|
84436
|
+
var fmtDay2 = (ms) => {
|
|
84413
84437
|
const p = spParts(ms);
|
|
84414
84438
|
return `${pad(p.d)}/${pad(p.m + 1)}`;
|
|
84415
84439
|
};
|
|
@@ -84957,7 +84981,7 @@ var DemandPanelV2 = class {
|
|
|
84957
84981
|
}
|
|
84958
84982
|
jobTitle(e) {
|
|
84959
84983
|
const r = e.request;
|
|
84960
|
-
return `${r.devices.length} medidor(es) \xB7 ${
|
|
84984
|
+
return `${r.devices.length} medidor(es) \xB7 ${fmtDay2(Date.parse(r.period.start))}\u2013${fmtDay2(Date.parse(r.period.end) - 1)} \xB7 ${this.resolutionLabel(r.resolution)}`;
|
|
84961
84985
|
}
|
|
84962
84986
|
renderJobs() {
|
|
84963
84987
|
const s = this.s;
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
// package.json
|
|
11
11
|
var package_default = {
|
|
12
12
|
name: "myio-js-library",
|
|
13
|
-
version: "0.1.
|
|
13
|
+
version: "0.1.585",
|
|
14
14
|
description: "A clean, standalone JS SDK for MYIO projects",
|
|
15
15
|
license: "MIT",
|
|
16
16
|
repository: "github:gh-myio/myio-js-library",
|
|
@@ -27761,6 +27761,42 @@ var TELEMETRY_CONFIG = {
|
|
|
27761
27761
|
// Temperature
|
|
27762
27762
|
temperature: { label: "Temperatura", unit: "\xB0C", icon: "\u{1F321}\uFE0F", decimals: 1 }
|
|
27763
27763
|
};
|
|
27764
|
+
var CURRENT_KEYS_MA = /* @__PURE__ */ new Set(["total_current", "current", "current_a", "current_b", "current_c"]);
|
|
27765
|
+
var POWER_FACTOR_KEYS_255 = /* @__PURE__ */ new Set(["fp_a", "fp_b", "fp_c", "powerFactor"]);
|
|
27766
|
+
function normalizeTelemetryValue(key, raw) {
|
|
27767
|
+
const v = Number(raw) || 0;
|
|
27768
|
+
if (CURRENT_KEYS_MA.has(key)) return v / 1e3;
|
|
27769
|
+
if (POWER_FACTOR_KEYS_255.has(key)) return v / 255;
|
|
27770
|
+
return v;
|
|
27771
|
+
}
|
|
27772
|
+
function scaleWatts(value, decimals) {
|
|
27773
|
+
const abs = Math.abs(value);
|
|
27774
|
+
if (abs >= 1e6) return `${(value / 1e6).toFixed(decimals)} MW`;
|
|
27775
|
+
if (abs >= 1e3) return `${(value / 1e3).toFixed(decimals)} kW`;
|
|
27776
|
+
return `${value.toFixed(0)} W`;
|
|
27777
|
+
}
|
|
27778
|
+
function formatTelemetryValue(key, value) {
|
|
27779
|
+
const config = TELEMETRY_CONFIG[key];
|
|
27780
|
+
if (!config) return value.toFixed(2);
|
|
27781
|
+
if (config.unit === "W") return scaleWatts(value, 2);
|
|
27782
|
+
return `${value.toFixed(config.decimals)} ${config.unit}`;
|
|
27783
|
+
}
|
|
27784
|
+
function formatAxisTick(unit, value) {
|
|
27785
|
+
if (unit === "W") {
|
|
27786
|
+
const n = Number(value);
|
|
27787
|
+
if (Math.abs(n) >= 1e3) return scaleWatts(n, 1);
|
|
27788
|
+
return `${value} W`;
|
|
27789
|
+
}
|
|
27790
|
+
return `${value}${unit ? " " + unit : ""}`;
|
|
27791
|
+
}
|
|
27792
|
+
function formatPeakValue(key, value) {
|
|
27793
|
+
const cfg = TELEMETRY_CONFIG[key] || { label: key, unit: "", icon: "", decimals: 2 };
|
|
27794
|
+
if (cfg.unit === "W") return formatPower(value, 3);
|
|
27795
|
+
return `${value.toLocaleString("pt-BR", {
|
|
27796
|
+
minimumFractionDigits: cfg.decimals ?? 2,
|
|
27797
|
+
maximumFractionDigits: cfg.decimals ?? 2
|
|
27798
|
+
})} ${cfg.unit}`;
|
|
27799
|
+
}
|
|
27764
27800
|
var PHASE_SHORT_LABEL = {
|
|
27765
27801
|
consumption: "Total",
|
|
27766
27802
|
power: "Total",
|
|
@@ -29934,11 +29970,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
29934
29970
|
});
|
|
29935
29971
|
}
|
|
29936
29972
|
function normalizeRealtimeValue(key, raw) {
|
|
29937
|
-
|
|
29938
|
-
return raw / 1e3;
|
|
29939
|
-
}
|
|
29940
|
-
if (key === "fp_a" || key === "fp_b" || key === "fp_c" || key === "powerFactor") return raw / 255;
|
|
29941
|
-
return raw;
|
|
29973
|
+
return normalizeTelemetryValue(key, raw);
|
|
29942
29974
|
}
|
|
29943
29975
|
function fillAggregatedGaps(returned, startTs, endTs, intervalMs, seedY) {
|
|
29944
29976
|
const byBucket = /* @__PURE__ */ new Map();
|
|
@@ -30091,13 +30123,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
30091
30123
|
const data = await fetchPeriodTelemetry(periodStartISO, periodEndISO);
|
|
30092
30124
|
periodHistory.clear();
|
|
30093
30125
|
periodLastKnown.clear();
|
|
30094
|
-
const toPeriodY = (key, raw) =>
|
|
30095
|
-
let y = raw ?? 0;
|
|
30096
|
-
if (key === "total_current" || key === "current") y = y / 1e3;
|
|
30097
|
-
if (key === "fp_a" || key === "fp_b" || key === "fp_c" || key === "powerFactor") y = y / 255;
|
|
30098
|
-
if (POWER_KEYS.has(key)) y = y / 1e3;
|
|
30099
|
-
return y;
|
|
30100
|
-
};
|
|
30126
|
+
const toPeriodY = (key, raw) => normalizeTelemetryValue(key, raw);
|
|
30101
30127
|
const fillGaps = selectedAgg !== "NONE";
|
|
30102
30128
|
const periodStartTs = new Date(periodStartISO).getTime();
|
|
30103
30129
|
const periodEndTs = new Date(periodEndISO).getTime();
|
|
@@ -30147,10 +30173,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
30147
30173
|
minute: "2-digit"
|
|
30148
30174
|
}
|
|
30149
30175
|
) : "";
|
|
30150
|
-
const formattedValue =
|
|
30151
|
-
minimumFractionDigits: cfg.decimals ?? 2,
|
|
30152
|
-
maximumFractionDigits: cfg.decimals ?? 2
|
|
30153
|
-
})} ${cfg.unit}`;
|
|
30176
|
+
const formattedValue = formatPeakValue(peakKey, peakPoint.y);
|
|
30154
30177
|
peakSummaryEl.textContent = `M\xE1xima: ${formattedValue} (${cfg.label}) em ${when}`;
|
|
30155
30178
|
peakSummaryEl.style.display = "block";
|
|
30156
30179
|
} else {
|
|
@@ -30175,13 +30198,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
30175
30198
|
if (!telemetryData || telemetryData.length === 0) continue;
|
|
30176
30199
|
const latest = telemetryData[0];
|
|
30177
30200
|
const config = TELEMETRY_CONFIG[key] || { label: key, unit: "", icon: "\u{1F4CA}", decimals: 2 };
|
|
30178
|
-
|
|
30179
|
-
if (key === "total_current" || key === "current" || key === "current_a" || key === "current_b" || key === "current_c") {
|
|
30180
|
-
numValue = numValue / 1e3;
|
|
30181
|
-
}
|
|
30182
|
-
if (key === "fp_a" || key === "fp_b" || key === "fp_c" || key === "powerFactor") {
|
|
30183
|
-
numValue = numValue / 255;
|
|
30184
|
-
}
|
|
30201
|
+
const numValue = normalizeTelemetryValue(key, latest.value);
|
|
30185
30202
|
const formattedNum = numValue.toFixed(config.decimals);
|
|
30186
30203
|
const displayUnit = config.unit === "fp" ? "" : config.unit;
|
|
30187
30204
|
const formatted = displayUnit ? `${formattedNum} ${displayUnit}` : formattedNum;
|
|
@@ -30412,15 +30429,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
30412
30429
|
}
|
|
30413
30430
|
}
|
|
30414
30431
|
function getFormattedValue(key, value) {
|
|
30415
|
-
|
|
30416
|
-
if (!config) return value.toFixed(2);
|
|
30417
|
-
if (key === "consumption" || key === "power") {
|
|
30418
|
-
if (value >= 1e3) {
|
|
30419
|
-
return `${(value / 1e3).toFixed(2)} kW`;
|
|
30420
|
-
}
|
|
30421
|
-
return `${value.toFixed(0)} W`;
|
|
30422
|
-
}
|
|
30423
|
-
return `${value.toFixed(config.decimals)} ${config.unit}`;
|
|
30432
|
+
return formatTelemetryValue(key, value);
|
|
30424
30433
|
}
|
|
30425
30434
|
function hexRgba(hex, alpha) {
|
|
30426
30435
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
@@ -30450,11 +30459,7 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
30450
30459
|
const rightAxisColor = rightAxisKey ? KEY_COLORS[rightAxisKey] || "#555" : "#555";
|
|
30451
30460
|
function makeTickCallback(unit) {
|
|
30452
30461
|
return function(value) {
|
|
30453
|
-
|
|
30454
|
-
if (value >= 1e3) return `${(value / 1e3).toFixed(1)} kW`;
|
|
30455
|
-
return `${value} W`;
|
|
30456
|
-
}
|
|
30457
|
-
return `${value}${unit ? " " + unit : ""}`;
|
|
30462
|
+
return formatAxisTick(unit, value);
|
|
30458
30463
|
};
|
|
30459
30464
|
}
|
|
30460
30465
|
const datasets = selectedChartKeys.map((key) => {
|
|
@@ -40984,7 +40989,7 @@ var WaterTankModalView = class {
|
|
|
40984
40989
|
const d = new Date(ts);
|
|
40985
40990
|
return `${pad3(d.getDate())}/${pad3(d.getMonth() + 1)} ${pad3(d.getHours())}:${pad3(d.getMinutes())}`;
|
|
40986
40991
|
};
|
|
40987
|
-
const
|
|
40992
|
+
const fmtDay3 = (ts) => {
|
|
40988
40993
|
const d = new Date(ts);
|
|
40989
40994
|
return `${pad3(d.getDate())}/${pad3(d.getMonth() + 1)}`;
|
|
40990
40995
|
};
|
|
@@ -41021,7 +41026,7 @@ var WaterTankModalView = class {
|
|
|
41021
41026
|
<div id="myio-water-tank-kpis" style="display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap;">
|
|
41022
41027
|
${kpiCard("M\xE9dia do per\xEDodo", `<div style="font-size: 22px; font-weight: 700; color: #2c3e50;">${fmtVal(avg)}</div>`)}
|
|
41023
41028
|
${kpiCard("Top 3 picos", peaks.map((p) => listRow(fmtTs(p.ts), fmtVal(p.value))).join(""))}
|
|
41024
|
-
${kpiCard("Top 3 dias mais baixos", lowestDays.map((d) => listRow(
|
|
41029
|
+
${kpiCard("Top 3 dias mais baixos", lowestDays.map((d) => listRow(fmtDay3(d.ts), fmtVal(d.avg))).join(""))}
|
|
41025
41030
|
</div>`;
|
|
41026
41031
|
}
|
|
41027
41032
|
/**
|
|
@@ -64082,13 +64087,6 @@ var INCIDENT_STATUS_LABELS = {
|
|
|
64082
64087
|
RESOLVED: "Resolvido",
|
|
64083
64088
|
CLOSED: "Fechado"
|
|
64084
64089
|
};
|
|
64085
|
-
var SEVERITY_COLORS = {
|
|
64086
|
-
CRITICAL: "#dc2626",
|
|
64087
|
-
HIGH: "#f59e0b",
|
|
64088
|
-
MEDIUM: "#3b82f6",
|
|
64089
|
-
LOW: "#6b7280",
|
|
64090
|
-
INFO: "#6b7280"
|
|
64091
|
-
};
|
|
64092
64090
|
var STYLES_ID4 = "myio-dops-styles";
|
|
64093
64091
|
function esc5(value) {
|
|
64094
64092
|
return String(value ?? "").replace(
|
|
@@ -64129,11 +64127,27 @@ async function fetchDeviceWorkOrders(config) {
|
|
|
64129
64127
|
const items = Array.isArray(data) ? data : Array.isArray(data?.items) ? data.items : [];
|
|
64130
64128
|
return items;
|
|
64131
64129
|
}
|
|
64130
|
+
function isOpenCritical(i) {
|
|
64131
|
+
return String(i.severity) === "CRITICAL" && !["RESOLVED", "CLOSED"].includes(String(i.status));
|
|
64132
|
+
}
|
|
64133
|
+
var WEEKDAYS_PT = ["dom", "seg", "ter", "qua", "qui", "sex", "s\xE1b"];
|
|
64134
|
+
function fmtDay(day) {
|
|
64135
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(day || ""));
|
|
64136
|
+
if (!m) return day ? String(day) : "\u2014";
|
|
64137
|
+
const wd = WEEKDAYS_PT[new Date(Date.UTC(+m[1], +m[2] - 1, +m[3])).getUTCDay()];
|
|
64138
|
+
return `${m[3]}/${m[2]}/${m[1]} \xB7 ${wd}`;
|
|
64139
|
+
}
|
|
64140
|
+
function relativeAgo(ts, now) {
|
|
64141
|
+
const min = Math.max(0, Math.round((now - ts) / 6e4));
|
|
64142
|
+
if (min < 60) return `h\xE1 ${min} min`;
|
|
64143
|
+
if (min < 48 * 60) return `h\xE1 ${Math.round(min / 60)} h`;
|
|
64144
|
+
return `h\xE1 ${Math.round(min / 1440)} dias`;
|
|
64145
|
+
}
|
|
64132
64146
|
async function fetchDeviceIncidents(config) {
|
|
64133
64147
|
const api = resolveApi(config);
|
|
64134
64148
|
const deviceKey = String(config.ingestionId || api.gcdrDeviceId || "");
|
|
64135
64149
|
if (!deviceKey) return [];
|
|
64136
|
-
const url = `${api.alarmsBase}/incidents?device=${encodeURIComponent(deviceKey)}&sortBy=firstDetectedAt&sortDir=desc&limit=100`;
|
|
64150
|
+
const url = `${api.alarmsBase}/incidents?device=${encodeURIComponent(deviceKey)}&severity=CRITICAL&sortBy=firstDetectedAt&sortDir=desc&limit=100`;
|
|
64137
64151
|
const res = await fetch(url, { headers: api.headers });
|
|
64138
64152
|
if (!res.ok) throw Object.assign(new Error(`Alarms incidents HTTP ${res.status}`), { status: res.status });
|
|
64139
64153
|
const body = await res.json();
|
|
@@ -64165,13 +64179,24 @@ function injectStyles9() {
|
|
|
64165
64179
|
const style = document.createElement("style");
|
|
64166
64180
|
style.id = STYLES_ID4;
|
|
64167
64181
|
style.textContent = `
|
|
64168
|
-
.dops-tab { padding: 4px 2px 20px;
|
|
64182
|
+
.dops-tab { padding: 4px 2px 20px; }
|
|
64183
|
+
.dops-tab, .dops-tab table, .dops-tab th, .dops-tab td, .dops-tab b, .dops-tab small, .dops-tab span {
|
|
64184
|
+
font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
64185
|
+
}
|
|
64186
|
+
.dops-day { white-space:nowrap; font-variant-numeric: tabular-nums; }
|
|
64187
|
+
/* o modal define td/th em 16px \u2014 fixa o tamanho nas pr\xF3prias c\xE9lulas (OSs e Incidentes) */
|
|
64188
|
+
.dops-tab .dops-table td { font-size:12px; line-height:1.45; }
|
|
64189
|
+
.dops-tab .dops-table th { font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
|
|
64190
|
+
.dops-tab .dops-table td.dops-muted { font-size:11.5px; }
|
|
64191
|
+
.dops-tab .dops-chip { font-size:11px; }
|
|
64192
|
+
.dops-tab .dops-table th.dops-col-date { width:140px; min-width:140px; }
|
|
64169
64193
|
.dops-notice { background:#f1ecfa; color:#3e1a7d; border-radius:8px; padding:8px 12px; font-size:12px; margin-bottom:14px; }
|
|
64170
64194
|
.dops-state { padding:28px 16px; text-align:center; color:#6b7280; font-size:13px; }
|
|
64171
64195
|
.dops-error { color:#b91c1c; }
|
|
64172
64196
|
.dops-summary { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
|
|
64173
64197
|
.dops-kpi { border:1px solid #e5e7eb; border-radius:8px; padding:8px 12px; min-width:110px; background:#fff; }
|
|
64174
64198
|
.dops-kpi b { display:block; font-size:18px; color:#111827; }
|
|
64199
|
+
.dops-kpi--crit b { color:#dc2626; }
|
|
64175
64200
|
.dops-kpi span { font-size:11px; color:#6b7280; text-transform:uppercase; letter-spacing:.4px; }
|
|
64176
64201
|
.dops-table { width:100%; border-collapse:collapse; font-size:12px; background:#fff; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; }
|
|
64177
64202
|
.dops-table th { text-align:left; background:#f9fafb; color:#6b7280; font-weight:700; padding:8px 10px; border-bottom:1px solid #e5e7eb; white-space:nowrap; }
|
|
@@ -64238,44 +64263,43 @@ async function renderDeviceIncidentsTab(container, config) {
|
|
|
64238
64263
|
container.innerHTML = `<div class="dops-tab">${noDeviceHTML("Incidentes")}</div>`;
|
|
64239
64264
|
return 0;
|
|
64240
64265
|
}
|
|
64241
|
-
container.innerHTML = `<div class="dops-tab"><div class="dops-state">Carregando incidentes\u2026</div></div>`;
|
|
64266
|
+
container.innerHTML = `<div class="dops-tab"><div class="dops-state">Carregando incidentes cr\xEDticos\u2026</div></div>`;
|
|
64242
64267
|
let incidents = [];
|
|
64243
64268
|
try {
|
|
64244
|
-
incidents = await fetchDeviceIncidents(config);
|
|
64269
|
+
incidents = (await fetchDeviceIncidents(config)).filter(isOpenCritical);
|
|
64245
64270
|
} catch (e) {
|
|
64246
64271
|
container.innerHTML = `<div class="dops-tab"><div class="dops-state dops-error">Erro ao carregar incidentes: ${esc5(
|
|
64247
64272
|
e?.message || e
|
|
64248
64273
|
)}</div></div>`;
|
|
64249
64274
|
return 0;
|
|
64250
64275
|
}
|
|
64251
|
-
const
|
|
64252
|
-
const
|
|
64253
|
-
|
|
64254
|
-
|
|
64255
|
-
const
|
|
64256
|
-
|
|
64257
|
-
|
|
64258
|
-
|
|
64259
|
-
<td>${esc5(i.
|
|
64276
|
+
const now = Date.now();
|
|
64277
|
+
const unacked = incidents.filter((i) => String(i.status) === "OPEN").length;
|
|
64278
|
+
const detected = incidents.map((i) => Date.parse(i.firstDetectedAt || "")).filter((t) => Number.isFinite(t));
|
|
64279
|
+
const oldest = detected.length ? Math.min(...detected) : null;
|
|
64280
|
+
const newest = detected.length ? Math.max(...detected) : null;
|
|
64281
|
+
const daysOpen = oldest !== null ? Math.max(1, Math.round((now - oldest) / 864e5)) : null;
|
|
64282
|
+
const rows = incidents.map(
|
|
64283
|
+
(i) => `<tr>
|
|
64284
|
+
<td class="dops-day">${esc5(fmtDay(i.day))}</td>
|
|
64260
64285
|
<td><span class="dops-chip">${esc5(INCIDENT_STATUS_LABELS[String(i.status)] || i.status || "\u2014")}</span></td>
|
|
64261
|
-
<td>${
|
|
64262
|
-
<td>${
|
|
64263
|
-
<td>${fmtDate(i.firstDetectedAt)}</td>
|
|
64264
|
-
<td>${fmtDate(i.lastEvaluatedAt)}</td>
|
|
64286
|
+
<td class="dops-day">${fmtDate(i.firstDetectedAt)}</td>
|
|
64287
|
+
<td class="dops-day">${fmtDate(i.lastEvaluatedAt)}</td>
|
|
64265
64288
|
<td class="dops-muted">${esc5(i.description || "")}</td>
|
|
64266
|
-
</tr
|
|
64267
|
-
|
|
64289
|
+
</tr>`
|
|
64290
|
+
).join("");
|
|
64268
64291
|
container.innerHTML = `
|
|
64269
64292
|
<div class="dops-tab">
|
|
64270
|
-
<div class="dops-notice">\u{1F512} Vis\xEDvel s\xF3 para usu\xE1rios MyIO. Incidentes do alarms-backend que envolvem este dispositivo.</div>
|
|
64293
|
+
<div class="dops-notice">\u{1F512} Vis\xEDvel s\xF3 para usu\xE1rios MyIO. Incidentes <b>cr\xEDticos em aberto</b> do alarms-backend que envolvem este dispositivo.</div>
|
|
64271
64294
|
<div class="dops-summary">
|
|
64272
|
-
<div class="dops-kpi"><b>${incidents.length}</b><span>
|
|
64273
|
-
<div class="dops-kpi"><b>${
|
|
64274
|
-
<div class="dops-kpi"><b>${
|
|
64295
|
+
<div class="dops-kpi dops-kpi--crit"><b>${incidents.length}</b><span>Cr\xEDticos abertos</span></div>
|
|
64296
|
+
<div class="dops-kpi"><b>${unacked}</b><span>Sem reconhecimento</span></div>
|
|
64297
|
+
<div class="dops-kpi"><b>${daysOpen === null ? "\u2014" : daysOpen + (daysOpen === 1 ? " dia" : " dias")}</b><span>Aberto h\xE1 (mais antigo)</span></div>
|
|
64298
|
+
<div class="dops-kpi"><b>${newest === null ? "\u2014" : esc5(relativeAgo(newest, now))}</b><span>\xDAltima detec\xE7\xE3o</span></div>
|
|
64275
64299
|
</div>
|
|
64276
|
-
${incidents.length ? `<table class="dops-table"><thead><tr><th>
|
|
64300
|
+
${incidents.length ? `<table class="dops-table"><thead><tr><th>Dia</th><th>Status</th><th class="dops-col-date">Detectado</th><th class="dops-col-date">\xDAltima avalia\xE7\xE3o</th><th>Descri\xE7\xE3o</th></tr></thead><tbody>${rows}</tbody></table>` : `<div class="dops-state">Nenhum incidente cr\xEDtico em aberto para este dispositivo.</div>`}
|
|
64277
64301
|
</div>`;
|
|
64278
|
-
return
|
|
64302
|
+
return incidents.length;
|
|
64279
64303
|
}
|
|
64280
64304
|
|
|
64281
64305
|
// src/components/premium-modals/settings/commercialCatalog.ts
|
|
@@ -82705,7 +82729,7 @@ var esc6 = (s) => String(s ?? "").replace(/[&<>"']/g, (c) => ({ "&": "&", "<
|
|
|
82705
82729
|
var norm = (s) => String(s ?? "").normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
|
|
82706
82730
|
var fmtN = (n) => n.toLocaleString("pt-BR");
|
|
82707
82731
|
var pad = (n) => String(n).padStart(2, "0");
|
|
82708
|
-
var
|
|
82732
|
+
var fmtDay2 = (ms) => {
|
|
82709
82733
|
const p = spParts(ms);
|
|
82710
82734
|
return `${pad(p.d)}/${pad(p.m + 1)}`;
|
|
82711
82735
|
};
|
|
@@ -83253,7 +83277,7 @@ var DemandPanelV2 = class {
|
|
|
83253
83277
|
}
|
|
83254
83278
|
jobTitle(e) {
|
|
83255
83279
|
const r = e.request;
|
|
83256
|
-
return `${r.devices.length} medidor(es) \xB7 ${
|
|
83280
|
+
return `${r.devices.length} medidor(es) \xB7 ${fmtDay2(Date.parse(r.period.start))}\u2013${fmtDay2(Date.parse(r.period.end) - 1)} \xB7 ${this.resolutionLabel(r.resolution)}`;
|
|
83257
83281
|
}
|
|
83258
83282
|
renderJobs() {
|
|
83259
83283
|
const s = this.s;
|