open-vault/ui/app/routes/vault/cluster/tools/index.js

15 lines
496 B
JavaScript
Raw Normal View History

2018-04-03 14:16:57 +00:00
import Ember from 'ember';
import { toolsActions } from 'vault/helpers/tools-actions';
export default Ember.Route.extend({
currentCluster: Ember.inject.service(),
beforeModel(transition) {
const currentCluster = this.get('currentCluster.cluster.name');
const supportedActions = toolsActions();
if (transition.targetName === this.routeName) {
transition.abort();
return this.replaceWith('vault.cluster.tools.tool', currentCluster, supportedActions[0]);
}
},
});