github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/app/controllers/csi/volumes/volume.js (about) 1 import Controller from '@ember/controller'; 2 import { inject as service } from '@ember/service'; 3 import { action, computed } from '@ember/object'; 4 5 export default class VolumeController extends Controller { 6 // Used in the template 7 @service system; 8 9 @computed('model.readAllocations.@each.modifyIndex') 10 get sortedReadAllocations() { 11 return this.model.readAllocations.sortBy('modifyIndex').reverse(); 12 } 13 14 @computed('model.writeAllocations.@each.modifyIndex') 15 get sortedWriteAllocations() { 16 return this.model.writeAllocations.sortBy('modifyIndex').reverse(); 17 } 18 19 @action 20 gotoAllocation(allocation) { 21 this.transitionToRoute('allocations.allocation', allocation); 22 } 23 }