open-vault/ui/app/models/pki-certificate-sign.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
805 B
JavaScript

import { copy } from 'ember-copy';
import { computed } from '@ember/object';
import DS from 'ember-data';
import Certificate from './pki-certificate';
const { attr } = DS;
export default Certificate.extend({
signVerbatim: attr('boolean', {
readOnly: true,
defaultValue: false,
}),
csr: attr('string', {
label: 'Certificate Signing Request (CSR)',
editType: 'textarea',
}),
fieldGroups: computed('signVerbatim', function() {
const options = { Options: ['altNames', 'ipSans', 'ttl', 'excludeCnFromSans', 'otherSans'] };
const groups = [
{
default: ['csr', 'commonName', 'format', 'signVerbatim'],
},
];
if (this.get('signVerbatim') === false) {
groups.push(options);
}
return this.fieldsToAttrs(copy(groups, true));
}),
});