877cbe6fbc
This information is already loaded when traversing to an alloc row from a job, but not when traversing to an alloc row from a node.
37 lines
816 B
JavaScript
37 lines
816 B
JavaScript
import Ember from 'ember';
|
|
import { lazyClick } from '../helpers/lazy-click';
|
|
|
|
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) {
|
|
lazyClick([this.get('onClick'), event]);
|
|
},
|
|
|
|
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();
|
|
}
|
|
},
|
|
});
|