diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-10 14:46:09 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-10 15:29:24 +0200 |
| commit | 4ebe2f28ba940aabdaa1f57653fbe86a91582ebd (patch) | |
| tree | a54e3f9d3a44a0248ef1b17430eed9b5d47ff5de /opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitListComponent.js | |
| parent | 70630a40b54218ab8f8fd7a5e2dfb424d3dec378 (diff) | |
fix(web/ui): Fix UnitInfo popover
This change addresses an issue with the topology sidebar where hovering
a CPU or GPU would not present the correct information due to bug.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitListComponent.js')
| -rw-r--r-- | opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitListComponent.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitListComponent.js b/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitListComponent.js index daa3e7a7..75ab0ad7 100644 --- a/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitListComponent.js +++ b/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitListComponent.js @@ -20,9 +20,10 @@ import { } from '@patternfly/react-core' import { CubesIcon, InfoIcon, TrashIcon } from '@patternfly/react-icons' import { ProcessingUnit, StorageUnit } from '../../../../shapes' +import UnitType from './UnitType' function UnitInfo({ unit, unitType }) { - if (unitType === 'cpu' || unitType === 'gpu') { + if (unitType === 'cpus' || unitType === 'gpus') { return ( <DescriptionList> <DescriptionListGroup> @@ -60,7 +61,7 @@ function UnitInfo({ unit, unitType }) { } UnitInfo.propTypes = { - unitType: PropTypes.string.isRequired, + unitType: UnitType.isRequired, unit: PropTypes.oneOfType([ProcessingUnit, StorageUnit]).isRequired, } @@ -104,7 +105,7 @@ function UnitListComponent({ unitType, units, onDelete }) { } UnitListComponent.propTypes = { - unitType: PropTypes.string.isRequired, + unitType: UnitType.isRequired, units: PropTypes.arrayOf(PropTypes.oneOfType([ProcessingUnit, StorageUnit])).isRequired, onDelete: PropTypes.func, } |
