Data modeling for node drain and scheduling eligibility
This commit is contained in:
parent
5aebd8d2d0
commit
078d921dc4
|
@ -1,4 +1,5 @@
|
|||
import { computed } from '@ember/object';
|
||||
import { equal } from '@ember/object/computed';
|
||||
import Model from 'ember-data/model';
|
||||
import attr from 'ember-data/attr';
|
||||
import { hasMany } from 'ember-data/relationships';
|
||||
|
@ -11,6 +12,7 @@ export default Model.extend({
|
|||
name: attr('string'),
|
||||
datacenter: attr('string'),
|
||||
isDraining: attr('boolean'),
|
||||
schedulingEligibility: attr('string'),
|
||||
status: attr('string'),
|
||||
statusDescription: attr('string'),
|
||||
shortId: shortUUIDProperty('id'),
|
||||
|
@ -24,6 +26,8 @@ export default Model.extend({
|
|||
resources: fragment('resources'),
|
||||
reserved: fragment('resources'),
|
||||
|
||||
isEligible: equal('schedulingEligibility', 'eligible'),
|
||||
|
||||
address: computed('httpAddr', function() {
|
||||
return ipParts(this.get('httpAddr')).address;
|
||||
}),
|
||||
|
|
|
@ -7,6 +7,7 @@ export default ApplicationSerializer.extend({
|
|||
config: service(),
|
||||
|
||||
attrs: {
|
||||
isDraining: 'Drain',
|
||||
httpAddr: 'HTTPAddr',
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue