2017-09-19 14:47:10 +00:00
|
|
|
import Ember from 'ember';
|
2017-09-26 18:57:46 +00:00
|
|
|
import { lazyClick } from '../helpers/lazy-click';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
const { Component } = Ember;
|
|
|
|
|
|
|
|
export default Component.extend({
|
|
|
|
tagName: 'tr',
|
|
|
|
|
|
|
|
classNames: ['allocation-row', 'is-interactive'],
|
|
|
|
|
|
|
|
allocation: null,
|
|
|
|
|
|
|
|
// Used to determine whether the row should mention the node or the job
|
|
|
|
context: null,
|
|
|
|
|
|
|
|
onClick() {},
|
|
|
|
|
|
|
|
click(event) {
|
2017-09-26 18:57:46 +00:00
|
|
|
lazyClick([this.get('onClick'), event]);
|
2017-09-19 14:47:10 +00:00
|
|
|
},
|
2017-10-04 00:18:33 +00:00
|
|
|
|
|
|
|
didReceiveAttrs() {
|
|
|
|
// If the job for this allocation is incomplete, reload it to get
|
|
|
|
// detailed information.
|
|
|
|
const allocation = this.get('allocation');
|
|
|
|
if (
|
|
|
|
allocation &&
|
|
|
|
allocation.get('job') &&
|
|
|
|
!allocation.get('job.isPending') &&
|
|
|
|
!allocation.get('taskGroup')
|
|
|
|
) {
|
|
|
|
const job = allocation.get('job.content');
|
|
|
|
job && job.reload();
|
|
|
|
}
|
|
|
|
},
|
2017-09-19 14:47:10 +00:00
|
|
|
});
|