myio-js-library 0.1.152 → 0.1.153
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 +109 -35
- package/dist/index.js +109 -35
- package/dist/myio-js-library.umd.js +109 -35
- 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,37 @@ 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);
|
|
4457
4506
|
}
|
|
4458
4507
|
|
|
4459
4508
|
/* Primary metric */
|
|
@@ -4869,22 +4918,43 @@ function getStatusInfo(deviceStatus, i18n) {
|
|
|
4869
4918
|
function getCardStateClass(deviceStatus) {
|
|
4870
4919
|
switch (deviceStatus) {
|
|
4871
4920
|
case DeviceStatusType.POWER_ON:
|
|
4872
|
-
return "";
|
|
4873
|
-
|
|
4874
|
-
return "is-offline";
|
|
4875
|
-
case DeviceStatusType.WARNING:
|
|
4921
|
+
return "is-ok";
|
|
4922
|
+
// Blue border
|
|
4876
4923
|
case DeviceStatusType.STANDBY:
|
|
4924
|
+
return "is-standby";
|
|
4925
|
+
// Green border
|
|
4926
|
+
case DeviceStatusType.WARNING:
|
|
4877
4927
|
case DeviceStatusType.MAINTENANCE:
|
|
4878
4928
|
return "is-alert";
|
|
4929
|
+
// Yellow border
|
|
4879
4930
|
case DeviceStatusType.FAILURE:
|
|
4880
4931
|
case DeviceStatusType.POWER_OFF:
|
|
4881
4932
|
return "is-failure";
|
|
4933
|
+
// Red border
|
|
4934
|
+
case DeviceStatusType.NO_INFO:
|
|
4882
4935
|
case DeviceStatusType.NOT_INSTALLED:
|
|
4883
4936
|
return "is-offline";
|
|
4937
|
+
// Gray border
|
|
4884
4938
|
default:
|
|
4885
4939
|
return "";
|
|
4886
4940
|
}
|
|
4887
4941
|
}
|
|
4942
|
+
function getStatusDotClass(deviceStatus) {
|
|
4943
|
+
switch (deviceStatus) {
|
|
4944
|
+
case DeviceStatusType.POWER_ON:
|
|
4945
|
+
return "dot--ok";
|
|
4946
|
+
case DeviceStatusType.STANDBY:
|
|
4947
|
+
return "dot--standby";
|
|
4948
|
+
case DeviceStatusType.WARNING:
|
|
4949
|
+
case DeviceStatusType.MAINTENANCE:
|
|
4950
|
+
return "dot--alert";
|
|
4951
|
+
case DeviceStatusType.FAILURE:
|
|
4952
|
+
case DeviceStatusType.POWER_OFF:
|
|
4953
|
+
return "dot--failure";
|
|
4954
|
+
default:
|
|
4955
|
+
return "dot--offline";
|
|
4956
|
+
}
|
|
4957
|
+
}
|
|
4888
4958
|
function buildDOM(state) {
|
|
4889
4959
|
const { entityObject, i18n, enableSelection, enableDragDrop } = state;
|
|
4890
4960
|
const root = document.createElement("div");
|
|
@@ -5016,10 +5086,9 @@ function buildDOM(state) {
|
|
|
5016
5086
|
footer.appendChild(opTimeMetric);
|
|
5017
5087
|
const powerMetric = document.createElement("div");
|
|
5018
5088
|
powerMetric.className = "metric";
|
|
5019
|
-
const
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
powerMetric.appendChild(powerIcon);
|
|
5089
|
+
const statusDot = document.createElement("span");
|
|
5090
|
+
statusDot.className = "status-dot";
|
|
5091
|
+
powerMetric.appendChild(statusDot);
|
|
5023
5092
|
const powerLabel = document.createElement("div");
|
|
5024
5093
|
powerLabel.className = "label";
|
|
5025
5094
|
powerLabel.textContent = i18n.instantaneous_power || "Pot\xEAncia";
|
|
@@ -5087,6 +5156,11 @@ function paint(root, state) {
|
|
|
5087
5156
|
const powerFormatted = formatPower(instantPower);
|
|
5088
5157
|
powerVal.textContent = instantPower !== null ? `${powerFormatted.num} ${powerFormatted.unit}` : "-";
|
|
5089
5158
|
}
|
|
5159
|
+
const statusDot = root.querySelector(".myio-ho-card__footer .metric:nth-child(2) .status-dot");
|
|
5160
|
+
if (statusDot) {
|
|
5161
|
+
const dotClass = getStatusDotClass(entityObject.deviceStatus);
|
|
5162
|
+
statusDot.className = `status-dot ${dotClass}`;
|
|
5163
|
+
}
|
|
5090
5164
|
}
|
|
5091
5165
|
function bindEvents(root, state, callbacks) {
|
|
5092
5166
|
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,37 @@ 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);
|
|
4349
4398
|
}
|
|
4350
4399
|
|
|
4351
4400
|
/* Primary metric */
|
|
@@ -4761,22 +4810,43 @@ function getStatusInfo(deviceStatus, i18n) {
|
|
|
4761
4810
|
function getCardStateClass(deviceStatus) {
|
|
4762
4811
|
switch (deviceStatus) {
|
|
4763
4812
|
case DeviceStatusType.POWER_ON:
|
|
4764
|
-
return "";
|
|
4765
|
-
|
|
4766
|
-
return "is-offline";
|
|
4767
|
-
case DeviceStatusType.WARNING:
|
|
4813
|
+
return "is-ok";
|
|
4814
|
+
// Blue border
|
|
4768
4815
|
case DeviceStatusType.STANDBY:
|
|
4816
|
+
return "is-standby";
|
|
4817
|
+
// Green border
|
|
4818
|
+
case DeviceStatusType.WARNING:
|
|
4769
4819
|
case DeviceStatusType.MAINTENANCE:
|
|
4770
4820
|
return "is-alert";
|
|
4821
|
+
// Yellow border
|
|
4771
4822
|
case DeviceStatusType.FAILURE:
|
|
4772
4823
|
case DeviceStatusType.POWER_OFF:
|
|
4773
4824
|
return "is-failure";
|
|
4825
|
+
// Red border
|
|
4826
|
+
case DeviceStatusType.NO_INFO:
|
|
4774
4827
|
case DeviceStatusType.NOT_INSTALLED:
|
|
4775
4828
|
return "is-offline";
|
|
4829
|
+
// Gray border
|
|
4776
4830
|
default:
|
|
4777
4831
|
return "";
|
|
4778
4832
|
}
|
|
4779
4833
|
}
|
|
4834
|
+
function getStatusDotClass(deviceStatus) {
|
|
4835
|
+
switch (deviceStatus) {
|
|
4836
|
+
case DeviceStatusType.POWER_ON:
|
|
4837
|
+
return "dot--ok";
|
|
4838
|
+
case DeviceStatusType.STANDBY:
|
|
4839
|
+
return "dot--standby";
|
|
4840
|
+
case DeviceStatusType.WARNING:
|
|
4841
|
+
case DeviceStatusType.MAINTENANCE:
|
|
4842
|
+
return "dot--alert";
|
|
4843
|
+
case DeviceStatusType.FAILURE:
|
|
4844
|
+
case DeviceStatusType.POWER_OFF:
|
|
4845
|
+
return "dot--failure";
|
|
4846
|
+
default:
|
|
4847
|
+
return "dot--offline";
|
|
4848
|
+
}
|
|
4849
|
+
}
|
|
4780
4850
|
function buildDOM(state) {
|
|
4781
4851
|
const { entityObject, i18n, enableSelection, enableDragDrop } = state;
|
|
4782
4852
|
const root = document.createElement("div");
|
|
@@ -4908,10 +4978,9 @@ function buildDOM(state) {
|
|
|
4908
4978
|
footer.appendChild(opTimeMetric);
|
|
4909
4979
|
const powerMetric = document.createElement("div");
|
|
4910
4980
|
powerMetric.className = "metric";
|
|
4911
|
-
const
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
powerMetric.appendChild(powerIcon);
|
|
4981
|
+
const statusDot = document.createElement("span");
|
|
4982
|
+
statusDot.className = "status-dot";
|
|
4983
|
+
powerMetric.appendChild(statusDot);
|
|
4915
4984
|
const powerLabel = document.createElement("div");
|
|
4916
4985
|
powerLabel.className = "label";
|
|
4917
4986
|
powerLabel.textContent = i18n.instantaneous_power || "Pot\xEAncia";
|
|
@@ -4979,6 +5048,11 @@ function paint(root, state) {
|
|
|
4979
5048
|
const powerFormatted = formatPower(instantPower);
|
|
4980
5049
|
powerVal.textContent = instantPower !== null ? `${powerFormatted.num} ${powerFormatted.unit}` : "-";
|
|
4981
5050
|
}
|
|
5051
|
+
const statusDot = root.querySelector(".myio-ho-card__footer .metric:nth-child(2) .status-dot");
|
|
5052
|
+
if (statusDot) {
|
|
5053
|
+
const dotClass = getStatusDotClass(entityObject.deviceStatus);
|
|
5054
|
+
statusDot.className = `status-dot ${dotClass}`;
|
|
5055
|
+
}
|
|
4982
5056
|
}
|
|
4983
5057
|
function bindEvents(root, state, callbacks) {
|
|
4984
5058
|
const { entityObject } = state;
|
|
@@ -3848,14 +3848,30 @@
|
|
|
3848
3848
|
--myio-card-bg: #fff;
|
|
3849
3849
|
--myio-card-border: #e9eef5;
|
|
3850
3850
|
|
|
3851
|
-
|
|
3852
|
-
--myio-chip-ok-
|
|
3853
|
-
--myio-chip-
|
|
3854
|
-
--myio-
|
|
3855
|
-
|
|
3856
|
-
|
|
3851
|
+
/* Status colors - Normal/Power On (blue) */
|
|
3852
|
+
--myio-chip-ok-bg: #dbeafe;
|
|
3853
|
+
--myio-chip-ok-fg: #1d4ed8;
|
|
3854
|
+
--myio-border-ok: rgba(59, 130, 246, 0.4);
|
|
3855
|
+
|
|
3856
|
+
/* Status colors - Standby (green) */
|
|
3857
|
+
--myio-chip-standby-bg: #dcfce7;
|
|
3858
|
+
--myio-chip-standby-fg: #15803d;
|
|
3859
|
+
--myio-border-standby: rgba(34, 197, 94, 0.4);
|
|
3860
|
+
|
|
3861
|
+
/* Status colors - Alert/Warning (yellow) */
|
|
3862
|
+
--myio-chip-alert-bg: #fef3c7;
|
|
3863
|
+
--myio-chip-alert-fg: #b45309;
|
|
3864
|
+
--myio-border-alert: rgba(245, 158, 11, 0.5);
|
|
3865
|
+
|
|
3866
|
+
/* Status colors - Failure (red) */
|
|
3867
|
+
--myio-chip-failure-bg: #fee2e2;
|
|
3868
|
+
--myio-chip-failure-fg: #b91c1c;
|
|
3869
|
+
--myio-border-failure: rgba(239, 68, 68, 0.5);
|
|
3870
|
+
|
|
3871
|
+
/* Status colors - Offline (gray) */
|
|
3857
3872
|
--myio-chip-offline-bg: #f1f5f9;
|
|
3858
3873
|
--myio-chip-offline-fg: #64748b;
|
|
3874
|
+
--myio-border-offline: rgba(100, 116, 139, 0.4);
|
|
3859
3875
|
|
|
3860
3876
|
--myio-text-1: #0f172a;
|
|
3861
3877
|
--myio-text-2: #4b5563;
|
|
@@ -3910,15 +3926,25 @@
|
|
|
3910
3926
|
box-shadow: 0 16px 48px rgba(0, 224, 158, 0.3), 0 8px 16px rgba(0, 224, 158, 0.2);
|
|
3911
3927
|
}
|
|
3912
3928
|
|
|
3913
|
-
/*
|
|
3929
|
+
/* Card border states based on device status */
|
|
3930
|
+
.myio-ho-card.is-ok {
|
|
3931
|
+
border-color: var(--myio-border-ok);
|
|
3932
|
+
box-shadow: 0 0 0 2px var(--myio-border-ok), var(--myio-card-shadow);
|
|
3933
|
+
}
|
|
3934
|
+
|
|
3935
|
+
.myio-ho-card.is-standby {
|
|
3936
|
+
border-color: var(--myio-border-standby);
|
|
3937
|
+
box-shadow: 0 0 0 2px var(--myio-border-standby), var(--myio-card-shadow);
|
|
3938
|
+
}
|
|
3939
|
+
|
|
3914
3940
|
.myio-ho-card.is-alert {
|
|
3915
|
-
border-color: var(--myio-
|
|
3916
|
-
box-shadow: 0 0 0
|
|
3941
|
+
border-color: var(--myio-border-alert);
|
|
3942
|
+
box-shadow: 0 0 0 2px var(--myio-border-alert), var(--myio-card-shadow);
|
|
3917
3943
|
}
|
|
3918
3944
|
|
|
3919
3945
|
.myio-ho-card.is-failure {
|
|
3920
|
-
border-color: var(--myio-
|
|
3921
|
-
box-shadow: 0 0 0
|
|
3946
|
+
border-color: var(--myio-border-failure);
|
|
3947
|
+
box-shadow: 0 0 0 2px var(--myio-border-failure), var(--myio-card-shadow);
|
|
3922
3948
|
}
|
|
3923
3949
|
|
|
3924
3950
|
/* Header section */
|
|
@@ -3953,21 +3979,10 @@
|
|
|
3953
3979
|
|
|
3954
3980
|
/* Adicione estas duas novas regras ao seu CSS_STRING */
|
|
3955
3981
|
|
|
3956
|
-
/* Estado Offline -
|
|
3982
|
+
/* Estado Offline - borda cinza */
|
|
3957
3983
|
.myio-ho-card.is-offline {
|
|
3958
|
-
border-color:
|
|
3959
|
-
box-shadow: 0 0 0
|
|
3960
|
-
}
|
|
3961
|
-
|
|
3962
|
-
/* Regras que j\xE1 existem (mantenha-as) */
|
|
3963
|
-
.myio-ho-card.is-alert {
|
|
3964
|
-
border-color: var(--myio-badge-border);
|
|
3965
|
-
box-shadow: 0 0 0 1px var(--myio-badge-border), var(--myio-card-shadow);
|
|
3966
|
-
}
|
|
3967
|
-
|
|
3968
|
-
.myio-ho-card.is-failure {
|
|
3969
|
-
border-color: var(--myio-badge-border-failure);
|
|
3970
|
-
box-shadow: 0 0 0 1px var(--myio-badge-border-failure), var(--myio-card-shadow);
|
|
3984
|
+
border-color: var(--myio-border-offline);
|
|
3985
|
+
box-shadow: 0 0 0 2px var(--myio-border-offline), var(--myio-card-shadow);
|
|
3971
3986
|
}
|
|
3972
3987
|
|
|
3973
3988
|
.myio-ho-card__name {
|
|
@@ -4339,6 +4354,11 @@
|
|
|
4339
4354
|
color: var(--myio-chip-ok-fg);
|
|
4340
4355
|
}
|
|
4341
4356
|
|
|
4357
|
+
.chip--standby {
|
|
4358
|
+
background: var(--myio-chip-standby-bg);
|
|
4359
|
+
color: var(--myio-chip-standby-fg);
|
|
4360
|
+
}
|
|
4361
|
+
|
|
4342
4362
|
.chip--alert {
|
|
4343
4363
|
background: var(--myio-chip-alert-bg);
|
|
4344
4364
|
color: var(--myio-chip-alert-fg);
|
|
@@ -4350,8 +4370,37 @@
|
|
|
4350
4370
|
}
|
|
4351
4371
|
|
|
4352
4372
|
.chip--offline {
|
|
4353
|
-
background:
|
|
4354
|
-
color:
|
|
4373
|
+
background: var(--myio-chip-offline-bg);
|
|
4374
|
+
color: var(--myio-chip-offline-fg);
|
|
4375
|
+
}
|
|
4376
|
+
|
|
4377
|
+
/* Status indicator dot for power metric */
|
|
4378
|
+
.status-dot {
|
|
4379
|
+
width: 8px;
|
|
4380
|
+
height: 8px;
|
|
4381
|
+
border-radius: 50%;
|
|
4382
|
+
flex-shrink: 0;
|
|
4383
|
+
background: var(--myio-chip-offline-fg);
|
|
4384
|
+
}
|
|
4385
|
+
|
|
4386
|
+
.status-dot.dot--ok {
|
|
4387
|
+
background: var(--myio-chip-ok-fg);
|
|
4388
|
+
}
|
|
4389
|
+
|
|
4390
|
+
.status-dot.dot--standby {
|
|
4391
|
+
background: var(--myio-chip-standby-fg);
|
|
4392
|
+
}
|
|
4393
|
+
|
|
4394
|
+
.status-dot.dot--alert {
|
|
4395
|
+
background: var(--myio-chip-alert-fg);
|
|
4396
|
+
}
|
|
4397
|
+
|
|
4398
|
+
.status-dot.dot--failure {
|
|
4399
|
+
background: var(--myio-chip-failure-fg);
|
|
4400
|
+
}
|
|
4401
|
+
|
|
4402
|
+
.status-dot.dot--offline {
|
|
4403
|
+
background: var(--myio-chip-offline-fg);
|
|
4355
4404
|
}
|
|
4356
4405
|
|
|
4357
4406
|
/* Primary metric */
|
|
@@ -4759,22 +4808,43 @@
|
|
|
4759
4808
|
function getCardStateClass(deviceStatus) {
|
|
4760
4809
|
switch (deviceStatus) {
|
|
4761
4810
|
case DeviceStatusType.POWER_ON:
|
|
4762
|
-
return "";
|
|
4763
|
-
|
|
4764
|
-
return "is-offline";
|
|
4765
|
-
case DeviceStatusType.WARNING:
|
|
4811
|
+
return "is-ok";
|
|
4812
|
+
// Blue border
|
|
4766
4813
|
case DeviceStatusType.STANDBY:
|
|
4814
|
+
return "is-standby";
|
|
4815
|
+
// Green border
|
|
4816
|
+
case DeviceStatusType.WARNING:
|
|
4767
4817
|
case DeviceStatusType.MAINTENANCE:
|
|
4768
4818
|
return "is-alert";
|
|
4819
|
+
// Yellow border
|
|
4769
4820
|
case DeviceStatusType.FAILURE:
|
|
4770
4821
|
case DeviceStatusType.POWER_OFF:
|
|
4771
4822
|
return "is-failure";
|
|
4823
|
+
// Red border
|
|
4824
|
+
case DeviceStatusType.NO_INFO:
|
|
4772
4825
|
case DeviceStatusType.NOT_INSTALLED:
|
|
4773
4826
|
return "is-offline";
|
|
4827
|
+
// Gray border
|
|
4774
4828
|
default:
|
|
4775
4829
|
return "";
|
|
4776
4830
|
}
|
|
4777
4831
|
}
|
|
4832
|
+
function getStatusDotClass(deviceStatus) {
|
|
4833
|
+
switch (deviceStatus) {
|
|
4834
|
+
case DeviceStatusType.POWER_ON:
|
|
4835
|
+
return "dot--ok";
|
|
4836
|
+
case DeviceStatusType.STANDBY:
|
|
4837
|
+
return "dot--standby";
|
|
4838
|
+
case DeviceStatusType.WARNING:
|
|
4839
|
+
case DeviceStatusType.MAINTENANCE:
|
|
4840
|
+
return "dot--alert";
|
|
4841
|
+
case DeviceStatusType.FAILURE:
|
|
4842
|
+
case DeviceStatusType.POWER_OFF:
|
|
4843
|
+
return "dot--failure";
|
|
4844
|
+
default:
|
|
4845
|
+
return "dot--offline";
|
|
4846
|
+
}
|
|
4847
|
+
}
|
|
4778
4848
|
function buildDOM(state) {
|
|
4779
4849
|
const { entityObject, i18n, enableSelection, enableDragDrop } = state;
|
|
4780
4850
|
const root = document.createElement("div");
|
|
@@ -4906,10 +4976,9 @@
|
|
|
4906
4976
|
footer.appendChild(opTimeMetric);
|
|
4907
4977
|
const powerMetric = document.createElement("div");
|
|
4908
4978
|
powerMetric.className = "metric";
|
|
4909
|
-
const
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
powerMetric.appendChild(powerIcon);
|
|
4979
|
+
const statusDot = document.createElement("span");
|
|
4980
|
+
statusDot.className = "status-dot";
|
|
4981
|
+
powerMetric.appendChild(statusDot);
|
|
4913
4982
|
const powerLabel = document.createElement("div");
|
|
4914
4983
|
powerLabel.className = "label";
|
|
4915
4984
|
powerLabel.textContent = i18n.instantaneous_power || "Pot\xEAncia";
|
|
@@ -4977,6 +5046,11 @@
|
|
|
4977
5046
|
const powerFormatted = formatPower(instantPower);
|
|
4978
5047
|
powerVal.textContent = instantPower !== null ? `${powerFormatted.num} ${powerFormatted.unit}` : "-";
|
|
4979
5048
|
}
|
|
5049
|
+
const statusDot = root.querySelector(".myio-ho-card__footer .metric:nth-child(2) .status-dot");
|
|
5050
|
+
if (statusDot) {
|
|
5051
|
+
const dotClass = getStatusDotClass(entityObject.deviceStatus);
|
|
5052
|
+
statusDot.className = `status-dot ${dotClass}`;
|
|
5053
|
+
}
|
|
4980
5054
|
}
|
|
4981
5055
|
function bindEvents(root, state, callbacks) {
|
|
4982
5056
|
const { entityObject } = state;
|