2018-01-23 21:25:45 +00:00
|
|
|
import { computed } from '@ember/object';
|
|
|
|
import DistributionBar from './distribution-bar';
|
2020-06-10 13:49:16 +00:00
|
|
|
import classic from 'ember-classic-decorator';
|
2018-01-23 21:25:45 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@classic
|
|
|
|
export default class ChildrenStatusBar extends DistributionBar {
|
|
|
|
layoutName = 'components/distribution-bar';
|
2018-01-23 21:25:45 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
job = null;
|
2018-01-23 21:25:45 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
'data-test-children-status-bar' = true;
|
2018-02-01 00:55:43 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@computed('job.{pendingChildren,runningChildren,deadChildren}')
|
|
|
|
get data() {
|
2019-03-26 07:46:44 +00:00
|
|
|
if (!this.job) {
|
2018-01-23 21:25:45 +00:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2021-12-28 16:08:12 +00:00
|
|
|
const children = this.job.getProperties(
|
|
|
|
'pendingChildren',
|
|
|
|
'runningChildren',
|
|
|
|
'deadChildren'
|
|
|
|
);
|
2018-01-23 21:25:45 +00:00
|
|
|
return [
|
2021-12-28 16:08:12 +00:00
|
|
|
{
|
|
|
|
label: 'Pending',
|
|
|
|
value: children.pendingChildren,
|
|
|
|
className: 'queued',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Running',
|
|
|
|
value: children.runningChildren,
|
|
|
|
className: 'running',
|
|
|
|
},
|
2018-01-23 21:25:45 +00:00
|
|
|
{ label: 'Dead', value: children.deadChildren, className: 'complete' },
|
|
|
|
];
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
|
|
|
}
|