Files
nomad/ui/app/controllers/csi/plugins/plugin/index.js
Phil Renaud 72a9f2b551 [ui] links to allocations explicitly go through their route model hook (#17737)
* links to allocations explicitly go through their route model hook

* Acceptance test to make sure alloc clicking loads alloc endpoint obj
2023-06-27 10:01:50 -04:00

25 lines
627 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Controller from '@ember/controller';
import { action, computed } from '@ember/object';
export default class IndexController extends Controller {
@computed('model.controllers.@each.updateTime')
get sortedControllers() {
return this.model.controllers.sortBy('updateTime').reverse();
}
@computed('model.nodes.@each.updateTime')
get sortedNodes() {
return this.model.nodes.sortBy('updateTime').reverse();
}
@action
gotoAllocation(allocation) {
this.transitionToRoute('allocations.allocation', allocation.id);
}
}