github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/models/node-driver.js (about) 1 import Fragment from 'ember-data-model-fragments/fragment'; 2 import { computed, get } from '@ember/object'; 3 import attr from 'ember-data/attr'; 4 import { fragmentOwner } from 'ember-data-model-fragments/attributes'; 5 import { fragment } from 'ember-data-model-fragments/attributes'; 6 7 export default Fragment.extend({ 8 node: fragmentOwner(), 9 10 attributes: fragment('node-attributes'), 11 12 attributesShort: computed('name', 'attributes.attributesStructured', function() { 13 const attributes = this.get('attributes.attributesStructured'); 14 return get(attributes, `driver.${this.name}`); 15 }), 16 17 name: attr('string'), 18 detected: attr('boolean', { defaultValue: false }), 19 healthy: attr('boolean', { defaultValue: false }), 20 healthDescription: attr('string'), 21 updateTime: attr('date'), 22 23 healthClass: computed('healthy', function() { 24 return this.healthy ? 'running' : 'failed'; 25 }), 26 });