mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
* adds pki certificate details page component * adds tests for pki base adapter * adds more comments * updates remaining pki/certificate model references to pki/certificate/base
29 lines
736 B
JavaScript
29 lines
736 B
JavaScript
import PkiOverviewRoute from '../overview';
|
|
import { inject as service } from '@ember/service';
|
|
import { hash } from 'rsvp';
|
|
|
|
export default class PkiCertificatesIndexRoute extends PkiOverviewRoute {
|
|
@service store;
|
|
@service secretMountPath;
|
|
|
|
async fetchCertificates() {
|
|
try {
|
|
return await this.store.query('pki/certificate/base', { backend: this.secretMountPath.currentPath });
|
|
} catch (e) {
|
|
if (e.httpStatus === 404) {
|
|
return { parentModel: this.modelFor('certificates') };
|
|
} else {
|
|
throw e;
|
|
}
|
|
}
|
|
}
|
|
|
|
model() {
|
|
return hash({
|
|
hasConfig: this.hasConfig(),
|
|
certificates: this.fetchCertificates(),
|
|
parentModel: this.modelFor('certificates'),
|
|
});
|
|
}
|
|
}
|