2018-09-25 16:28:26 +00:00
|
|
|
import { computed } from '@ember/object';
|
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
import Route from '@ember/routing/route';
|
2018-04-03 14:16:57 +00:00
|
|
|
import ModelBoundaryRoute from 'vault/mixins/model-boundary-route';
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
export default Route.extend(ModelBoundaryRoute, {
|
|
|
|
auth: service(),
|
|
|
|
controlGroup: service(),
|
|
|
|
flashMessages: service(),
|
|
|
|
console: service(),
|
2019-01-18 22:04:40 +00:00
|
|
|
permissions: service(),
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
modelTypes: computed(function() {
|
|
|
|
return ['secret', 'secret-engine'];
|
|
|
|
}),
|
2018-04-03 14:16:57 +00:00
|
|
|
|
|
|
|
beforeModel() {
|
|
|
|
this.get('auth').deleteCurrentToken();
|
2018-07-19 01:59:04 +00:00
|
|
|
this.get('controlGroup').deleteTokens();
|
2018-05-25 20:33:22 +00:00
|
|
|
this.get('console').set('isOpen', false);
|
|
|
|
this.get('console').clearLog(true);
|
2018-04-03 14:16:57 +00:00
|
|
|
this.clearModelCache();
|
|
|
|
this.replaceWith('vault.cluster');
|
|
|
|
this.get('flashMessages').clearMessages();
|
2019-01-18 22:04:40 +00:00
|
|
|
this.get('permissions').reset();
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
});
|