github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/controllers/csi/volumes/volume.js (about) 1 import Controller from '@ember/controller'; 2 import { inject as service } from '@ember/service'; 3 import { computed } from '@ember/object'; 4 5 export default Controller.extend({ 6 // Used in the template 7 system: service(), 8 9 sortedReadAllocations: computed('model.readAllocations.@each.modifyIndex', function() { 10 return this.model.readAllocations.sortBy('modifyIndex').reverse(); 11 }), 12 13 sortedWriteAllocations: computed('model.writeAllocations.@each.modifyIndex', function() { 14 return this.model.writeAllocations.sortBy('modifyIndex').reverse(); 15 }), 16 17 actions: { 18 gotoAllocation(allocation) { 19 this.transitionToRoute('allocations.allocation', allocation); 20 }, 21 }, 22 });