@flightctl/ui-components 0.6.0-rc2 → 0.6.0
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/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js +3 -3
- package/dist/src/components/Status/DeviceResourceStatus.d.ts.map +1 -1
- package/dist/src/components/Status/DeviceResourceStatus.js +4 -4
- package/dist/src/components/Status/DeviceResourceStatus.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx +3 -3
- package/src/components/Status/DeviceResourceStatus.tsx +7 -5
package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js
CHANGED
|
@@ -16,15 +16,15 @@ const SystemResourcesContent = ({ device }) => {
|
|
|
16
16
|
React.createElement(react_core_1.DescriptionListGroup, null,
|
|
17
17
|
React.createElement(react_core_1.DescriptionListTerm, null, t('CPU pressure')),
|
|
18
18
|
React.createElement(react_core_1.DescriptionListDescription, null,
|
|
19
|
-
React.createElement(DeviceResourceStatus_1.default, { device: device, monitorType: "
|
|
19
|
+
React.createElement(DeviceResourceStatus_1.default, { device: device, monitorType: "cpu" }))),
|
|
20
20
|
React.createElement(react_core_1.DescriptionListGroup, null,
|
|
21
21
|
React.createElement(react_core_1.DescriptionListTerm, null, t('Disk pressure')),
|
|
22
22
|
React.createElement(react_core_1.DescriptionListDescription, null,
|
|
23
|
-
React.createElement(DeviceResourceStatus_1.default, { device: device, monitorType: "
|
|
23
|
+
React.createElement(DeviceResourceStatus_1.default, { device: device, monitorType: "disk" }))),
|
|
24
24
|
React.createElement(react_core_1.DescriptionListGroup, null,
|
|
25
25
|
React.createElement(react_core_1.DescriptionListTerm, null, t('Memory pressure')),
|
|
26
26
|
React.createElement(react_core_1.DescriptionListDescription, null,
|
|
27
|
-
React.createElement(DeviceResourceStatus_1.default, { device: device, monitorType: "
|
|
27
|
+
React.createElement(DeviceResourceStatus_1.default, { device: device, monitorType: "memory" })))))));
|
|
28
28
|
};
|
|
29
29
|
exports.default = SystemResourcesContent;
|
|
30
30
|
//# sourceMappingURL=SystemResourcesContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceResourceStatus.d.ts","sourceRoot":"","sources":["../../../../src/components/Status/DeviceResourceStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,MAAM,EACN,oBAAoB,EAIrB,MAAM,kBAAkB,CAAC;AAM1B,KAAK,WAAW,GAAG,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"DeviceResourceStatus.d.ts","sourceRoot":"","sources":["../../../../src/components/Status/DeviceResourceStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,MAAM,EACN,oBAAoB,EAIrB,MAAM,kBAAkB,CAAC;AAM1B,KAAK,WAAW,GAAG,MAAM,oBAAoB,CAAC;AA8C9C,QAAA,MAAM,oBAAoB;YAAuC,MAAM,GAAG,SAAS;iBAAe,WAAW;uBAkD5G,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -7,11 +7,11 @@ const useTranslation_1 = require("../../hooks/useTranslation");
|
|
|
7
7
|
const StatusDisplay_1 = require("./StatusDisplay");
|
|
8
8
|
const getMonitorTypeLabel = (monitorType, t) => {
|
|
9
9
|
switch (monitorType) {
|
|
10
|
-
case '
|
|
10
|
+
case 'cpu':
|
|
11
11
|
return t('CPU');
|
|
12
|
-
case '
|
|
12
|
+
case 'memory':
|
|
13
13
|
return t('Memory');
|
|
14
|
-
case '
|
|
14
|
+
case 'disk':
|
|
15
15
|
return t('Disk');
|
|
16
16
|
}
|
|
17
17
|
};
|
|
@@ -23,7 +23,7 @@ const getTriggeredResourceAlert = (resourcesInfo, monitorType, monitorStatus) =>
|
|
|
23
23
|
].includes(monitorStatus)) {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
-
const monitorDetails = resourcesInfo.find((item) => item.monitorType === monitorType && item.alertRules.length > 0);
|
|
26
|
+
const monitorDetails = resourcesInfo.find((item) => item.monitorType.toLowerCase() === monitorType.toLowerCase() && item.alertRules.length > 0);
|
|
27
27
|
if (!monitorDetails) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceResourceStatus.js","sourceRoot":"","sources":["../../../../src/components/Status/DeviceResourceStatus.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAG/B,4CAM0B;AAE1B,+DAA4D;AAE5D,mDAAuD;AAIvD,MAAM,mBAAmB,GAAG,CAAC,WAAwB,EAAE,CAAY,EAAE,EAAE;IACrE,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,KAAK;YACR,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;QACrB,KAAK,MAAM;YACT,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAChC,aAAyC,EACzC,WAAwB,EACxB,aAAwC,EACxC,EAAE;IACF,IACE,CAAC,aAAa;QACd;YACE,gCAAwB,CAAC,2BAA2B;YACpD,gCAAwB,CAAC,2BAA2B;SACrD,CAAC,QAAQ,CAAC,aAAa,CAAC,EACzB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,cAAc,GAAG,aAAa,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"DeviceResourceStatus.js","sourceRoot":"","sources":["../../../../src/components/Status/DeviceResourceStatus.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAG/B,4CAM0B;AAE1B,+DAA4D;AAE5D,mDAAuD;AAIvD,MAAM,mBAAmB,GAAG,CAAC,WAA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CAAwB,CAAC,4BAA4B,CAAC;QAC3D,KAAK,gCAAwB,CAAC,yBAAyB;YACrD,KAAK,GAAG,QAAQ,CAAC;YACjB,MAAM;QACR,KAAK,gCAAwB,CAAC,2BAA2B,CAAC;QAC1D,KAAK,SAAS;YACZ,KAAK,GAAG,SAAS,CAAC;YAClB,MAAM;IACV,CAAC;IAED,OAAO,CACL,oBAAC,oCAAoB,IACnB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,WAAW,GACpC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,oBAAoB,CAAC"}
|
package/package.json
CHANGED
package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx
CHANGED
|
@@ -23,19 +23,19 @@ const SystemResourcesContent = ({ device }: { device: Required<Device> }) => {
|
|
|
23
23
|
<DescriptionListGroup>
|
|
24
24
|
<DescriptionListTerm>{t('CPU pressure')}</DescriptionListTerm>
|
|
25
25
|
<DescriptionListDescription>
|
|
26
|
-
<DeviceResourceStatus device={device} monitorType="
|
|
26
|
+
<DeviceResourceStatus device={device} monitorType="cpu" />
|
|
27
27
|
</DescriptionListDescription>
|
|
28
28
|
</DescriptionListGroup>
|
|
29
29
|
<DescriptionListGroup>
|
|
30
30
|
<DescriptionListTerm>{t('Disk pressure')}</DescriptionListTerm>
|
|
31
31
|
<DescriptionListDescription>
|
|
32
|
-
<DeviceResourceStatus device={device} monitorType="
|
|
32
|
+
<DeviceResourceStatus device={device} monitorType="disk" />
|
|
33
33
|
</DescriptionListDescription>
|
|
34
34
|
</DescriptionListGroup>
|
|
35
35
|
<DescriptionListGroup>
|
|
36
36
|
<DescriptionListTerm>{t('Memory pressure')}</DescriptionListTerm>
|
|
37
37
|
<DescriptionListDescription>
|
|
38
|
-
<DeviceResourceStatus device={device} monitorType="
|
|
38
|
+
<DeviceResourceStatus device={device} monitorType="memory" />
|
|
39
39
|
</DescriptionListDescription>
|
|
40
40
|
</DescriptionListGroup>
|
|
41
41
|
</FlightControlDescriptionList>
|
|
@@ -13,15 +13,15 @@ import { useTranslation } from '../../hooks/useTranslation';
|
|
|
13
13
|
import { StatusLevel } from '../../utils/status/common';
|
|
14
14
|
import { StatusDisplayContent } from './StatusDisplay';
|
|
15
15
|
|
|
16
|
-
type MonitorType = keyof DeviceResourceStatus; /*
|
|
16
|
+
type MonitorType = keyof DeviceResourceStatus; /* cpu / disk / memory */
|
|
17
17
|
|
|
18
18
|
const getMonitorTypeLabel = (monitorType: MonitorType, t: TFunction) => {
|
|
19
19
|
switch (monitorType) {
|
|
20
|
-
case '
|
|
20
|
+
case 'cpu':
|
|
21
21
|
return t('CPU');
|
|
22
|
-
case '
|
|
22
|
+
case 'memory':
|
|
23
23
|
return t('Memory');
|
|
24
|
-
case '
|
|
24
|
+
case 'disk':
|
|
25
25
|
return t('Disk');
|
|
26
26
|
}
|
|
27
27
|
};
|
|
@@ -40,7 +40,9 @@ const getTriggeredResourceAlert = (
|
|
|
40
40
|
) {
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
|
-
const monitorDetails = resourcesInfo.find(
|
|
43
|
+
const monitorDetails = resourcesInfo.find(
|
|
44
|
+
(item) => item.monitorType.toLowerCase() === monitorType.toLowerCase() && item.alertRules.length > 0,
|
|
45
|
+
);
|
|
44
46
|
if (!monitorDetails) {
|
|
45
47
|
return null;
|
|
46
48
|
}
|