open-vault/ui/app/routes/vault/cluster/secrets/backend/credentials.js
Matthew Irish d509588cd2
Ember update (#5386)
Ember update - update ember-cli, ember-data, and ember to 3.4 series
2018-09-25 11:28:26 -05:00

33 lines
825 B
JavaScript

import { resolve } from 'rsvp';
import Route from '@ember/routing/route';
const SUPPORTED_DYNAMIC_BACKENDS = ['ssh', 'aws', 'pki'];
export default Route.extend({
templateName: 'vault/cluster/secrets/backend/credentials',
backendModel() {
return this.modelFor('vault.cluster.secrets.backend');
},
model(params) {
let role = params.secret;
let backendModel = this.backendModel();
let backendPath = backendModel.get('id');
let backendType = backendModel.get('type');
if (!SUPPORTED_DYNAMIC_BACKENDS.includes(backendModel.get('type'))) {
return this.transitionTo('vault.cluster.secrets.backend.list-root', backendPath);
}
return resolve({
backendPath,
backendType,
roleName: role,
});
},
resetController(controller) {
controller.reset();
},
});