summaryrefslogtreecommitdiff
path: root/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-07-01 13:33:31 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:47:17 +0200
commitde8f12d74faef5fa3f9e38d1340948cab2d06ea3 (patch)
tree678bf1af3e5fa2334f0df43388d45294785bbf1e /frontend/src/components/app/sidebars/topology/machine/UnitComponent.js
parent44236756c4cf689806dc17c6950a2cff3e9227bf (diff)
Manually generate IDs
Diffstat (limited to 'frontend/src/components/app/sidebars/topology/machine/UnitComponent.js')
-rw-r--r--frontend/src/components/app/sidebars/topology/machine/UnitComponent.js132
1 files changed, 66 insertions, 66 deletions
diff --git a/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js b/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js
index 7c27043d..93ac1cdd 100644
--- a/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js
+++ b/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js
@@ -1,78 +1,78 @@
-import React from "react";
-import jQuery from "../../../../../util/jquery";
+import React from 'react'
+import jQuery from '../../../../../util/jquery'
class UnitComponent extends React.Component {
- componentDidMount() {
- jQuery(".unit-info-popover").popover({
- trigger: "focus"
- });
- }
-
- render() {
- let unitInfo;
- if (this.props.unitType === "cpu" || this.props.unitType === "gpu") {
- unitInfo =
- "<strong>Clockrate:</strong> <code>" +
- this.props.unit.clockRateMhz +
- " MHz</code><br/>" +
- "<strong>Num. Cores:</strong> <code>" +
- this.props.unit.numberOfCores +
- "</code><br/>" +
- "<strong>Energy Cons.:</strong> <code>" +
- this.props.unit.energyConsumptionW +
- " W</code>";
- } else if (
- this.props.unitType === "memory" ||
- this.props.unitType === "storage"
- ) {
- unitInfo =
- "<strong>Speed:</strong> <code>" +
- this.props.unit.speedMbPerS +
- " Mb/s</code><br/>" +
- "<strong>Size:</strong> <code>" +
- this.props.unit.sizeMb +
- " MB</code><br/>" +
- "<strong>Energy Cons.:</strong> <code> " +
- this.props.unit.energyConsumptionW +
- " W</code>";
+ componentDidMount() {
+ jQuery('.unit-info-popover').popover({
+ trigger: 'focus',
+ })
}
- return (
- <li className="d-flex list-group-item justify-content-between align-items-center">
- <span style={{ maxWidth: "60%" }}>
+ render() {
+ let unitInfo
+ if (this.props.unitType === 'cpu' || this.props.unitType === 'gpu') {
+ unitInfo =
+ '<strong>Clockrate:</strong> <code>' +
+ this.props.unit.clockRateMhz +
+ ' MHz</code><br/>' +
+ '<strong>Num. Cores:</strong> <code>' +
+ this.props.unit.numberOfCores +
+ '</code><br/>' +
+ '<strong>Energy Cons.:</strong> <code>' +
+ this.props.unit.energyConsumptionW +
+ ' W</code>'
+ } else if (
+ this.props.unitType === 'memory' ||
+ this.props.unitType === 'storage'
+ ) {
+ unitInfo =
+ '<strong>Speed:</strong> <code>' +
+ this.props.unit.speedMbPerS +
+ ' Mb/s</code><br/>' +
+ '<strong>Size:</strong> <code>' +
+ this.props.unit.sizeMb +
+ ' MB</code><br/>' +
+ '<strong>Energy Cons.:</strong> <code> ' +
+ this.props.unit.energyConsumptionW +
+ ' W</code>'
+ }
+
+ return (
+ <li className="d-flex list-group-item justify-content-between align-items-center">
+ <span style={{ maxWidth: '60%' }}>
{this.props.unit.manufacturer +
- " " +
- this.props.unit.family +
- " " +
- this.props.unit.model +
- " " +
- this.props.unit.generation}
+ ' ' +
+ this.props.unit.family +
+ ' ' +
+ this.props.unit.model +
+ ' ' +
+ this.props.unit.generation}
</span>
- <span>
+ <span>
<span
- tabIndex="0"
- className="unit-info-popover btn btn-outline-info mr-1 fa fa-info-circle"
- role="button"
- data-toggle="popover"
- data-trigger="focus"
- title="Unit information"
- data-content={unitInfo}
- data-html="true"
+ tabIndex="0"
+ className="unit-info-popover btn btn-outline-info mr-1 fa fa-info-circle"
+ role="button"
+ data-toggle="popover"
+ data-trigger="focus"
+ title="Unit information"
+ data-content={unitInfo}
+ data-html="true"
/>
- {this.props.inSimulation ? (
- undefined
- ) : (
- <span
- className="btn btn-outline-danger"
- onClick={this.props.onDelete}
- >
- <span className="fa fa-trash" />
+ {this.props.inSimulation ? (
+ undefined
+ ) : (
+ <span
+ className="btn btn-outline-danger"
+ onClick={this.props.onDelete}
+ >
+ <span className="fa fa-trash"/>
</span>
- )}
+ )}
</span>
- </li>
- );
- }
+ </li>
+ )
+ }
}
-export default UnitComponent;
+export default UnitComponent