2017-12-15 21:39:18 +00:00
|
|
|
import { computed } from '@ember/object';
|
2017-09-19 14:47:10 +00:00
|
|
|
import DistributionBar from './distribution-bar';
|
|
|
|
|
2020-06-11 21:23:00 +00:00
|
|
|
export default class AllocationStatusBar extends DistributionBar {
|
|
|
|
layoutName = 'components/distribution-bar';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-11 21:23:00 +00:00
|
|
|
allocationContainer = null;
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-11 21:23:00 +00:00
|
|
|
'data-test-allocation-status-bar' = true;
|
2018-02-01 00:55:43 +00:00
|
|
|
|
2020-06-11 21:23:00 +00:00
|
|
|
@computed(
|
|
|
|
'allocationContainer.{queuedAllocs,completeAllocs,failedAllocs,runningAllocs,startingAllocs}'
|
|
|
|
)
|
|
|
|
get data() {
|
|
|
|
if (!this.allocationContainer) {
|
|
|
|
return [];
|
2017-09-19 14:47:10 +00:00
|
|
|
}
|
2020-06-11 21:23:00 +00:00
|
|
|
|
|
|
|
const allocs = this.allocationContainer.getProperties(
|
|
|
|
'queuedAllocs',
|
|
|
|
'completeAllocs',
|
|
|
|
'failedAllocs',
|
|
|
|
'runningAllocs',
|
|
|
|
'startingAllocs',
|
|
|
|
'lostAllocs'
|
|
|
|
);
|
|
|
|
return [
|
|
|
|
{ label: 'Queued', value: allocs.queuedAllocs, className: 'queued' },
|
|
|
|
{
|
|
|
|
label: 'Starting',
|
|
|
|
value: allocs.startingAllocs,
|
|
|
|
className: 'starting',
|
|
|
|
layers: 2,
|
|
|
|
},
|
|
|
|
{ label: 'Running', value: allocs.runningAllocs, className: 'running' },
|
|
|
|
{
|
|
|
|
label: 'Complete',
|
|
|
|
value: allocs.completeAllocs,
|
|
|
|
className: 'complete',
|
|
|
|
},
|
|
|
|
{ label: 'Failed', value: allocs.failedAllocs, className: 'failed' },
|
|
|
|
{ label: 'Lost', value: allocs.lostAllocs, className: 'lost' },
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|