2018-09-25 16:28:26 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
import Route from '@ember/routing/route';
|
|
|
|
export default Route.extend({
|
|
|
|
flashMessages: service(),
|
2019-02-14 18:52:34 +00:00
|
|
|
oldModel: null,
|
2018-04-24 21:30:44 +00:00
|
|
|
model(params) {
|
|
|
|
let { backend } = params;
|
|
|
|
return this.store
|
|
|
|
.query('secret-engine', {
|
|
|
|
path: backend,
|
|
|
|
})
|
|
|
|
.then(model => {
|
|
|
|
if (model) {
|
|
|
|
return model.get('firstObject');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
afterModel(model, transition) {
|
|
|
|
let path = model && model.get('path');
|
2018-10-04 06:06:01 +00:00
|
|
|
if (transition.targetName === this.routeName) {
|
2018-04-24 21:30:44 +00:00
|
|
|
return this.replaceWith('vault.cluster.secrets.backend.list-root', path);
|
2018-04-03 14:16:57 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|