2020-06-10 13:49:16 +00:00
|
|
|
import { sum, collect } from '@ember/object/computed';
|
2017-09-19 14:47:10 +00:00
|
|
|
import Fragment from 'ember-data-model-fragments/fragment';
|
2021-02-17 21:01:44 +00:00
|
|
|
import { attr } from '@ember-data/model';
|
2017-09-19 14:47:10 +00:00
|
|
|
import { fragmentOwner } from 'ember-data-model-fragments/attributes';
|
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class TaskGroupSummary extends Fragment {
|
|
|
|
@fragmentOwner() job;
|
|
|
|
@attr('string') name;
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@attr('number') queuedAllocs;
|
|
|
|
@attr('number') startingAllocs;
|
|
|
|
@attr('number') runningAllocs;
|
|
|
|
@attr('number') completeAllocs;
|
|
|
|
@attr('number') failedAllocs;
|
|
|
|
@attr('number') lostAllocs;
|
2022-04-22 15:25:02 +00:00
|
|
|
@attr('number') unknownAllocs;
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@collect(
|
2017-09-19 14:47:10 +00:00
|
|
|
'queuedAllocs',
|
|
|
|
'startingAllocs',
|
|
|
|
'runningAllocs',
|
|
|
|
'completeAllocs',
|
|
|
|
'failedAllocs',
|
2022-04-22 15:25:02 +00:00
|
|
|
'lostAllocs',
|
|
|
|
'unknownAllocs'
|
2020-06-10 13:49:16 +00:00
|
|
|
)
|
|
|
|
allocsList;
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@sum('allocsList') totalAllocs;
|
|
|
|
}
|