open-vault/ui/app/routes/vault/cluster/secrets/backend.js

26 lines
641 B
JavaScript
Raw Normal View History

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,
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) {
return this.replaceWith('vault.cluster.secrets.backend.list-root', path);
2018-04-03 14:16:57 +00:00
}
},
});