2017-12-15 21:39:18 +00:00
|
|
|
import { collect, sum } from '@ember/object/computed';
|
2017-09-19 14:47:10 +00:00
|
|
|
import Fragment from 'ember-data-model-fragments/fragment';
|
|
|
|
import attr from 'ember-data/attr';
|
|
|
|
import { fragmentOwner } from 'ember-data-model-fragments/attributes';
|
|
|
|
|
|
|
|
export default Fragment.extend({
|
|
|
|
job: fragmentOwner(),
|
|
|
|
name: attr('string'),
|
|
|
|
|
|
|
|
queuedAllocs: attr('number'),
|
|
|
|
startingAllocs: attr('number'),
|
|
|
|
runningAllocs: attr('number'),
|
|
|
|
completeAllocs: attr('number'),
|
|
|
|
failedAllocs: attr('number'),
|
|
|
|
lostAllocs: attr('number'),
|
|
|
|
|
2017-12-15 21:39:18 +00:00
|
|
|
allocsList: collect(
|
2017-09-19 14:47:10 +00:00
|
|
|
'queuedAllocs',
|
|
|
|
'startingAllocs',
|
|
|
|
'runningAllocs',
|
|
|
|
'completeAllocs',
|
|
|
|
'failedAllocs',
|
|
|
|
'lostAllocs'
|
|
|
|
),
|
|
|
|
|
2017-12-15 21:39:18 +00:00
|
|
|
totalAllocs: sum('allocsList'),
|
2017-09-19 14:47:10 +00:00
|
|
|
});
|