open-nomad/ui/app/components/children-status-bar.js

27 lines
813 B
JavaScript
Raw Normal View History

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