myio-js-library 0.1.310 → 0.1.312
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 +88 -53
- package/dist/index.js +88 -53
- package/dist/myio-js-library.umd.js +88 -53
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -26683,6 +26683,7 @@ var WelcomeModalView = class {
|
|
|
26683
26683
|
--wm-logout-btn-border: ${p.logoutBtnBorder};
|
|
26684
26684
|
--wm-card-bg: ${p.shoppingCardBg};
|
|
26685
26685
|
--wm-card-border: ${p.shoppingCardBorder};
|
|
26686
|
+
--wm-font-scale: 1;
|
|
26686
26687
|
|
|
26687
26688
|
position: fixed;
|
|
26688
26689
|
inset: 0;
|
|
@@ -27084,7 +27085,7 @@ var WelcomeModalView = class {
|
|
|
27084
27085
|
|
|
27085
27086
|
.myio-welcome-card-title {
|
|
27086
27087
|
margin: 0 !important;
|
|
27087
|
-
font-size: 22px !important;
|
|
27088
|
+
font-size: calc(22px * var(--wm-font-scale)) !important;
|
|
27088
27089
|
font-weight: 700 !important;
|
|
27089
27090
|
color: var(--wm-ink);
|
|
27090
27091
|
letter-spacing: 0.02em;
|
|
@@ -27093,7 +27094,7 @@ var WelcomeModalView = class {
|
|
|
27093
27094
|
|
|
27094
27095
|
.myio-welcome-card-subtitle {
|
|
27095
27096
|
margin: 0 !important;
|
|
27096
|
-
font-size: 13px !important;
|
|
27097
|
+
font-size: calc(13px * var(--wm-font-scale)) !important;
|
|
27097
27098
|
font-weight: 400 !important;
|
|
27098
27099
|
color: var(--wm-muted);
|
|
27099
27100
|
}
|
|
@@ -27118,7 +27119,7 @@ var WelcomeModalView = class {
|
|
|
27118
27119
|
gap: 4px !important;
|
|
27119
27120
|
padding: 4px 8px !important;
|
|
27120
27121
|
min-width: 50px !important;
|
|
27121
|
-
font-size: 11px !important;
|
|
27122
|
+
font-size: calc(11px * var(--wm-font-scale)) !important;
|
|
27122
27123
|
font-weight: 600 !important;
|
|
27123
27124
|
color: var(--wm-muted);
|
|
27124
27125
|
background: rgba(0, 0, 0, 0.3);
|
|
@@ -27135,7 +27136,7 @@ var WelcomeModalView = class {
|
|
|
27135
27136
|
}
|
|
27136
27137
|
|
|
27137
27138
|
.myio-welcome-card-device-count .value {
|
|
27138
|
-
font-size: 10px !important;
|
|
27139
|
+
font-size: calc(10px * var(--wm-font-scale)) !important;
|
|
27139
27140
|
font-weight: 400 !important;
|
|
27140
27141
|
opacity: 0.85;
|
|
27141
27142
|
white-space: nowrap;
|
|
@@ -27148,7 +27149,7 @@ var WelcomeModalView = class {
|
|
|
27148
27149
|
}
|
|
27149
27150
|
|
|
27150
27151
|
.myio-welcome-card-device-count .icon {
|
|
27151
|
-
font-size: 10px !important;
|
|
27152
|
+
font-size: calc(10px * var(--wm-font-scale)) !important;
|
|
27152
27153
|
}
|
|
27153
27154
|
|
|
27154
27155
|
.myio-welcome-card-device-count.energy:hover {
|
|
@@ -27298,7 +27299,7 @@ var WelcomeModalView = class {
|
|
|
27298
27299
|
}
|
|
27299
27300
|
|
|
27300
27301
|
.myio-welcome-card-title {
|
|
27301
|
-
font-size: 16px !important;
|
|
27302
|
+
font-size: calc(16px * var(--wm-font-scale)) !important;
|
|
27302
27303
|
}
|
|
27303
27304
|
|
|
27304
27305
|
.myio-welcome-card-device-counts {
|
|
@@ -27308,16 +27309,16 @@ var WelcomeModalView = class {
|
|
|
27308
27309
|
|
|
27309
27310
|
.myio-welcome-card-device-count {
|
|
27310
27311
|
padding: 4px 8px;
|
|
27311
|
-
font-size: 12px;
|
|
27312
|
+
font-size: calc(12px * var(--wm-font-scale));
|
|
27312
27313
|
min-width: 52px !important;
|
|
27313
27314
|
}
|
|
27314
27315
|
|
|
27315
27316
|
.myio-welcome-card-device-count .icon {
|
|
27316
|
-
font-size: 11px !important;
|
|
27317
|
+
font-size: calc(11px * var(--wm-font-scale)) !important;
|
|
27317
27318
|
}
|
|
27318
27319
|
|
|
27319
27320
|
.myio-welcome-card-device-count .value {
|
|
27320
|
-
font-size: 11px !important;
|
|
27321
|
+
font-size: calc(11px * var(--wm-font-scale)) !important;
|
|
27321
27322
|
}
|
|
27322
27323
|
}
|
|
27323
27324
|
|
|
@@ -27386,7 +27387,7 @@ var WelcomeModalView = class {
|
|
|
27386
27387
|
}
|
|
27387
27388
|
|
|
27388
27389
|
.myio-welcome-card-title {
|
|
27389
|
-
font-size: 14px !important;
|
|
27390
|
+
font-size: calc(14px * var(--wm-font-scale)) !important;
|
|
27390
27391
|
}
|
|
27391
27392
|
|
|
27392
27393
|
.myio-welcome-card-device-counts {
|
|
@@ -27396,16 +27397,16 @@ var WelcomeModalView = class {
|
|
|
27396
27397
|
|
|
27397
27398
|
.myio-welcome-card-device-count {
|
|
27398
27399
|
padding: 3px 6px;
|
|
27399
|
-
font-size: 11px;
|
|
27400
|
+
font-size: calc(11px * var(--wm-font-scale));
|
|
27400
27401
|
min-width: 44px !important;
|
|
27401
27402
|
}
|
|
27402
27403
|
|
|
27403
27404
|
.myio-welcome-card-device-count .icon {
|
|
27404
|
-
font-size: 10px !important;
|
|
27405
|
+
font-size: calc(10px * var(--wm-font-scale)) !important;
|
|
27405
27406
|
}
|
|
27406
27407
|
|
|
27407
27408
|
.myio-welcome-card-device-count .value {
|
|
27408
|
-
font-size: 10px !important;
|
|
27409
|
+
font-size: calc(10px * var(--wm-font-scale)) !important;
|
|
27409
27410
|
}
|
|
27410
27411
|
|
|
27411
27412
|
.myio-welcome-card-arrow {
|
|
@@ -27974,16 +27975,33 @@ var WelcomeModalView = class {
|
|
|
27974
27975
|
const fontSizeRange = this.container.querySelector("#fontSizeRange");
|
|
27975
27976
|
const fontSizeValue = this.container.querySelector("#fontSizeValue");
|
|
27976
27977
|
if (fontSizeRange && fontSizeValue) {
|
|
27978
|
+
const applyFontScale = (scale) => {
|
|
27979
|
+
const cardTitles = this.container.querySelectorAll(".myio-welcome-card-title");
|
|
27980
|
+
cardTitles.forEach((el) => {
|
|
27981
|
+
el.style.setProperty("font-size", `${22 * scale}px`, "important");
|
|
27982
|
+
});
|
|
27983
|
+
const cardSubtitles = this.container.querySelectorAll(".myio-welcome-card-subtitle");
|
|
27984
|
+
cardSubtitles.forEach((el) => {
|
|
27985
|
+
el.style.setProperty("font-size", `${13 * scale}px`, "important");
|
|
27986
|
+
});
|
|
27987
|
+
const deviceCounts = this.container.querySelectorAll(".myio-welcome-card-device-count");
|
|
27988
|
+
deviceCounts.forEach((el) => {
|
|
27989
|
+
el.style.setProperty("font-size", `${11 * scale}px`, "important");
|
|
27990
|
+
});
|
|
27991
|
+
const countValues = this.container.querySelectorAll(".myio-welcome-card-device-count .value");
|
|
27992
|
+
countValues.forEach((el) => {
|
|
27993
|
+
el.style.setProperty("font-size", `${10 * scale}px`, "important");
|
|
27994
|
+
});
|
|
27995
|
+
const countIcons = this.container.querySelectorAll(".myio-welcome-card-device-count .icon");
|
|
27996
|
+
countIcons.forEach((el) => {
|
|
27997
|
+
el.style.setProperty("font-size", `${10 * scale}px`, "important");
|
|
27998
|
+
});
|
|
27999
|
+
};
|
|
27977
28000
|
fontSizeRange.addEventListener("input", () => {
|
|
27978
28001
|
const value = parseInt(fontSizeRange.value, 10);
|
|
27979
28002
|
fontSizeValue.textContent = `${value}%`;
|
|
27980
28003
|
const scale = value / 100;
|
|
27981
|
-
|
|
27982
|
-
const deviceCounts = this.container.querySelectorAll(".myio-welcome-card-device-counts");
|
|
27983
|
-
deviceCounts.forEach((el) => {
|
|
27984
|
-
el.style.transform = `scale(${scale})`;
|
|
27985
|
-
el.style.transformOrigin = "left center";
|
|
27986
|
-
});
|
|
28004
|
+
applyFontScale(scale);
|
|
27987
28005
|
});
|
|
27988
28006
|
}
|
|
27989
28007
|
this.bindTooltipEvents();
|
|
@@ -28206,12 +28224,13 @@ var WelcomeModalView = class {
|
|
|
28206
28224
|
temperatureDevices: temperatureItems.length
|
|
28207
28225
|
});
|
|
28208
28226
|
}
|
|
28227
|
+
const energyCategories = win.MyIOLibrary?.buildEquipmentCategoryDataForTooltip?.(energyItems) || [];
|
|
28209
28228
|
return {
|
|
28210
28229
|
energy: {
|
|
28211
28230
|
totalDevices: energyItems.length,
|
|
28212
28231
|
totalConsumption: energyTotal,
|
|
28213
28232
|
unit: "kWh",
|
|
28214
|
-
byCategory: [
|
|
28233
|
+
byCategory: energyCategories.length > 0 ? energyCategories : [
|
|
28215
28234
|
{
|
|
28216
28235
|
id: "equipamentos",
|
|
28217
28236
|
name: "Equipamentos",
|
|
@@ -28219,8 +28238,9 @@ var WelcomeModalView = class {
|
|
|
28219
28238
|
deviceCount: energyItems.filter(
|
|
28220
28239
|
(d) => d.deviceType !== "3F_MEDIDOR" || d.deviceProfile !== "3F_MEDIDOR"
|
|
28221
28240
|
).length,
|
|
28222
|
-
consumption: 0,
|
|
28223
|
-
|
|
28241
|
+
consumption: energyTotal * 0.3,
|
|
28242
|
+
// Fallback estimate
|
|
28243
|
+
percentage: 30
|
|
28224
28244
|
},
|
|
28225
28245
|
{
|
|
28226
28246
|
id: "lojas",
|
|
@@ -28229,42 +28249,49 @@ var WelcomeModalView = class {
|
|
|
28229
28249
|
deviceCount: energyItems.filter(
|
|
28230
28250
|
(d) => d.deviceType === "3F_MEDIDOR" && d.deviceProfile === "3F_MEDIDOR"
|
|
28231
28251
|
).length,
|
|
28232
|
-
consumption: 0,
|
|
28233
|
-
|
|
28252
|
+
consumption: energyTotal * 0.7,
|
|
28253
|
+
// Fallback estimate
|
|
28254
|
+
percentage: 70
|
|
28234
28255
|
}
|
|
28235
28256
|
],
|
|
28236
28257
|
byStatus: aggregateStatus(energyItems),
|
|
28237
28258
|
lastUpdated: now,
|
|
28238
28259
|
customerName: card.title
|
|
28239
28260
|
},
|
|
28240
|
-
water: {
|
|
28241
|
-
|
|
28242
|
-
|
|
28243
|
-
|
|
28244
|
-
|
|
28245
|
-
|
|
28246
|
-
|
|
28247
|
-
|
|
28248
|
-
|
|
28249
|
-
|
|
28250
|
-
|
|
28251
|
-
|
|
28252
|
-
|
|
28253
|
-
|
|
28254
|
-
|
|
28255
|
-
|
|
28256
|
-
|
|
28257
|
-
|
|
28258
|
-
|
|
28259
|
-
|
|
28260
|
-
|
|
28261
|
-
|
|
28262
|
-
|
|
28263
|
-
|
|
28264
|
-
|
|
28265
|
-
|
|
28266
|
-
|
|
28267
|
-
|
|
28261
|
+
water: (() => {
|
|
28262
|
+
const areaComumItems = waterItems.filter((d) => (d.deviceProfile || "").includes("AREA_COMUM"));
|
|
28263
|
+
const lojaItems = waterItems.filter(
|
|
28264
|
+
(d) => !(d.deviceProfile || "").includes("AREA_COMUM") && !(d.deviceProfile || "").includes("SHOPPING")
|
|
28265
|
+
);
|
|
28266
|
+
const areaComumConsumption = areaComumItems.reduce((sum, d) => sum + Number(d.value || d.pulses || 0), 0);
|
|
28267
|
+
const lojasConsumption = lojaItems.reduce((sum, d) => sum + Number(d.value || d.pulses || 0), 0);
|
|
28268
|
+
return {
|
|
28269
|
+
totalDevices: waterItems.length,
|
|
28270
|
+
totalConsumption: waterTotal,
|
|
28271
|
+
unit: "m\xB3",
|
|
28272
|
+
byCategory: [
|
|
28273
|
+
{
|
|
28274
|
+
id: "areaComum",
|
|
28275
|
+
name: "\xC1rea Comum",
|
|
28276
|
+
icon: "\u{1F3E2}",
|
|
28277
|
+
deviceCount: areaComumItems.length,
|
|
28278
|
+
consumption: areaComumConsumption,
|
|
28279
|
+
percentage: waterTotal > 0 ? areaComumConsumption / waterTotal * 100 : 0
|
|
28280
|
+
},
|
|
28281
|
+
{
|
|
28282
|
+
id: "lojas",
|
|
28283
|
+
name: "Lojas",
|
|
28284
|
+
icon: "\u{1F3EA}",
|
|
28285
|
+
deviceCount: lojaItems.length,
|
|
28286
|
+
consumption: lojasConsumption,
|
|
28287
|
+
percentage: waterTotal > 0 ? lojasConsumption / waterTotal * 100 : 0
|
|
28288
|
+
}
|
|
28289
|
+
],
|
|
28290
|
+
byStatus: aggregateStatus(waterItems),
|
|
28291
|
+
lastUpdated: now,
|
|
28292
|
+
customerName: card.title
|
|
28293
|
+
};
|
|
28294
|
+
})(),
|
|
28268
28295
|
temperature: {
|
|
28269
28296
|
devices: temperatureItems.map((d) => ({
|
|
28270
28297
|
name: d.label || d.name || "Sensor",
|
|
@@ -31760,6 +31787,12 @@ var ComparisonHandler = class {
|
|
|
31760
31787
|
if (!ingestionToken2) {
|
|
31761
31788
|
throw new Error("Ingestion token not available");
|
|
31762
31789
|
}
|
|
31790
|
+
const credentials = win.MyIOUtils?.getCredentials?.() || {};
|
|
31791
|
+
const clientId = credentials.clientId;
|
|
31792
|
+
const clientSecret = credentials.clientSecret;
|
|
31793
|
+
if (!clientId || !clientSecret) {
|
|
31794
|
+
this.log.warn("clientId/clientSecret not found in MyIOUtils.getCredentials()");
|
|
31795
|
+
}
|
|
31763
31796
|
const dataSources = entities.map((entity) => ({
|
|
31764
31797
|
type: "device",
|
|
31765
31798
|
id: entity.ingestionId || entity.id,
|
|
@@ -31784,6 +31817,8 @@ var ComparisonHandler = class {
|
|
|
31784
31817
|
startDate: start,
|
|
31785
31818
|
endDate: end,
|
|
31786
31819
|
granularity,
|
|
31820
|
+
clientId,
|
|
31821
|
+
clientSecret,
|
|
31787
31822
|
chartsBaseUrl: this.chartsBaseUrl,
|
|
31788
31823
|
dataApiHost: this.dataApiHost,
|
|
31789
31824
|
theme: this.params.theme ?? "dark",
|
|
@@ -62444,7 +62479,7 @@ var TelemetryGridController = class {
|
|
|
62444
62479
|
}
|
|
62445
62480
|
if (this.state.filters.selectedShoppingIds.length > 0) {
|
|
62446
62481
|
filtered = filtered.filter(
|
|
62447
|
-
(d) => this.state.filters.selectedShoppingIds.includes(d.customerId)
|
|
62482
|
+
(d) => this.state.filters.selectedShoppingIds.includes(d.customerId) || this.state.filters.selectedShoppingIds.includes(d.ingestionId)
|
|
62448
62483
|
);
|
|
62449
62484
|
}
|
|
62450
62485
|
if (this.state.filters.selectedDeviceIds && this.state.filters.selectedDeviceIds.size > 0) {
|
package/dist/index.js
CHANGED
|
@@ -26407,6 +26407,7 @@ var WelcomeModalView = class {
|
|
|
26407
26407
|
--wm-logout-btn-border: ${p.logoutBtnBorder};
|
|
26408
26408
|
--wm-card-bg: ${p.shoppingCardBg};
|
|
26409
26409
|
--wm-card-border: ${p.shoppingCardBorder};
|
|
26410
|
+
--wm-font-scale: 1;
|
|
26410
26411
|
|
|
26411
26412
|
position: fixed;
|
|
26412
26413
|
inset: 0;
|
|
@@ -26808,7 +26809,7 @@ var WelcomeModalView = class {
|
|
|
26808
26809
|
|
|
26809
26810
|
.myio-welcome-card-title {
|
|
26810
26811
|
margin: 0 !important;
|
|
26811
|
-
font-size: 22px !important;
|
|
26812
|
+
font-size: calc(22px * var(--wm-font-scale)) !important;
|
|
26812
26813
|
font-weight: 700 !important;
|
|
26813
26814
|
color: var(--wm-ink);
|
|
26814
26815
|
letter-spacing: 0.02em;
|
|
@@ -26817,7 +26818,7 @@ var WelcomeModalView = class {
|
|
|
26817
26818
|
|
|
26818
26819
|
.myio-welcome-card-subtitle {
|
|
26819
26820
|
margin: 0 !important;
|
|
26820
|
-
font-size: 13px !important;
|
|
26821
|
+
font-size: calc(13px * var(--wm-font-scale)) !important;
|
|
26821
26822
|
font-weight: 400 !important;
|
|
26822
26823
|
color: var(--wm-muted);
|
|
26823
26824
|
}
|
|
@@ -26842,7 +26843,7 @@ var WelcomeModalView = class {
|
|
|
26842
26843
|
gap: 4px !important;
|
|
26843
26844
|
padding: 4px 8px !important;
|
|
26844
26845
|
min-width: 50px !important;
|
|
26845
|
-
font-size: 11px !important;
|
|
26846
|
+
font-size: calc(11px * var(--wm-font-scale)) !important;
|
|
26846
26847
|
font-weight: 600 !important;
|
|
26847
26848
|
color: var(--wm-muted);
|
|
26848
26849
|
background: rgba(0, 0, 0, 0.3);
|
|
@@ -26859,7 +26860,7 @@ var WelcomeModalView = class {
|
|
|
26859
26860
|
}
|
|
26860
26861
|
|
|
26861
26862
|
.myio-welcome-card-device-count .value {
|
|
26862
|
-
font-size: 10px !important;
|
|
26863
|
+
font-size: calc(10px * var(--wm-font-scale)) !important;
|
|
26863
26864
|
font-weight: 400 !important;
|
|
26864
26865
|
opacity: 0.85;
|
|
26865
26866
|
white-space: nowrap;
|
|
@@ -26872,7 +26873,7 @@ var WelcomeModalView = class {
|
|
|
26872
26873
|
}
|
|
26873
26874
|
|
|
26874
26875
|
.myio-welcome-card-device-count .icon {
|
|
26875
|
-
font-size: 10px !important;
|
|
26876
|
+
font-size: calc(10px * var(--wm-font-scale)) !important;
|
|
26876
26877
|
}
|
|
26877
26878
|
|
|
26878
26879
|
.myio-welcome-card-device-count.energy:hover {
|
|
@@ -27022,7 +27023,7 @@ var WelcomeModalView = class {
|
|
|
27022
27023
|
}
|
|
27023
27024
|
|
|
27024
27025
|
.myio-welcome-card-title {
|
|
27025
|
-
font-size: 16px !important;
|
|
27026
|
+
font-size: calc(16px * var(--wm-font-scale)) !important;
|
|
27026
27027
|
}
|
|
27027
27028
|
|
|
27028
27029
|
.myio-welcome-card-device-counts {
|
|
@@ -27032,16 +27033,16 @@ var WelcomeModalView = class {
|
|
|
27032
27033
|
|
|
27033
27034
|
.myio-welcome-card-device-count {
|
|
27034
27035
|
padding: 4px 8px;
|
|
27035
|
-
font-size: 12px;
|
|
27036
|
+
font-size: calc(12px * var(--wm-font-scale));
|
|
27036
27037
|
min-width: 52px !important;
|
|
27037
27038
|
}
|
|
27038
27039
|
|
|
27039
27040
|
.myio-welcome-card-device-count .icon {
|
|
27040
|
-
font-size: 11px !important;
|
|
27041
|
+
font-size: calc(11px * var(--wm-font-scale)) !important;
|
|
27041
27042
|
}
|
|
27042
27043
|
|
|
27043
27044
|
.myio-welcome-card-device-count .value {
|
|
27044
|
-
font-size: 11px !important;
|
|
27045
|
+
font-size: calc(11px * var(--wm-font-scale)) !important;
|
|
27045
27046
|
}
|
|
27046
27047
|
}
|
|
27047
27048
|
|
|
@@ -27110,7 +27111,7 @@ var WelcomeModalView = class {
|
|
|
27110
27111
|
}
|
|
27111
27112
|
|
|
27112
27113
|
.myio-welcome-card-title {
|
|
27113
|
-
font-size: 14px !important;
|
|
27114
|
+
font-size: calc(14px * var(--wm-font-scale)) !important;
|
|
27114
27115
|
}
|
|
27115
27116
|
|
|
27116
27117
|
.myio-welcome-card-device-counts {
|
|
@@ -27120,16 +27121,16 @@ var WelcomeModalView = class {
|
|
|
27120
27121
|
|
|
27121
27122
|
.myio-welcome-card-device-count {
|
|
27122
27123
|
padding: 3px 6px;
|
|
27123
|
-
font-size: 11px;
|
|
27124
|
+
font-size: calc(11px * var(--wm-font-scale));
|
|
27124
27125
|
min-width: 44px !important;
|
|
27125
27126
|
}
|
|
27126
27127
|
|
|
27127
27128
|
.myio-welcome-card-device-count .icon {
|
|
27128
|
-
font-size: 10px !important;
|
|
27129
|
+
font-size: calc(10px * var(--wm-font-scale)) !important;
|
|
27129
27130
|
}
|
|
27130
27131
|
|
|
27131
27132
|
.myio-welcome-card-device-count .value {
|
|
27132
|
-
font-size: 10px !important;
|
|
27133
|
+
font-size: calc(10px * var(--wm-font-scale)) !important;
|
|
27133
27134
|
}
|
|
27134
27135
|
|
|
27135
27136
|
.myio-welcome-card-arrow {
|
|
@@ -27698,16 +27699,33 @@ var WelcomeModalView = class {
|
|
|
27698
27699
|
const fontSizeRange = this.container.querySelector("#fontSizeRange");
|
|
27699
27700
|
const fontSizeValue = this.container.querySelector("#fontSizeValue");
|
|
27700
27701
|
if (fontSizeRange && fontSizeValue) {
|
|
27702
|
+
const applyFontScale = (scale) => {
|
|
27703
|
+
const cardTitles = this.container.querySelectorAll(".myio-welcome-card-title");
|
|
27704
|
+
cardTitles.forEach((el) => {
|
|
27705
|
+
el.style.setProperty("font-size", `${22 * scale}px`, "important");
|
|
27706
|
+
});
|
|
27707
|
+
const cardSubtitles = this.container.querySelectorAll(".myio-welcome-card-subtitle");
|
|
27708
|
+
cardSubtitles.forEach((el) => {
|
|
27709
|
+
el.style.setProperty("font-size", `${13 * scale}px`, "important");
|
|
27710
|
+
});
|
|
27711
|
+
const deviceCounts = this.container.querySelectorAll(".myio-welcome-card-device-count");
|
|
27712
|
+
deviceCounts.forEach((el) => {
|
|
27713
|
+
el.style.setProperty("font-size", `${11 * scale}px`, "important");
|
|
27714
|
+
});
|
|
27715
|
+
const countValues = this.container.querySelectorAll(".myio-welcome-card-device-count .value");
|
|
27716
|
+
countValues.forEach((el) => {
|
|
27717
|
+
el.style.setProperty("font-size", `${10 * scale}px`, "important");
|
|
27718
|
+
});
|
|
27719
|
+
const countIcons = this.container.querySelectorAll(".myio-welcome-card-device-count .icon");
|
|
27720
|
+
countIcons.forEach((el) => {
|
|
27721
|
+
el.style.setProperty("font-size", `${10 * scale}px`, "important");
|
|
27722
|
+
});
|
|
27723
|
+
};
|
|
27701
27724
|
fontSizeRange.addEventListener("input", () => {
|
|
27702
27725
|
const value = parseInt(fontSizeRange.value, 10);
|
|
27703
27726
|
fontSizeValue.textContent = `${value}%`;
|
|
27704
27727
|
const scale = value / 100;
|
|
27705
|
-
|
|
27706
|
-
const deviceCounts = this.container.querySelectorAll(".myio-welcome-card-device-counts");
|
|
27707
|
-
deviceCounts.forEach((el) => {
|
|
27708
|
-
el.style.transform = `scale(${scale})`;
|
|
27709
|
-
el.style.transformOrigin = "left center";
|
|
27710
|
-
});
|
|
27728
|
+
applyFontScale(scale);
|
|
27711
27729
|
});
|
|
27712
27730
|
}
|
|
27713
27731
|
this.bindTooltipEvents();
|
|
@@ -27930,12 +27948,13 @@ var WelcomeModalView = class {
|
|
|
27930
27948
|
temperatureDevices: temperatureItems.length
|
|
27931
27949
|
});
|
|
27932
27950
|
}
|
|
27951
|
+
const energyCategories = win.MyIOLibrary?.buildEquipmentCategoryDataForTooltip?.(energyItems) || [];
|
|
27933
27952
|
return {
|
|
27934
27953
|
energy: {
|
|
27935
27954
|
totalDevices: energyItems.length,
|
|
27936
27955
|
totalConsumption: energyTotal,
|
|
27937
27956
|
unit: "kWh",
|
|
27938
|
-
byCategory: [
|
|
27957
|
+
byCategory: energyCategories.length > 0 ? energyCategories : [
|
|
27939
27958
|
{
|
|
27940
27959
|
id: "equipamentos",
|
|
27941
27960
|
name: "Equipamentos",
|
|
@@ -27943,8 +27962,9 @@ var WelcomeModalView = class {
|
|
|
27943
27962
|
deviceCount: energyItems.filter(
|
|
27944
27963
|
(d) => d.deviceType !== "3F_MEDIDOR" || d.deviceProfile !== "3F_MEDIDOR"
|
|
27945
27964
|
).length,
|
|
27946
|
-
consumption: 0,
|
|
27947
|
-
|
|
27965
|
+
consumption: energyTotal * 0.3,
|
|
27966
|
+
// Fallback estimate
|
|
27967
|
+
percentage: 30
|
|
27948
27968
|
},
|
|
27949
27969
|
{
|
|
27950
27970
|
id: "lojas",
|
|
@@ -27953,42 +27973,49 @@ var WelcomeModalView = class {
|
|
|
27953
27973
|
deviceCount: energyItems.filter(
|
|
27954
27974
|
(d) => d.deviceType === "3F_MEDIDOR" && d.deviceProfile === "3F_MEDIDOR"
|
|
27955
27975
|
).length,
|
|
27956
|
-
consumption: 0,
|
|
27957
|
-
|
|
27976
|
+
consumption: energyTotal * 0.7,
|
|
27977
|
+
// Fallback estimate
|
|
27978
|
+
percentage: 70
|
|
27958
27979
|
}
|
|
27959
27980
|
],
|
|
27960
27981
|
byStatus: aggregateStatus(energyItems),
|
|
27961
27982
|
lastUpdated: now,
|
|
27962
27983
|
customerName: card.title
|
|
27963
27984
|
},
|
|
27964
|
-
water: {
|
|
27965
|
-
|
|
27966
|
-
|
|
27967
|
-
|
|
27968
|
-
|
|
27969
|
-
|
|
27970
|
-
|
|
27971
|
-
|
|
27972
|
-
|
|
27973
|
-
|
|
27974
|
-
|
|
27975
|
-
|
|
27976
|
-
|
|
27977
|
-
|
|
27978
|
-
|
|
27979
|
-
|
|
27980
|
-
|
|
27981
|
-
|
|
27982
|
-
|
|
27983
|
-
|
|
27984
|
-
|
|
27985
|
-
|
|
27986
|
-
|
|
27987
|
-
|
|
27988
|
-
|
|
27989
|
-
|
|
27990
|
-
|
|
27991
|
-
|
|
27985
|
+
water: (() => {
|
|
27986
|
+
const areaComumItems = waterItems.filter((d) => (d.deviceProfile || "").includes("AREA_COMUM"));
|
|
27987
|
+
const lojaItems = waterItems.filter(
|
|
27988
|
+
(d) => !(d.deviceProfile || "").includes("AREA_COMUM") && !(d.deviceProfile || "").includes("SHOPPING")
|
|
27989
|
+
);
|
|
27990
|
+
const areaComumConsumption = areaComumItems.reduce((sum, d) => sum + Number(d.value || d.pulses || 0), 0);
|
|
27991
|
+
const lojasConsumption = lojaItems.reduce((sum, d) => sum + Number(d.value || d.pulses || 0), 0);
|
|
27992
|
+
return {
|
|
27993
|
+
totalDevices: waterItems.length,
|
|
27994
|
+
totalConsumption: waterTotal,
|
|
27995
|
+
unit: "m\xB3",
|
|
27996
|
+
byCategory: [
|
|
27997
|
+
{
|
|
27998
|
+
id: "areaComum",
|
|
27999
|
+
name: "\xC1rea Comum",
|
|
28000
|
+
icon: "\u{1F3E2}",
|
|
28001
|
+
deviceCount: areaComumItems.length,
|
|
28002
|
+
consumption: areaComumConsumption,
|
|
28003
|
+
percentage: waterTotal > 0 ? areaComumConsumption / waterTotal * 100 : 0
|
|
28004
|
+
},
|
|
28005
|
+
{
|
|
28006
|
+
id: "lojas",
|
|
28007
|
+
name: "Lojas",
|
|
28008
|
+
icon: "\u{1F3EA}",
|
|
28009
|
+
deviceCount: lojaItems.length,
|
|
28010
|
+
consumption: lojasConsumption,
|
|
28011
|
+
percentage: waterTotal > 0 ? lojasConsumption / waterTotal * 100 : 0
|
|
28012
|
+
}
|
|
28013
|
+
],
|
|
28014
|
+
byStatus: aggregateStatus(waterItems),
|
|
28015
|
+
lastUpdated: now,
|
|
28016
|
+
customerName: card.title
|
|
28017
|
+
};
|
|
28018
|
+
})(),
|
|
27992
28019
|
temperature: {
|
|
27993
28020
|
devices: temperatureItems.map((d) => ({
|
|
27994
28021
|
name: d.label || d.name || "Sensor",
|
|
@@ -31484,6 +31511,12 @@ var ComparisonHandler = class {
|
|
|
31484
31511
|
if (!ingestionToken2) {
|
|
31485
31512
|
throw new Error("Ingestion token not available");
|
|
31486
31513
|
}
|
|
31514
|
+
const credentials = win.MyIOUtils?.getCredentials?.() || {};
|
|
31515
|
+
const clientId = credentials.clientId;
|
|
31516
|
+
const clientSecret = credentials.clientSecret;
|
|
31517
|
+
if (!clientId || !clientSecret) {
|
|
31518
|
+
this.log.warn("clientId/clientSecret not found in MyIOUtils.getCredentials()");
|
|
31519
|
+
}
|
|
31487
31520
|
const dataSources = entities.map((entity) => ({
|
|
31488
31521
|
type: "device",
|
|
31489
31522
|
id: entity.ingestionId || entity.id,
|
|
@@ -31508,6 +31541,8 @@ var ComparisonHandler = class {
|
|
|
31508
31541
|
startDate: start,
|
|
31509
31542
|
endDate: end,
|
|
31510
31543
|
granularity,
|
|
31544
|
+
clientId,
|
|
31545
|
+
clientSecret,
|
|
31511
31546
|
chartsBaseUrl: this.chartsBaseUrl,
|
|
31512
31547
|
dataApiHost: this.dataApiHost,
|
|
31513
31548
|
theme: this.params.theme ?? "dark",
|
|
@@ -62168,7 +62203,7 @@ var TelemetryGridController = class {
|
|
|
62168
62203
|
}
|
|
62169
62204
|
if (this.state.filters.selectedShoppingIds.length > 0) {
|
|
62170
62205
|
filtered = filtered.filter(
|
|
62171
|
-
(d) => this.state.filters.selectedShoppingIds.includes(d.customerId)
|
|
62206
|
+
(d) => this.state.filters.selectedShoppingIds.includes(d.customerId) || this.state.filters.selectedShoppingIds.includes(d.ingestionId)
|
|
62172
62207
|
);
|
|
62173
62208
|
}
|
|
62174
62209
|
if (this.state.filters.selectedDeviceIds && this.state.filters.selectedDeviceIds.size > 0) {
|