myio-js-library 0.1.152 → 0.1.154
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 +121 -40
- package/dist/index.js +121 -40
- package/dist/myio-js-library.umd.js +121 -46
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3950,14 +3950,30 @@ var CSS_STRING = `
|
|
|
3950
3950
|
--myio-card-bg: #fff;
|
|
3951
3951
|
--myio-card-border: #e9eef5;
|
|
3952
3952
|
|
|
3953
|
-
|
|
3954
|
-
--myio-chip-ok-
|
|
3955
|
-
--myio-chip-
|
|
3956
|
-
--myio-
|
|
3957
|
-
|
|
3958
|
-
|
|
3953
|
+
/* Status colors - Normal/Power On (blue) */
|
|
3954
|
+
--myio-chip-ok-bg: #dbeafe;
|
|
3955
|
+
--myio-chip-ok-fg: #1d4ed8;
|
|
3956
|
+
--myio-border-ok: rgba(59, 130, 246, 0.4);
|
|
3957
|
+
|
|
3958
|
+
/* Status colors - Standby (green) */
|
|
3959
|
+
--myio-chip-standby-bg: #dcfce7;
|
|
3960
|
+
--myio-chip-standby-fg: #15803d;
|
|
3961
|
+
--myio-border-standby: rgba(34, 197, 94, 0.4);
|
|
3962
|
+
|
|
3963
|
+
/* Status colors - Alert/Warning (yellow) */
|
|
3964
|
+
--myio-chip-alert-bg: #fef3c7;
|
|
3965
|
+
--myio-chip-alert-fg: #b45309;
|
|
3966
|
+
--myio-border-alert: rgba(245, 158, 11, 0.5);
|
|
3967
|
+
|
|
3968
|
+
/* Status colors - Failure (red) */
|
|
3969
|
+
--myio-chip-failure-bg: #fee2e2;
|
|
3970
|
+
--myio-chip-failure-fg: #b91c1c;
|
|
3971
|
+
--myio-border-failure: rgba(239, 68, 68, 0.5);
|
|
3972
|
+
|
|
3973
|
+
/* Status colors - Offline (gray) */
|
|
3959
3974
|
--myio-chip-offline-bg: #f1f5f9;
|
|
3960
3975
|
--myio-chip-offline-fg: #64748b;
|
|
3976
|
+
--myio-border-offline: rgba(100, 116, 139, 0.4);
|
|
3961
3977
|
|
|
3962
3978
|
--myio-text-1: #0f172a;
|
|
3963
3979
|
--myio-text-2: #4b5563;
|
|
@@ -4012,15 +4028,25 @@ var CSS_STRING = `
|
|
|
4012
4028
|
box-shadow: 0 16px 48px rgba(0, 224, 158, 0.3), 0 8px 16px rgba(0, 224, 158, 0.2);
|
|
4013
4029
|
}
|
|
4014
4030
|
|
|
4015
|
-
/*
|
|
4031
|
+
/* Card border states based on device status */
|
|
4032
|
+
.myio-ho-card.is-ok {
|
|
4033
|
+
border-color: var(--myio-border-ok);
|
|
4034
|
+
box-shadow: 0 0 0 2px var(--myio-border-ok), var(--myio-card-shadow);
|
|
4035
|
+
}
|
|
4036
|
+
|
|
4037
|
+
.myio-ho-card.is-standby {
|
|
4038
|
+
border-color: var(--myio-border-standby);
|
|
4039
|
+
box-shadow: 0 0 0 2px var(--myio-border-standby), var(--myio-card-shadow);
|
|
4040
|
+
}
|
|
4041
|
+
|
|
4016
4042
|
.myio-ho-card.is-alert {
|
|
4017
|
-
border-color: var(--myio-
|
|
4018
|
-
box-shadow: 0 0 0
|
|
4043
|
+
border-color: var(--myio-border-alert);
|
|
4044
|
+
box-shadow: 0 0 0 2px var(--myio-border-alert), var(--myio-card-shadow);
|
|
4019
4045
|
}
|
|
4020
4046
|
|
|
4021
4047
|
.myio-ho-card.is-failure {
|
|
4022
|
-
border-color: var(--myio-
|
|
4023
|
-
box-shadow: 0 0 0
|
|
4048
|
+
border-color: var(--myio-border-failure);
|
|
4049
|
+
box-shadow: 0 0 0 2px var(--myio-border-failure), var(--myio-card-shadow);
|
|
4024
4050
|
}
|
|
4025
4051
|
|
|
4026
4052
|
/* Header section */
|
|
@@ -4055,21 +4081,10 @@ var CSS_STRING = `
|
|
|
4055
4081
|
|
|
4056
4082
|
/* Adicione estas duas novas regras ao seu CSS_STRING */
|
|
4057
4083
|
|
|
4058
|
-
/* Estado Offline -
|
|
4084
|
+
/* Estado Offline - borda cinza */
|
|
4059
4085
|
.myio-ho-card.is-offline {
|
|
4060
|
-
border-color:
|
|
4061
|
-
box-shadow: 0 0 0
|
|
4062
|
-
}
|
|
4063
|
-
|
|
4064
|
-
/* Regras que j\xE1 existem (mantenha-as) */
|
|
4065
|
-
.myio-ho-card.is-alert {
|
|
4066
|
-
border-color: var(--myio-badge-border);
|
|
4067
|
-
box-shadow: 0 0 0 1px var(--myio-badge-border), var(--myio-card-shadow);
|
|
4068
|
-
}
|
|
4069
|
-
|
|
4070
|
-
.myio-ho-card.is-failure {
|
|
4071
|
-
border-color: var(--myio-badge-border-failure);
|
|
4072
|
-
box-shadow: 0 0 0 1px var(--myio-badge-border-failure), var(--myio-card-shadow);
|
|
4086
|
+
border-color: var(--myio-border-offline);
|
|
4087
|
+
box-shadow: 0 0 0 2px var(--myio-border-offline), var(--myio-card-shadow);
|
|
4073
4088
|
}
|
|
4074
4089
|
|
|
4075
4090
|
.myio-ho-card__name {
|
|
@@ -4441,6 +4456,11 @@ var CSS_STRING = `
|
|
|
4441
4456
|
color: var(--myio-chip-ok-fg);
|
|
4442
4457
|
}
|
|
4443
4458
|
|
|
4459
|
+
.chip--standby {
|
|
4460
|
+
background: var(--myio-chip-standby-bg);
|
|
4461
|
+
color: var(--myio-chip-standby-fg);
|
|
4462
|
+
}
|
|
4463
|
+
|
|
4444
4464
|
.chip--alert {
|
|
4445
4465
|
background: var(--myio-chip-alert-bg);
|
|
4446
4466
|
color: var(--myio-chip-alert-fg);
|
|
@@ -4452,8 +4472,41 @@ var CSS_STRING = `
|
|
|
4452
4472
|
}
|
|
4453
4473
|
|
|
4454
4474
|
.chip--offline {
|
|
4455
|
-
background:
|
|
4456
|
-
color:
|
|
4475
|
+
background: var(--myio-chip-offline-bg);
|
|
4476
|
+
color: var(--myio-chip-offline-fg);
|
|
4477
|
+
}
|
|
4478
|
+
|
|
4479
|
+
/* Status indicator dot for power metric */
|
|
4480
|
+
.status-dot {
|
|
4481
|
+
width: 8px;
|
|
4482
|
+
height: 8px;
|
|
4483
|
+
border-radius: 50%;
|
|
4484
|
+
flex-shrink: 0;
|
|
4485
|
+
background: var(--myio-chip-offline-fg);
|
|
4486
|
+
}
|
|
4487
|
+
|
|
4488
|
+
.status-dot.dot--ok {
|
|
4489
|
+
background: var(--myio-chip-ok-fg);
|
|
4490
|
+
}
|
|
4491
|
+
|
|
4492
|
+
.status-dot.dot--standby {
|
|
4493
|
+
background: var(--myio-chip-standby-fg);
|
|
4494
|
+
}
|
|
4495
|
+
|
|
4496
|
+
.status-dot.dot--alert {
|
|
4497
|
+
background: var(--myio-chip-alert-fg);
|
|
4498
|
+
}
|
|
4499
|
+
|
|
4500
|
+
.status-dot.dot--failure {
|
|
4501
|
+
background: var(--myio-chip-failure-fg);
|
|
4502
|
+
}
|
|
4503
|
+
|
|
4504
|
+
.status-dot.dot--offline {
|
|
4505
|
+
background: var(--myio-chip-offline-fg);
|
|
4506
|
+
}
|
|
4507
|
+
|
|
4508
|
+
.status-dot.dot--neutral {
|
|
4509
|
+
background: var(--myio-muted);
|
|
4457
4510
|
}
|
|
4458
4511
|
|
|
4459
4512
|
/* Primary metric */
|
|
@@ -4554,7 +4607,11 @@ var CSS_STRING = `
|
|
|
4554
4607
|
flex-direction: column;
|
|
4555
4608
|
align-items: center;
|
|
4556
4609
|
text-align: center;
|
|
4557
|
-
gap:
|
|
4610
|
+
gap: 2px;
|
|
4611
|
+
}
|
|
4612
|
+
|
|
4613
|
+
.myio-ho-card__footer .metric .status-dot {
|
|
4614
|
+
margin-bottom: 2px;
|
|
4558
4615
|
}
|
|
4559
4616
|
|
|
4560
4617
|
.myio-ho-card__footer .metric .ico {
|
|
@@ -4869,22 +4926,43 @@ function getStatusInfo(deviceStatus, i18n) {
|
|
|
4869
4926
|
function getCardStateClass(deviceStatus) {
|
|
4870
4927
|
switch (deviceStatus) {
|
|
4871
4928
|
case DeviceStatusType.POWER_ON:
|
|
4872
|
-
return "";
|
|
4873
|
-
|
|
4874
|
-
return "is-offline";
|
|
4875
|
-
case DeviceStatusType.WARNING:
|
|
4929
|
+
return "is-ok";
|
|
4930
|
+
// Blue border
|
|
4876
4931
|
case DeviceStatusType.STANDBY:
|
|
4932
|
+
return "is-standby";
|
|
4933
|
+
// Green border
|
|
4934
|
+
case DeviceStatusType.WARNING:
|
|
4877
4935
|
case DeviceStatusType.MAINTENANCE:
|
|
4878
4936
|
return "is-alert";
|
|
4937
|
+
// Yellow border
|
|
4879
4938
|
case DeviceStatusType.FAILURE:
|
|
4880
4939
|
case DeviceStatusType.POWER_OFF:
|
|
4881
4940
|
return "is-failure";
|
|
4941
|
+
// Red border
|
|
4942
|
+
case DeviceStatusType.NO_INFO:
|
|
4882
4943
|
case DeviceStatusType.NOT_INSTALLED:
|
|
4883
4944
|
return "is-offline";
|
|
4945
|
+
// Gray border
|
|
4884
4946
|
default:
|
|
4885
4947
|
return "";
|
|
4886
4948
|
}
|
|
4887
4949
|
}
|
|
4950
|
+
function getStatusDotClass(deviceStatus) {
|
|
4951
|
+
switch (deviceStatus) {
|
|
4952
|
+
case DeviceStatusType.POWER_ON:
|
|
4953
|
+
return "dot--ok";
|
|
4954
|
+
case DeviceStatusType.STANDBY:
|
|
4955
|
+
return "dot--standby";
|
|
4956
|
+
case DeviceStatusType.WARNING:
|
|
4957
|
+
case DeviceStatusType.MAINTENANCE:
|
|
4958
|
+
return "dot--alert";
|
|
4959
|
+
case DeviceStatusType.FAILURE:
|
|
4960
|
+
case DeviceStatusType.POWER_OFF:
|
|
4961
|
+
return "dot--failure";
|
|
4962
|
+
default:
|
|
4963
|
+
return "dot--offline";
|
|
4964
|
+
}
|
|
4965
|
+
}
|
|
4888
4966
|
function buildDOM(state) {
|
|
4889
4967
|
const { entityObject, i18n, enableSelection, enableDragDrop } = state;
|
|
4890
4968
|
const root = document.createElement("div");
|
|
@@ -5002,10 +5080,9 @@ function buildDOM(state) {
|
|
|
5002
5080
|
footer.className = "myio-ho-card__footer";
|
|
5003
5081
|
const opTimeMetric = document.createElement("div");
|
|
5004
5082
|
opTimeMetric.className = "metric";
|
|
5005
|
-
const
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
opTimeMetric.appendChild(opTimeIcon);
|
|
5083
|
+
const opTimeDot = document.createElement("span");
|
|
5084
|
+
opTimeDot.className = "status-dot dot--neutral";
|
|
5085
|
+
opTimeMetric.appendChild(opTimeDot);
|
|
5009
5086
|
const opTimeLabel = document.createElement("div");
|
|
5010
5087
|
opTimeLabel.className = "label";
|
|
5011
5088
|
opTimeLabel.textContent = i18n.operation_time;
|
|
@@ -5016,10 +5093,9 @@ function buildDOM(state) {
|
|
|
5016
5093
|
footer.appendChild(opTimeMetric);
|
|
5017
5094
|
const powerMetric = document.createElement("div");
|
|
5018
5095
|
powerMetric.className = "metric";
|
|
5019
|
-
const
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
powerMetric.appendChild(powerIcon);
|
|
5096
|
+
const statusDot = document.createElement("span");
|
|
5097
|
+
statusDot.className = "status-dot";
|
|
5098
|
+
powerMetric.appendChild(statusDot);
|
|
5023
5099
|
const powerLabel = document.createElement("div");
|
|
5024
5100
|
powerLabel.className = "label";
|
|
5025
5101
|
powerLabel.textContent = i18n.instantaneous_power || "Pot\xEAncia";
|
|
@@ -5087,6 +5163,11 @@ function paint(root, state) {
|
|
|
5087
5163
|
const powerFormatted = formatPower(instantPower);
|
|
5088
5164
|
powerVal.textContent = instantPower !== null ? `${powerFormatted.num} ${powerFormatted.unit}` : "-";
|
|
5089
5165
|
}
|
|
5166
|
+
const statusDot = root.querySelector(".myio-ho-card__footer .metric:nth-child(2) .status-dot");
|
|
5167
|
+
if (statusDot) {
|
|
5168
|
+
const dotClass = getStatusDotClass(entityObject.deviceStatus);
|
|
5169
|
+
statusDot.className = `status-dot ${dotClass}`;
|
|
5170
|
+
}
|
|
5090
5171
|
}
|
|
5091
5172
|
function bindEvents(root, state, callbacks) {
|
|
5092
5173
|
const { entityObject } = state;
|
package/dist/index.js
CHANGED
|
@@ -3842,14 +3842,30 @@ var CSS_STRING = `
|
|
|
3842
3842
|
--myio-card-bg: #fff;
|
|
3843
3843
|
--myio-card-border: #e9eef5;
|
|
3844
3844
|
|
|
3845
|
-
|
|
3846
|
-
--myio-chip-ok-
|
|
3847
|
-
--myio-chip-
|
|
3848
|
-
--myio-
|
|
3849
|
-
|
|
3850
|
-
|
|
3845
|
+
/* Status colors - Normal/Power On (blue) */
|
|
3846
|
+
--myio-chip-ok-bg: #dbeafe;
|
|
3847
|
+
--myio-chip-ok-fg: #1d4ed8;
|
|
3848
|
+
--myio-border-ok: rgba(59, 130, 246, 0.4);
|
|
3849
|
+
|
|
3850
|
+
/* Status colors - Standby (green) */
|
|
3851
|
+
--myio-chip-standby-bg: #dcfce7;
|
|
3852
|
+
--myio-chip-standby-fg: #15803d;
|
|
3853
|
+
--myio-border-standby: rgba(34, 197, 94, 0.4);
|
|
3854
|
+
|
|
3855
|
+
/* Status colors - Alert/Warning (yellow) */
|
|
3856
|
+
--myio-chip-alert-bg: #fef3c7;
|
|
3857
|
+
--myio-chip-alert-fg: #b45309;
|
|
3858
|
+
--myio-border-alert: rgba(245, 158, 11, 0.5);
|
|
3859
|
+
|
|
3860
|
+
/* Status colors - Failure (red) */
|
|
3861
|
+
--myio-chip-failure-bg: #fee2e2;
|
|
3862
|
+
--myio-chip-failure-fg: #b91c1c;
|
|
3863
|
+
--myio-border-failure: rgba(239, 68, 68, 0.5);
|
|
3864
|
+
|
|
3865
|
+
/* Status colors - Offline (gray) */
|
|
3851
3866
|
--myio-chip-offline-bg: #f1f5f9;
|
|
3852
3867
|
--myio-chip-offline-fg: #64748b;
|
|
3868
|
+
--myio-border-offline: rgba(100, 116, 139, 0.4);
|
|
3853
3869
|
|
|
3854
3870
|
--myio-text-1: #0f172a;
|
|
3855
3871
|
--myio-text-2: #4b5563;
|
|
@@ -3904,15 +3920,25 @@ var CSS_STRING = `
|
|
|
3904
3920
|
box-shadow: 0 16px 48px rgba(0, 224, 158, 0.3), 0 8px 16px rgba(0, 224, 158, 0.2);
|
|
3905
3921
|
}
|
|
3906
3922
|
|
|
3907
|
-
/*
|
|
3923
|
+
/* Card border states based on device status */
|
|
3924
|
+
.myio-ho-card.is-ok {
|
|
3925
|
+
border-color: var(--myio-border-ok);
|
|
3926
|
+
box-shadow: 0 0 0 2px var(--myio-border-ok), var(--myio-card-shadow);
|
|
3927
|
+
}
|
|
3928
|
+
|
|
3929
|
+
.myio-ho-card.is-standby {
|
|
3930
|
+
border-color: var(--myio-border-standby);
|
|
3931
|
+
box-shadow: 0 0 0 2px var(--myio-border-standby), var(--myio-card-shadow);
|
|
3932
|
+
}
|
|
3933
|
+
|
|
3908
3934
|
.myio-ho-card.is-alert {
|
|
3909
|
-
border-color: var(--myio-
|
|
3910
|
-
box-shadow: 0 0 0
|
|
3935
|
+
border-color: var(--myio-border-alert);
|
|
3936
|
+
box-shadow: 0 0 0 2px var(--myio-border-alert), var(--myio-card-shadow);
|
|
3911
3937
|
}
|
|
3912
3938
|
|
|
3913
3939
|
.myio-ho-card.is-failure {
|
|
3914
|
-
border-color: var(--myio-
|
|
3915
|
-
box-shadow: 0 0 0
|
|
3940
|
+
border-color: var(--myio-border-failure);
|
|
3941
|
+
box-shadow: 0 0 0 2px var(--myio-border-failure), var(--myio-card-shadow);
|
|
3916
3942
|
}
|
|
3917
3943
|
|
|
3918
3944
|
/* Header section */
|
|
@@ -3947,21 +3973,10 @@ var CSS_STRING = `
|
|
|
3947
3973
|
|
|
3948
3974
|
/* Adicione estas duas novas regras ao seu CSS_STRING */
|
|
3949
3975
|
|
|
3950
|
-
/* Estado Offline -
|
|
3976
|
+
/* Estado Offline - borda cinza */
|
|
3951
3977
|
.myio-ho-card.is-offline {
|
|
3952
|
-
border-color:
|
|
3953
|
-
box-shadow: 0 0 0
|
|
3954
|
-
}
|
|
3955
|
-
|
|
3956
|
-
/* Regras que j\xE1 existem (mantenha-as) */
|
|
3957
|
-
.myio-ho-card.is-alert {
|
|
3958
|
-
border-color: var(--myio-badge-border);
|
|
3959
|
-
box-shadow: 0 0 0 1px var(--myio-badge-border), var(--myio-card-shadow);
|
|
3960
|
-
}
|
|
3961
|
-
|
|
3962
|
-
.myio-ho-card.is-failure {
|
|
3963
|
-
border-color: var(--myio-badge-border-failure);
|
|
3964
|
-
box-shadow: 0 0 0 1px var(--myio-badge-border-failure), var(--myio-card-shadow);
|
|
3978
|
+
border-color: var(--myio-border-offline);
|
|
3979
|
+
box-shadow: 0 0 0 2px var(--myio-border-offline), var(--myio-card-shadow);
|
|
3965
3980
|
}
|
|
3966
3981
|
|
|
3967
3982
|
.myio-ho-card__name {
|
|
@@ -4333,6 +4348,11 @@ var CSS_STRING = `
|
|
|
4333
4348
|
color: var(--myio-chip-ok-fg);
|
|
4334
4349
|
}
|
|
4335
4350
|
|
|
4351
|
+
.chip--standby {
|
|
4352
|
+
background: var(--myio-chip-standby-bg);
|
|
4353
|
+
color: var(--myio-chip-standby-fg);
|
|
4354
|
+
}
|
|
4355
|
+
|
|
4336
4356
|
.chip--alert {
|
|
4337
4357
|
background: var(--myio-chip-alert-bg);
|
|
4338
4358
|
color: var(--myio-chip-alert-fg);
|
|
@@ -4344,8 +4364,41 @@ var CSS_STRING = `
|
|
|
4344
4364
|
}
|
|
4345
4365
|
|
|
4346
4366
|
.chip--offline {
|
|
4347
|
-
background:
|
|
4348
|
-
color:
|
|
4367
|
+
background: var(--myio-chip-offline-bg);
|
|
4368
|
+
color: var(--myio-chip-offline-fg);
|
|
4369
|
+
}
|
|
4370
|
+
|
|
4371
|
+
/* Status indicator dot for power metric */
|
|
4372
|
+
.status-dot {
|
|
4373
|
+
width: 8px;
|
|
4374
|
+
height: 8px;
|
|
4375
|
+
border-radius: 50%;
|
|
4376
|
+
flex-shrink: 0;
|
|
4377
|
+
background: var(--myio-chip-offline-fg);
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4380
|
+
.status-dot.dot--ok {
|
|
4381
|
+
background: var(--myio-chip-ok-fg);
|
|
4382
|
+
}
|
|
4383
|
+
|
|
4384
|
+
.status-dot.dot--standby {
|
|
4385
|
+
background: var(--myio-chip-standby-fg);
|
|
4386
|
+
}
|
|
4387
|
+
|
|
4388
|
+
.status-dot.dot--alert {
|
|
4389
|
+
background: var(--myio-chip-alert-fg);
|
|
4390
|
+
}
|
|
4391
|
+
|
|
4392
|
+
.status-dot.dot--failure {
|
|
4393
|
+
background: var(--myio-chip-failure-fg);
|
|
4394
|
+
}
|
|
4395
|
+
|
|
4396
|
+
.status-dot.dot--offline {
|
|
4397
|
+
background: var(--myio-chip-offline-fg);
|
|
4398
|
+
}
|
|
4399
|
+
|
|
4400
|
+
.status-dot.dot--neutral {
|
|
4401
|
+
background: var(--myio-muted);
|
|
4349
4402
|
}
|
|
4350
4403
|
|
|
4351
4404
|
/* Primary metric */
|
|
@@ -4446,7 +4499,11 @@ var CSS_STRING = `
|
|
|
4446
4499
|
flex-direction: column;
|
|
4447
4500
|
align-items: center;
|
|
4448
4501
|
text-align: center;
|
|
4449
|
-
gap:
|
|
4502
|
+
gap: 2px;
|
|
4503
|
+
}
|
|
4504
|
+
|
|
4505
|
+
.myio-ho-card__footer .metric .status-dot {
|
|
4506
|
+
margin-bottom: 2px;
|
|
4450
4507
|
}
|
|
4451
4508
|
|
|
4452
4509
|
.myio-ho-card__footer .metric .ico {
|
|
@@ -4761,22 +4818,43 @@ function getStatusInfo(deviceStatus, i18n) {
|
|
|
4761
4818
|
function getCardStateClass(deviceStatus) {
|
|
4762
4819
|
switch (deviceStatus) {
|
|
4763
4820
|
case DeviceStatusType.POWER_ON:
|
|
4764
|
-
return "";
|
|
4765
|
-
|
|
4766
|
-
return "is-offline";
|
|
4767
|
-
case DeviceStatusType.WARNING:
|
|
4821
|
+
return "is-ok";
|
|
4822
|
+
// Blue border
|
|
4768
4823
|
case DeviceStatusType.STANDBY:
|
|
4824
|
+
return "is-standby";
|
|
4825
|
+
// Green border
|
|
4826
|
+
case DeviceStatusType.WARNING:
|
|
4769
4827
|
case DeviceStatusType.MAINTENANCE:
|
|
4770
4828
|
return "is-alert";
|
|
4829
|
+
// Yellow border
|
|
4771
4830
|
case DeviceStatusType.FAILURE:
|
|
4772
4831
|
case DeviceStatusType.POWER_OFF:
|
|
4773
4832
|
return "is-failure";
|
|
4833
|
+
// Red border
|
|
4834
|
+
case DeviceStatusType.NO_INFO:
|
|
4774
4835
|
case DeviceStatusType.NOT_INSTALLED:
|
|
4775
4836
|
return "is-offline";
|
|
4837
|
+
// Gray border
|
|
4776
4838
|
default:
|
|
4777
4839
|
return "";
|
|
4778
4840
|
}
|
|
4779
4841
|
}
|
|
4842
|
+
function getStatusDotClass(deviceStatus) {
|
|
4843
|
+
switch (deviceStatus) {
|
|
4844
|
+
case DeviceStatusType.POWER_ON:
|
|
4845
|
+
return "dot--ok";
|
|
4846
|
+
case DeviceStatusType.STANDBY:
|
|
4847
|
+
return "dot--standby";
|
|
4848
|
+
case DeviceStatusType.WARNING:
|
|
4849
|
+
case DeviceStatusType.MAINTENANCE:
|
|
4850
|
+
return "dot--alert";
|
|
4851
|
+
case DeviceStatusType.FAILURE:
|
|
4852
|
+
case DeviceStatusType.POWER_OFF:
|
|
4853
|
+
return "dot--failure";
|
|
4854
|
+
default:
|
|
4855
|
+
return "dot--offline";
|
|
4856
|
+
}
|
|
4857
|
+
}
|
|
4780
4858
|
function buildDOM(state) {
|
|
4781
4859
|
const { entityObject, i18n, enableSelection, enableDragDrop } = state;
|
|
4782
4860
|
const root = document.createElement("div");
|
|
@@ -4894,10 +4972,9 @@ function buildDOM(state) {
|
|
|
4894
4972
|
footer.className = "myio-ho-card__footer";
|
|
4895
4973
|
const opTimeMetric = document.createElement("div");
|
|
4896
4974
|
opTimeMetric.className = "metric";
|
|
4897
|
-
const
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
opTimeMetric.appendChild(opTimeIcon);
|
|
4975
|
+
const opTimeDot = document.createElement("span");
|
|
4976
|
+
opTimeDot.className = "status-dot dot--neutral";
|
|
4977
|
+
opTimeMetric.appendChild(opTimeDot);
|
|
4901
4978
|
const opTimeLabel = document.createElement("div");
|
|
4902
4979
|
opTimeLabel.className = "label";
|
|
4903
4980
|
opTimeLabel.textContent = i18n.operation_time;
|
|
@@ -4908,10 +4985,9 @@ function buildDOM(state) {
|
|
|
4908
4985
|
footer.appendChild(opTimeMetric);
|
|
4909
4986
|
const powerMetric = document.createElement("div");
|
|
4910
4987
|
powerMetric.className = "metric";
|
|
4911
|
-
const
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
powerMetric.appendChild(powerIcon);
|
|
4988
|
+
const statusDot = document.createElement("span");
|
|
4989
|
+
statusDot.className = "status-dot";
|
|
4990
|
+
powerMetric.appendChild(statusDot);
|
|
4915
4991
|
const powerLabel = document.createElement("div");
|
|
4916
4992
|
powerLabel.className = "label";
|
|
4917
4993
|
powerLabel.textContent = i18n.instantaneous_power || "Pot\xEAncia";
|
|
@@ -4979,6 +5055,11 @@ function paint(root, state) {
|
|
|
4979
5055
|
const powerFormatted = formatPower(instantPower);
|
|
4980
5056
|
powerVal.textContent = instantPower !== null ? `${powerFormatted.num} ${powerFormatted.unit}` : "-";
|
|
4981
5057
|
}
|
|
5058
|
+
const statusDot = root.querySelector(".myio-ho-card__footer .metric:nth-child(2) .status-dot");
|
|
5059
|
+
if (statusDot) {
|
|
5060
|
+
const dotClass = getStatusDotClass(entityObject.deviceStatus);
|
|
5061
|
+
statusDot.className = `status-dot ${dotClass}`;
|
|
5062
|
+
}
|
|
4982
5063
|
}
|
|
4983
5064
|
function bindEvents(root, state, callbacks) {
|
|
4984
5065
|
const { entityObject } = state;
|