2018-09-25 16:28:26 +00:00
|
|
|
import { alias } from '@ember/object/computed';
|
|
|
|
import { computed } from '@ember/object';
|
2018-07-19 01:59:04 +00:00
|
|
|
import DS from 'ember-data';
|
|
|
|
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
|
|
|
|
|
|
|
|
const { attr } = DS;
|
|
|
|
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
|
|
|
|
|
|
|
export default DS.Model.extend({
|
|
|
|
fields: computed(function() {
|
|
|
|
return expandAttributeMeta(this, ['maxTtl']);
|
|
|
|
}),
|
|
|
|
|
|
|
|
configurePath: lazyCapabilities(apiPath`sys/config/control-group`),
|
2018-09-25 16:28:26 +00:00
|
|
|
canDelete: alias('configurePath.canDelete'),
|
2018-07-19 01:59:04 +00:00
|
|
|
maxTtl: attr({
|
|
|
|
defaultValue: 0,
|
|
|
|
editType: 'ttl',
|
|
|
|
label: 'Max TTL',
|
|
|
|
}),
|
|
|
|
});
|