github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/models/volume.js (about) 1 import { computed } from '@ember/object'; 2 import Model from 'ember-data/model'; 3 import attr from 'ember-data/attr'; 4 import { belongsTo, hasMany } from 'ember-data/relationships'; 5 6 export default Model.extend({ 7 plainId: attr('string'), 8 name: attr('string'), 9 10 namespace: belongsTo('namespace'), 11 plugin: belongsTo('plugin'), 12 13 writeAllocations: hasMany('allocation'), 14 readAllocations: hasMany('allocation'), 15 16 allocations: computed('writeAllocations.[]', 'readAllocations.[]', function() { 17 return [...this.writeAllocations.toArray(), ...this.readAllocations.toArray()]; 18 }), 19 20 externalId: attr('string'), 21 topologies: attr(), 22 accessMode: attr('string'), 23 attachmentMode: attr('string'), 24 schedulable: attr('boolean'), 25 provider: attr('string'), 26 version: attr('string'), 27 28 controllerRequired: attr('boolean'), 29 controllersHealthy: attr('number'), 30 controllersExpected: attr('number'), 31 32 controllersHealthyProportion: computed('controllersHealthy', 'controllersExpected', function() { 33 return this.controllersHealthy / this.controllersExpected; 34 }), 35 36 nodesHealthy: attr('number'), 37 nodesExpected: attr('number'), 38 39 nodesHealthyProportion: computed('nodesHealthy', 'nodesExpected', function() { 40 return this.nodesHealthy / this.nodesExpected; 41 }), 42 43 resourceExhausted: attr('number'), 44 createIndex: attr('number'), 45 modifyIndex: attr('number'), 46 });