1bd6a69067
Closes #7197 #7199 Note: Test coverage is limited to adapter and serializer unit tests. All acceptance tests have been stubbed and all features have been manually tested end-to-end. This represents Phase 1 of #6993 which is the core workflow of CSI in the UI. It includes a couple new pages for viewing all external volumes as well as the allocations associated with each. It also updates existing volume related views on job and allocation pages to handle both Host Volumes and CSI Volumes.
47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
import { computed } from '@ember/object';
|
|
import Model from 'ember-data/model';
|
|
import attr from 'ember-data/attr';
|
|
import { belongsTo, hasMany } from 'ember-data/relationships';
|
|
|
|
export default Model.extend({
|
|
plainId: attr('string'),
|
|
name: attr('string'),
|
|
|
|
namespace: belongsTo('namespace'),
|
|
plugin: belongsTo('plugin'),
|
|
|
|
writeAllocations: hasMany('allocation'),
|
|
readAllocations: hasMany('allocation'),
|
|
|
|
allocations: computed('writeAllocations.[]', 'readAllocations.[]', function() {
|
|
return [...this.writeAllocations.toArray(), ...this.readAllocations.toArray()];
|
|
}),
|
|
|
|
externalId: attr('string'),
|
|
topologies: attr(),
|
|
accessMode: attr('string'),
|
|
attachmentMode: attr('string'),
|
|
schedulable: attr('boolean'),
|
|
provider: attr('string'),
|
|
version: attr('string'),
|
|
|
|
controllerRequired: attr('boolean'),
|
|
controllersHealthy: attr('number'),
|
|
controllersExpected: attr('number'),
|
|
|
|
controllersHealthyProportion: computed('controllersHealthy', 'controllersExpected', function() {
|
|
return this.controllersHealthy / this.controllersExpected;
|
|
}),
|
|
|
|
nodesHealthy: attr('number'),
|
|
nodesExpected: attr('number'),
|
|
|
|
nodesHealthyProportion: computed('nodesHealthy', 'nodesExpected', function() {
|
|
return this.nodesHealthy / this.nodesExpected;
|
|
}),
|
|
|
|
resourceExhausted: attr('number'),
|
|
createIndex: attr('number'),
|
|
modifyIndex: attr('number'),
|
|
});
|