1107798da6
Generated with a codemode: https://github.com/ember-cli/ember-modules-codemod
44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
import { computed } from '@ember/object';
|
|
import DistributionBar from './distribution-bar';
|
|
|
|
export default DistributionBar.extend({
|
|
layoutName: 'components/distribution-bar',
|
|
|
|
allocationContainer: null,
|
|
|
|
data: computed(
|
|
'allocationContainer.{queuedAllocs,completeAllocs,failedAllocs,runningAllocs,startingAllocs}',
|
|
function() {
|
|
if (!this.get('allocationContainer')) {
|
|
return [];
|
|
}
|
|
|
|
const allocs = this.get('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' },
|
|
];
|
|
}
|
|
),
|
|
});
|