mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-18 12:37:02 +02:00
32 lines
778 B
JavaScript
32 lines
778 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import Route from '@ember/routing/route';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export default Route.extend({
|
|
store: service(),
|
|
secretMountPath: service(),
|
|
pathHelp: service(),
|
|
scope() {
|
|
return this.paramsFor('scope').scope_name;
|
|
},
|
|
beforeModel() {
|
|
this.store.unloadAll('kmip/role');
|
|
return this.pathHelp.getNewModel('kmip/role', this.secretMountPath.currentPath);
|
|
},
|
|
model() {
|
|
const model = this.store.createRecord('kmip/role', {
|
|
backend: this.secretMountPath.currentPath,
|
|
scope: this.scope(),
|
|
});
|
|
return model;
|
|
},
|
|
setupController(controller) {
|
|
this._super(...arguments);
|
|
controller.set('scope', this.scope());
|
|
},
|
|
});
|