From 25f4f5a61d6ca34496c3f3cec5621d91cbfa32d0 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Sat, 4 Apr 2020 17:11:58 -0700 Subject: [PATCH] Sort allocation tables by modify index --- ui/app/controllers/csi/volumes/volume.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ui/app/controllers/csi/volumes/volume.js b/ui/app/controllers/csi/volumes/volume.js index bff70d6ec..3d633bdc2 100644 --- a/ui/app/controllers/csi/volumes/volume.js +++ b/ui/app/controllers/csi/volumes/volume.js @@ -1,6 +1,18 @@ import Controller from '@ember/controller'; +import { inject as service } from '@ember/service'; +import { computed } from '@ember/object'; export default Controller.extend({ + system: service(), + + sortedReadAllocations: computed('model.readAllocations.@each.modifyIndex', function() { + return this.model.readAllocations.sortBy('modifyIndex').reverse(); + }), + + sortedWriteAllocations: computed('model.writeAllocations.@each.modifyIndex', function() { + return this.model.writeAllocations.sortBy('modifyIndex').reverse(); + }), + actions: { gotoAllocation(allocation) { this.transitionToRoute('allocations.allocation', allocation);