open-nomad/ui/app/controllers/csi/volumes/volume.js

24 lines
694 B
JavaScript
Raw Normal View History

import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { action, computed } from '@ember/object';
export default class VolumeController extends Controller {
// Used in the template
@service system;
@computed('model.readAllocations.@each.modifyIndex')
get sortedReadAllocations() {
2020-04-05 00:11:58 +00:00
return this.model.readAllocations.sortBy('modifyIndex').reverse();
}
2020-04-05 00:11:58 +00:00
@computed('model.writeAllocations.@each.modifyIndex')
get sortedWriteAllocations() {
2020-04-05 00:11:58 +00:00
return this.model.writeAllocations.sortBy('modifyIndex').reverse();
}
2020-04-05 00:11:58 +00:00
@action
gotoAllocation(allocation) {
this.transitionToRoute('allocations.allocation', allocation);
}
}