open-vault/ui/app/routes/vault/cluster/tools/index.js
2018-04-03 09:16:57 -05:00

15 lines
496 B
JavaScript

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]);
}
},
});