Filter total alloc count by only scheduled allocs

This commit is contained in:
Michael Lange 2020-10-10 15:37:18 -07:00
parent d9ac6a63c6
commit ba8675ae87
2 changed files with 7 additions and 2 deletions

View File

@ -5,10 +5,16 @@ import { reduceToLargestUnit } from 'nomad-ui/helpers/format-bytes';
@classic
export default class TopologyControllers extends Controller {
@computed('model.nodes.@each.datacenter')
get datacenters() {
return Array.from(new Set(this.model.nodes.mapBy('datacenter'))).compact();
}
@computed('model.allocations.@each.isScheduled')
get scheduledAllocations() {
return this.model.allocations.filterBy('isScheduled');
}
@computed('model.nodes.@each.resources')
get totalMemory() {
const mibs = this.model.nodes

View File

@ -128,8 +128,7 @@
<p class="metric">{{this.model.nodes.length}} <span class="metric-label">Clients</span></p>
</div>
<div class="dashboard-metric column">
{{! TODO: make sure that this is only the scheduled allocations }}
<p class="metric">{{this.model.allocations.length}} <span class="metric-label">Allocations</span></p>
<p class="metric">{{this.scheduledAllocations.length}} <span class="metric-label">Allocations</span></p>
</div>
</div>
<div class="dashboard-metric with-divider">