diff --git a/ui/app/components/primary-metric/allocation.js b/ui/app/components/primary-metric/allocation.js index a2d233630..cd4972ed2 100644 --- a/ui/app/components/primary-metric/allocation.js +++ b/ui/app/components/primary-metric/allocation.js @@ -45,7 +45,9 @@ export default class AllocationPrimaryMetric extends Component { } get reservedAmount() { - return this.metric === 'cpu' ? this.tracker.reservedCPU : this.tracker.reservedMemory; + if (this.metric === 'cpu') return this.tracker.reservedCPU; + if (this.metric === 'memory') return this.tracker.reservedMemory; + return null; } get chartClass() { diff --git a/ui/app/components/primary-metric/node.js b/ui/app/components/primary-metric/node.js index 01fea8813..440a3c58b 100644 --- a/ui/app/components/primary-metric/node.js +++ b/ui/app/components/primary-metric/node.js @@ -28,7 +28,9 @@ export default class NodePrimaryMetric extends Component { } get reservedAmount() { - return this.metric === 'cpu' ? this.tracker.reservedCPU : this.tracker.reservedMemory; + if (this.metric === 'cpu') return this.tracker.reservedCPU; + if (this.metric === 'memory') return this.tracker.reservedMemory; + return null; } get chartClass() { diff --git a/ui/app/components/primary-metric/task.js b/ui/app/components/primary-metric/task.js index f8ab0b8fd..b7c348d04 100644 --- a/ui/app/components/primary-metric/task.js +++ b/ui/app/components/primary-metric/task.js @@ -31,7 +31,9 @@ export default class TaskPrimaryMetric extends Component { get reservedAmount() { if (!this.tracker) return null; const task = this.tracker.tasks.findBy('task', this.taskState.name); - return this.metric === 'cpu' ? task.reservedCPU : task.reservedMemory; + if (this.metric === 'cpu') return task.reservedCPU; + if (this.metric === 'memory') return task.reservedMemory; + return null; } get chartClass() {