Use more explicit branching of reserved amounts based on metric type
This commit is contained in:
parent
ab9c824c42
commit
d787dda298
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue