open-nomad/ui/app/models/task-group-summary.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
774 B
JavaScript
Raw Normal View History

import { sum, collect } 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/model';
2017-09-19 14:47:10 +00:00
import { fragmentOwner } from 'ember-data-model-fragments/attributes';
export default class TaskGroupSummary extends Fragment {
@fragmentOwner() job;
@attr('string') name;
2017-09-19 14:47:10 +00:00
@attr('number') queuedAllocs;
@attr('number') startingAllocs;
@attr('number') runningAllocs;
@attr('number') completeAllocs;
@attr('number') failedAllocs;
@attr('number') lostAllocs;
@attr('number') unknownAllocs;
2017-09-19 14:47:10 +00:00
@collect(
2017-09-19 14:47:10 +00:00
'queuedAllocs',
'startingAllocs',
'runningAllocs',
'completeAllocs',
'failedAllocs',
'lostAllocs',
'unknownAllocs'
)
allocsList;
2017-09-19 14:47:10 +00:00
@sum('allocsList') totalAllocs;
}