2018-09-25 16:28:26 +00:00
|
|
|
import { set } 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 DS from 'ember-data';
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
export default Route.extend({
|
|
|
|
wizard: service(),
|
2018-04-03 14:16:57 +00:00
|
|
|
model(params) {
|
|
|
|
const { section_name: section } = params;
|
|
|
|
if (section !== 'configuration') {
|
|
|
|
const error = new DS.AdapterError();
|
2018-09-25 16:28:26 +00:00
|
|
|
set(error, 'httpStatus', 404);
|
2018-04-03 14:16:57 +00:00
|
|
|
throw error;
|
|
|
|
}
|
2018-08-28 05:03:55 +00:00
|
|
|
let backend = this.modelFor('vault.cluster.access.method');
|
|
|
|
this.get('wizard').transitionFeatureMachine(
|
|
|
|
this.get('wizard.featureState'),
|
|
|
|
'DETAILS',
|
|
|
|
backend.get('type')
|
|
|
|
);
|
|
|
|
return backend;
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
setupController(controller) {
|
|
|
|
const { section_name: section } = this.paramsFor(this.routeName);
|
|
|
|
this._super(...arguments);
|
|
|
|
controller.set('section', section);
|
|
|
|
},
|
|
|
|
});
|