summaryrefslogtreecommitdiff
path: root/frontend/src/components/app/sidebars/topology/machine
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-07-02 18:39:28 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:47:21 +0200
commitf119fc78dda4d1e828dde04f378a63a93e3a0a7e (patch)
treebea1eace5d47f21a7ccb835c6a6079bc92e48710 /frontend/src/components/app/sidebars/topology/machine
parent7f27a6370a0af25e1bf6ff8f46360c6c26c21e0b (diff)
Add current progress on frontend port
Diffstat (limited to 'frontend/src/components/app/sidebars/topology/machine')
-rw-r--r--frontend/src/components/app/sidebars/topology/machine/UnitAddComponent.js4
-rw-r--r--frontend/src/components/app/sidebars/topology/machine/UnitComponent.js8
-rw-r--r--frontend/src/components/app/sidebars/topology/machine/UnitListComponent.js4
3 files changed, 5 insertions, 11 deletions
diff --git a/frontend/src/components/app/sidebars/topology/machine/UnitAddComponent.js b/frontend/src/components/app/sidebars/topology/machine/UnitAddComponent.js
index 57e219fd..e8722506 100644
--- a/frontend/src/components/app/sidebars/topology/machine/UnitAddComponent.js
+++ b/frontend/src/components/app/sidebars/topology/machine/UnitAddComponent.js
@@ -16,7 +16,7 @@ class UnitAddComponent extends React.Component {
ref={unitSelect => (this.unitSelect = unitSelect)}
>
{this.props.units.map(unit => (
- <option value={unit.id} key={unit.id}>
+ <option value={unit._id} key={unit._id}>
{unit.manufacturer +
' ' +
unit.family +
@@ -31,7 +31,7 @@ class UnitAddComponent extends React.Component {
type="submit"
className="btn btn-outline-primary"
onClick={() =>
- this.props.onAdd(parseInt(this.unitSelect.value, 10))
+ this.props.onAdd(this.unitSelect.value)
}
>
<span className="fa fa-plus mr-2"/>
diff --git a/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js b/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js
index 93ac1cdd..647c8e5c 100644
--- a/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js
+++ b/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js
@@ -40,13 +40,7 @@ class UnitComponent extends React.Component {
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.name}
</span>
<span>
<span
diff --git a/frontend/src/components/app/sidebars/topology/machine/UnitListComponent.js b/frontend/src/components/app/sidebars/topology/machine/UnitListComponent.js
index 31d4db51..da65da23 100644
--- a/frontend/src/components/app/sidebars/topology/machine/UnitListComponent.js
+++ b/frontend/src/components/app/sidebars/topology/machine/UnitListComponent.js
@@ -18,8 +18,8 @@ const UnitListComponent = ({ unitType, unitIds, inSimulation }) => (
<strong>No units of this type in this machine</strong>
) : (
<span>
- <strong>No units...</strong> Add some with the menu above!
- </span>
+ <strong>No units...</strong> Add some with the menu above!
+ </span>
)}
</div>
)}