2020-03-25 12:51:26 +00:00
|
|
|
import Controller from '@ember/controller';
|
2020-05-05 21:26:04 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2020-06-10 13:49:16 +00:00
|
|
|
import { action, computed } from '@ember/object';
|
2020-03-25 12:51:26 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class VolumeController extends Controller {
|
2020-05-05 21:26:04 +00:00
|
|
|
// Used in the template
|
2020-06-10 13:49:16 +00:00
|
|
|
@service system;
|
2020-05-05 21:26:04 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@computed('model.readAllocations.@each.modifyIndex')
|
|
|
|
get sortedReadAllocations() {
|
2020-04-05 00:11:58 +00:00
|
|
|
return this.model.readAllocations.sortBy('modifyIndex').reverse();
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
2020-04-05 00:11:58 +00:00
|
|
|
|
2020-06-10 13:49:16 +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-06-10 13:49:16 +00:00
|
|
|
}
|
2020-04-05 00:11:58 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@action
|
|
|
|
gotoAllocation(allocation) {
|
|
|
|
this.transitionToRoute('allocations.allocation', allocation);
|
|
|
|
}
|
|
|
|
}
|