ui/lib/shared/addon/components/container-row/component.js

35 lines
940 B
JavaScript

import { inject as service } from '@ember/service';
import Component from '@ember/component';
import C from 'ui/utils/constants';
import layout from './template';
export default Component.extend({
layout,
scope: service(),
session: service(),
model: null,
showStats: false,
bulkActions: true,
expandPlaceholder: false,
scalePlaceholder: false,
cpuMax: null,
memoryMax: null,
storageMax: null,
networkMax: null,
showActions: true,
tagName: '',
statsAvailable: function() {
return C.ACTIVEISH_STATES.indexOf(this.get('model.state')) >= 0 && this.get('model.healthState') !== 'started-once';
}.property('model.{state,healthState}'),
detailRoute: function() {
if ( this.get('model.isVm') ) {
return 'virtualmachine';
} else {
return 'container';
}
}.property('model.isVm'),
});