open-vault/ui/lib/kmip/addon/routes/configuration.js
Matthew Irish 9fccccb0ec
UI KMIP CA (#6983)
* move download-button and toolbar-download-button to core addon

* add ca model and adapter and show CA on the engine configuration page

* add other side of model relationship for kmip ca<->config
2019-06-26 11:02:05 -05:00

30 lines
733 B
JavaScript

import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
export default Route.extend({
store: service(),
secretMountPath: service(),
pathHelp: service(),
beforeModel() {
return this.pathHelp.getNewModel('kmip/config', this.secretMountPath.currentPath);
},
model() {
return this.store.findRecord('kmip/config', this.secretMountPath.currentPath).catch(err => {
if (err.httpStatus === 404) {
return;
} else {
throw err;
}
});
},
afterModel(model) {
if (model) {
return this.store.findRecord('kmip/ca', this.secretMountPath.currentPath).then(ca => {
model.set('ca', ca);
return model;
});
}
},
});